You are here

function _diff_module_invoke_all in Diff 7.2

Same name and namespace in other branches
  1. 6.2 diff.pages.inc \_diff_module_invoke_all()

Helper function to invoke hook_diff in all enabled modules that implement it.

Don't use module_invoke_all() since if date.module is enabled will clash with PHP 5.3's date_diff() function.

@todo figure out any else possible solution but not workaround. @link http://drupal.org/node/639320

See also

module_invoke_all()

1 call to _diff_module_invoke_all()
_diff_body_rows in ./diff.pages.inc
Creates an array of rows which represent a diff between $old_node and $new_node. The rows can be used via theme('diff_table') to be displayed.

File

./diff.pages.inc, line 345
Menu callbacks for hook_menu().

Code

function _diff_module_invoke_all($old_node, $new_node, $remove_markup = FALSE) {
  $return = array();
  foreach (module_implements('diff') as $module) {
    if ($module == 'date') {
      continue;

      // Avoid function name collision with date_diff().
    }
    $function = "{$module}_diff";
    $result = $function($old_node, $new_node, $remove_markup);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}