Projet

Général

Profil

Paste
Télécharger (3,16 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / feeds / feeds_import / feeds_import.feeds_importer_default.inc @ ed9a13f1

1
<?php
2

    
3
/**
4
 * @file
5
 * feeds_import.feeds_importer_default.inc
6
 */
7

    
8
/**
9
 * Implements hook_feeds_importer_default().
10
 */
11
function feeds_import_feeds_importer_default() {
12
  $export = array();
13

    
14
  $feeds_importer = new stdClass();
15
  $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
16
  $feeds_importer->api_version = 1;
17
  $feeds_importer->id = 'node';
18
  $feeds_importer->config = array(
19
    'name' => 'Node import',
20
    'description' => 'Import nodes from CSV file.',
21
    'fetcher' => array(
22
      'plugin_key' => 'FeedsFileFetcher',
23
      'config' => array(
24
        'direct' => FALSE,
25
      ),
26
    ),
27
    'parser' => array(
28
      'plugin_key' => 'FeedsCSVParser',
29
      'config' => array(
30
        'delimiter' => ',',
31
      ),
32
    ),
33
    'processor' => array(
34
      'plugin_key' => 'FeedsNodeProcessor',
35
      'config' => array(
36
        'bundle' => 'article',
37
        'update_existing' => 1,
38
        'expire' => '-1',
39
        'mappings' => array(
40
          0 => array(
41
            'source' => 'title',
42
            'target' => 'title',
43
            'unique' => FALSE,
44
          ),
45
          1 => array(
46
            'source' => 'body',
47
            'target' => 'body',
48
            'unique' => FALSE,
49
          ),
50
          2 => array(
51
            'source' => 'published',
52
            'target' => 'created',
53
            'unique' => FALSE,
54
          ),
55
          3 => array(
56
            'source' => 'guid',
57
            'target' => 'guid',
58
            'unique' => 1,
59
          ),
60
        ),
61
        'input_format' => 'plain_text',
62
        'author' => 0,
63
      ),
64
    ),
65
    'content_type' => '',
66
    'update' => 0,
67
    'import_period' => '-1',
68
    'expire_period' => 3600,
69
    'import_on_create' => 1,
70
  );
71
  $export['node'] = $feeds_importer;
72

    
73
  $feeds_importer = new stdClass();
74
  $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
75
  $feeds_importer->api_version = 1;
76
  $feeds_importer->id = 'user';
77
  $feeds_importer->config = array(
78
    'name' => 'User import',
79
    'description' => 'Import users from CSV file.',
80
    'fetcher' => array(
81
      'plugin_key' => 'FeedsFileFetcher',
82
      'config' => array(
83
        'direct' => FALSE,
84
      ),
85
    ),
86
    'parser' => array(
87
      'plugin_key' => 'FeedsCSVParser',
88
      'config' => array(
89
        'delimiter' => ',',
90
      ),
91
    ),
92
    'processor' => array(
93
      'plugin_key' => 'FeedsUserProcessor',
94
      'config' => array(
95
        'bundle' => 'user',
96
        'roles' => array(),
97
        'update_existing' => 0,
98
        'status' => 1,
99
        'mappings' => array(
100
          0 => array(
101
            'source' => 'name',
102
            'target' => 'name',
103
            'unique' => 0,
104
          ),
105
          1 => array(
106
            'source' => 'mail',
107
            'target' => 'mail',
108
            'unique' => 1,
109
          ),
110
          2 => array(
111
            'source' => 'created',
112
            'target' => 'created',
113
            'unique' => FALSE,
114
          ),
115
        ),
116
      ),
117
    ),
118
    'content_type' => '',
119
    'update' => 0,
120
    'import_period' => '-1',
121
    'expire_period' => 3600,
122
    'import_on_create' => 1,
123
  );
124
  $export['user'] = $feeds_importer;
125

    
126
  return $export;
127
}