1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* feeds_import.feeds_importer_default.inc
|
5
|
*/
|
6
|
|
7
|
/**
|
8
|
* Implementation of 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
|
'roles' => array(),
|
95
|
'update_existing' => FALSE,
|
96
|
'status' => 1,
|
97
|
'mappings' => array(
|
98
|
0 => array(
|
99
|
'source' => 'name',
|
100
|
'target' => 'name',
|
101
|
'unique' => 0,
|
102
|
),
|
103
|
1 => array(
|
104
|
'source' => 'mail',
|
105
|
'target' => 'mail',
|
106
|
'unique' => 1,
|
107
|
),
|
108
|
2 => array(
|
109
|
'source' => 'created',
|
110
|
'target' => 'created',
|
111
|
'unique' => FALSE,
|
112
|
),
|
113
|
),
|
114
|
),
|
115
|
),
|
116
|
'content_type' => '',
|
117
|
'update' => 0,
|
118
|
'import_period' => '-1',
|
119
|
'expire_period' => 3600,
|
120
|
'import_on_create' => 1,
|
121
|
);
|
122
|
$export['user'] = $feeds_importer;
|
123
|
|
124
|
return $export;
|
125
|
}
|