| 1 |
<?php
|
| 2 |
// $Id: node.inc,v 1.2.2.1.2.1 2008/04/08 14:01:57 weitzman Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_diff() for node.module (body and title).
|
| 6 |
*/
|
| 7 |
function node_diff(&$old_node, &$new_node) {
|
| 8 |
|
| 9 |
$result = array();
|
| 10 |
$type = node_get_types('type', $new_node);
|
| 11 |
$result['title'] = array(
|
| 12 |
'#name' => $type->title_label,
|
| 13 |
'#old' => array($old_node->title),
|
| 14 |
'#new' => array($new_node->title),
|
| 15 |
'#weight' => -5,
|
| 16 |
'#format' => array(
|
| 17 |
'show_header' => FALSE,
|
| 18 |
)
|
| 19 |
);
|
| 20 |
if ($type->has_body) {
|
| 21 |
$result['body'] = array(
|
| 22 |
'#name' => $type->body_label,
|
| 23 |
'#old' => explode("\n", $old_node->body),
|
| 24 |
'#new' => explode("\n", $new_node->body),
|
| 25 |
);
|
| 26 |
}
|
| 27 |
return $result;
|
| 28 |
}
|