| 1 |
<?php |
<?php |
| 2 |
// $Id: node_export.api.php,v 1.1.2.1 2009/09/08 10:14:12 danielb Exp $ |
// $Id: node_export.api.php,v 1.1.2.2 2009/09/09 01:39:29 danielb Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Documents node_export's hooks for api reference. |
* Documents node_export's hooks for api reference. |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
/** |
/** |
| 10 |
* Override export access on a node. |
* Override export access on a node. |
| 11 |
* |
* |
| 12 |
* Let other modules alter this - for example to only allow some users to |
* Let other modules alter this - for example to only allow some users to |
| 13 |
* export specific nodes or types. |
* export specific nodes or types. |
| 14 |
* |
* |
| 15 |
* @param &$access |
* @param &$access |
| 16 |
* Boolean access value for current user. |
* Boolean access value for current user. |
| 17 |
* @param $node |
* @param $node |
| 18 |
* The node to determine access for. |
* The node to determine access for. |
| 19 |
*/ |
*/ |
| 20 |
function hook_node_export_access_alter(&$access, $node) { |
function hook_node_export_access_alter(&$access, $node) { |
| 21 |
// no example code |
// no example code |
| 22 |
} |
} |
| 23 |
|
|
| 24 |
/** |
/** |
| 25 |
* Manipulate a node on import/export. |
* Manipulate a node on import/export. |
| 26 |
* |
* |
| 27 |
* @param &$node |
* @param &$node |
| 28 |
* The node to alter. |
* The node to alter. |
| 29 |
* @param $original_node |
* @param $original_node |
| 30 |
* The unaltered node. |
* The unaltered node. |
| 31 |
* @param $method |
* @param $method |
| 32 |
* 'export' for exports, and 'prepopulate' or 'save-edit' for imports |
* 'export' for exports, and 'prepopulate' or 'save-edit' for imports |
| 33 |
* depending on the method used. |
* depending on the method used. |
| 34 |
*/ |
*/ |
| 35 |
function hook_node_export_node_alter(&$node, $original_node, $method) { |
function hook_node_export_node_alter(&$node, $original_node, $method) { |
| 36 |
// no example code |
// no example code |
| 37 |
} |
} |
| 38 |
|
|
| 39 |
/** |
/** |
| 40 |
* Override one line of the export code output. |
* Override one line of the export code output. |
| 41 |
* |
* |
| 42 |
* @param &$out |
* @param &$out |
| 43 |
* The line of output. |
* The line of output. |
| 44 |
* @param $tab |
* @param $tab |
| 45 |
* The $tab variable from node_export_node_encode(). |
* The $tab variable from node_export_node_encode(). |
| 46 |
* @param $key |
* @param $key |
| 47 |
* The $key variable from node_export_node_encode(). |
* The $key variable from node_export_node_encode(). |
| 48 |
* @param $value |
* @param $value |
| 49 |
* The $value variable from node_export_node_encode(). |
* The $value variable from node_export_node_encode(). |
| 50 |
* @param $iteration |
* @param $iteration |
| 51 |
* The $iteration variable from node_export_node_encode(). |
* The $iteration variable from node_export_node_encode(). |
| 52 |
*/ |
*/ |
| 53 |
function hook_node_export_node_encode_alter(&$out, $tab, $key, $value, $iteration) { |
function hook_node_export_node_encode_alter(&$out, $tab, $key, $value, $iteration) { |
| 54 |
// Start with something like this, and work on it: |
// Start with something like this, and work on it: |
| 55 |
$out = $tab ." '". $key ."' => ". node_export_node_encode($value, $iteration) .",\n"; |
$out = $tab ." '". $key ."' => ". node_export_node_encode($value, $iteration) .",\n"; |
| 56 |
} |
} |