/[drupal]/contributions/modules/diff/node.inc
ViewVC logotype

Contents of /contributions/modules/diff/node.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Tue Sep 2 18:36:44 2008 UTC (14 months, 3 weeks ago) by weitzman
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +3 -3 lines
File MIME type: text/x-php
Add back a diff that is compatible with D7 core. See http://drupal.org/node/120955
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 }

  ViewVC Help
Powered by ViewVC 1.1.2