You are here

function node_convert_invoke_all in Node Convert 7

Instead of using module_invoke_all, we have to use the ctools pattern, because the module hooks are loaded dynamically by CTools.

Additionally we add in a few other modules, for which we provide API integration.

Parameters

$hook:

$data:

$op:

Return value

array

5 calls to node_convert_invoke_all()
node_convert_add_template in ./node_convert.admin.inc
Add template page callback.
node_convert_add_template_validate in ./node_convert.admin.inc
Validation callback for adding a new template.
node_convert_conversion_form in ./node_convert.forms.inc
Node conversion form.
node_convert_conversion_form_validate in ./node_convert.forms.inc
Validation callback for converting a form.
node_convert_node_convert in ./node_convert.util.inc
Converts a node to another content type.

File

./node_convert.module, line 612

Code

function node_convert_invoke_all($hook, $data, $op) {
  $return = array();
  $provided_modules = node_convert_provided_module_behaviors();
  $provided_modules = array_combine($provided_modules, $provided_modules);
  $other_modules = node_convert_load_includes();
  $all_modules = array_merge($provided_modules, $other_modules);
  foreach ($all_modules as $module => $info) {
    if (!module_exists($module)) {
      continue;
    }
    $function = $module . '_' . $hook;

    // Just because they implement the API and include a file does not guarantee they implemented
    // a hook function!
    if (!function_exists($function)) {
      continue;
    }
    $result = $function($data, $op);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    elseif (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}