1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* The Node export serialize format handler.
|
6 |
|
|
*
|
7 |
|
|
* Adds serialize format to Node export.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
/**
|
11 |
|
|
* Export callback.
|
12 |
|
|
*/
|
13 |
|
|
function node_export_serialize_export($nodes, $format) {
|
14 |
|
|
return 'node_export_serialize::' . htmlspecialchars(serialize($nodes));
|
15 |
|
|
}
|
16 |
|
|
|
17 |
|
|
/**
|
18 |
|
|
* Import callback.
|
19 |
|
|
*/
|
20 |
|
|
function node_export_serialize_import($code_string) {
|
21 |
|
|
// Check for 'node_export_serialize::' at the start.
|
22 |
|
|
if (substr(ltrim($code_string), 0, 23) == 'node_export_serialize::') {
|
23 |
|
|
return unserialize(htmlspecialchars_decode(str_replace('node_export_serialize::', '', $code_string)));
|
24 |
|
|
}
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
/**
|
28 |
|
|
* Callback for actions.
|
29 |
|
|
*/
|
30 |
|
|
function node_export_serialize_action_form($context, &$form_state) {
|
31 |
|
|
return node_export_action_form($context, $form_state, 'serialize');
|
32 |
|
|
} |