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 @ 41cc1b08

1
<?php
2
/**
3
 * @file
4
 * feeds_import.feeds_importer_default.inc
5
 */
6

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

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

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

    
125
  return $export;
126
}