1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* The Node export formats file.
|
6
|
*
|
7
|
* Implements the default node export format handlers.
|
8
|
*/
|
9
|
|
10
|
/**
|
11
|
* Implements hook_node_export_format_handlers().
|
12
|
*/
|
13
|
function node_export_node_export_format_handlers() {
|
14
|
return array(
|
15
|
'json' => array(
|
16
|
'#title' => t('JSON'),
|
17
|
'#module' => 'node_export',
|
18
|
'#file' => drupal_get_path('module', 'node_export') . '/formats/json.inc',
|
19
|
'#description' => t(
|
20
|
'<a href="!json">JavaScript Object Notation</a> code.',
|
21
|
array(
|
22
|
'!json' => 'http://en.wikipedia.org/wiki/JSON'
|
23
|
)
|
24
|
),
|
25
|
'#mime' => 'application/json',
|
26
|
'#export_callback' => 'node_export_json_export',
|
27
|
'#import_callback' => 'node_export_json_import',
|
28
|
),
|
29
|
|
30
|
'drupal' => array(
|
31
|
'#title' => t('Drupal var export'),
|
32
|
'#module' => 'node_export',
|
33
|
'#file' => drupal_get_path('module', 'node_export') . '/formats/drupal.inc',
|
34
|
'#description' => t(
|
35
|
'<a href="!drupal">Drupal var export</a> code.',
|
36
|
array(
|
37
|
'!drupal' => 'http://api.drupal.org/api/drupal/includes!utility.inc/function/drupal_var_export/7'
|
38
|
)
|
39
|
),
|
40
|
'#export_callback' => 'node_export_drupal_export',
|
41
|
'#import_callback' => 'node_export_drupal_import',
|
42
|
),
|
43
|
|
44
|
'serialize' => array(
|
45
|
'#title' => t('Serialize'),
|
46
|
'#module' => 'node_export',
|
47
|
'#file' => drupal_get_path('module', 'node_export') . '/formats/serialize.inc',
|
48
|
'#description' => t(
|
49
|
'Very robust, though not human readable, representation through <a href="!wiki">Serialization</a> using the PHP <a href="!php">serialize</a> function.',
|
50
|
array(
|
51
|
'!wiki' => 'http://tools.ietf.org/html/rfc4180',
|
52
|
'!php' => 'http://en.wikipedia.org/wiki/Comma-separated_values'
|
53
|
)
|
54
|
),
|
55
|
'#export_callback' => 'node_export_serialize_export',
|
56
|
'#import_callback' => 'node_export_serialize_import',
|
57
|
),
|
58
|
|
59
|
'xml' => array(
|
60
|
'#title' => t('XML'),
|
61
|
'#module' => 'node_export',
|
62
|
'#file' => drupal_get_path('module', 'node_export') . '/formats/xml.inc',
|
63
|
'#description' => t(
|
64
|
'<a href="!xml">XML 1.0</a> representation which is good for machine-readability and human-readability.',
|
65
|
array(
|
66
|
'!xml' => 'http://en.wikipedia.org/wiki/XML',
|
67
|
)
|
68
|
),
|
69
|
'#mime' => 'application/xml',
|
70
|
'#export_callback' => 'node_export_xml_export',
|
71
|
'#import_callback' => 'node_export_xml_import',
|
72
|
),
|
73
|
|
74
|
'dsv' => array(
|
75
|
'#title' => t('DSV'),
|
76
|
'#module' => 'node_export',
|
77
|
'#file' => drupal_get_path('module', 'node_export') . '/formats/dsv.inc',
|
78
|
'#description' => t(
|
79
|
'Configurable <a href="!dsv">Delimiter-separated values</a> code. Export and import sites must be configured the same.',
|
80
|
array(
|
81
|
'!dsv' => 'http://en.wikipedia.org/wiki/Delimiter-separated_values'
|
82
|
)
|
83
|
),
|
84
|
'#settings_callback' => 'node_export_dsv_settings',
|
85
|
'#export_callback' => 'node_export_dsv_export',
|
86
|
'#import_callback' => 'node_export_dsv_import',
|
87
|
),
|
88
|
|
89
|
);
|
90
|
}
|