? dif ? diff_125494_comments.patch ? diff_125494_preview_changes.patch cvs diff: Diffing . Index: diff.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/diff/diff.module,v retrieving revision 1.8.2.10 diff -u -p -u -p -r1.8.2.10 diff.module --- diff.module 12 Dec 2007 23:44:16 -0000 1.8.2.10 +++ diff.module 13 Dec 2007 00:11:12 -0000 @@ -123,6 +123,9 @@ function diff_diffs_overview(&$node) { /** * Input form to select two revisions. + * + * @param $node + * Node whose revisions are displayed for selection. */ function diff_node_revisions(&$node) { global $form_values; @@ -280,6 +283,13 @@ function diff_node_revisions_validate($f /** * Create output string for a comparison of 'node' between * versions 'old_vid' and 'new_vid'. + * + * @param $node + * Node on which to perform comparison + * @param $old_vid + * Version ID of the old revision. + * @param $new_vid + * Version ID of the new revision. */ function diff_diffs_show(&$node, $old_vid, $new_vid) { @@ -345,6 +355,11 @@ function diff_diffs_show(&$node, $old_vi /** * Create the table body of the diff between $old_node and $new_node. * The result is a html table part enclosed in tags. + * + * @param $old_node + * Node for comparison which will be displayed on the left side. + * @param $new_node + * Node for comparison which will be displayed on the right side. */ function _diff_table_body(&$old_node, &$new_node) { drupal_add_css(drupal_get_path('module', 'diff') .'/diff.css', 'module', 'all', FALSE); @@ -381,8 +396,13 @@ function _diff_table_body(&$old_node, &$ } /** - * Get the entry in the revisions list after 'vid'. - * Returns false if 'vid' is the last entry. + * Get the entry in the revisions list after $vid. + * Returns false if $vid is the last entry. + * + * @param $node_revisions + * Array of node revision IDs in descending order. + * @param $vid + * Version ID to look for. */ function _diff_get_next_vid(&$node_revisions, $vid) { $previous = NULL; @@ -396,8 +416,13 @@ function _diff_get_next_vid(&$node_revis } /** - * Get the entry in the revision list before 'vid'. - * Returns false if 'vid' is the first entry. + * Get the entry in the revision list before $vid. + * Returns false if $vid is the first entry. + * + * @param $node_revisions + * Array of node revision IDs in descending order. + * @param $vid + * Version ID to look for. */ function _diff_get_previous_vid(&$node_revisions, $vid) { $previous = NULL; @@ -432,6 +457,27 @@ function diff_form_alter($form_id, &$for } /** + * Callback for node edit form to add the 'Preview changes' output. + */ +function diff_node_form_add_changes($form) { + global $form_values; + + $op = isset($form_values['op']) ? $form_values['op'] : ''; + if ($op == t('Preview changes')) { + $node = (object)$form_values; + $changes = ''; + $changes .= _diff_table_body(node_load($form_values['nid']), $node); + $changes .= '
'; + $form['#prefix'] = isset($form['#prefix']) ? $changes . $form['#prefix'] : $changes; + } + return $form; +} + +/** + * Theme functions + */ + +/** * A copy of the 'theme_node_form' function with the addition of the new button * to show a diff of the changes. */ @@ -473,20 +519,3 @@ function theme_diff_node_form($form) { return $output; } - -/** - * Callback for node edit form to prepend the changes or preview to the form. - */ -function diff_node_form_add_changes($form) { - global $form_values; - - $op = isset($form_values['op']) ? $form_values['op'] : ''; - if ($op == t('Preview changes')) { - $node = (object)$form_values; - $changes = ''; - $changes .= _diff_table_body(node_load($form_values['nid']), $node); - $changes .= '
'; - $form['#prefix'] = isset($form['#prefix']) ? $changes . $form['#prefix'] : $changes; - } - return $form; -} cvs diff: Diffing Text cvs diff: Diffing Text/Diff cvs diff: Diffing Text/Diff/Engine cvs diff: Diffing Text/Diff/Renderer cvs diff: Diffing po