You are here

function icon_extension_invoke in Icon API 7

Same name and namespace in other branches
  1. 8 includes/utilities.inc \icon_extension_invoke()

Invokes a hook in a particular extension.

Parameters

string $type: The type of extension (theme or module).

string $extension: The name of the extension.

string $hook: The name of the hook to invoke.

mixed $data: Arguments to pass to the hook implementation.

mixed $context1: Arguments to pass to the hook implementation.

mixed $context2: Arguments to pass to the hook implementation.

The arguments listed for this function are passed by reference, however more arguments sent if needed.

Return value

mixed The return value of the hook implementation.

7 calls to icon_extension_invoke()
icon_bundles in ./icon.module
Returns information about all icon bundles.
icon_bundle_configure_form in includes/admin.inc
Menu callback for 'icon_bundle_configure_form'.
icon_bundle_delete in ./icon.module
Delete the icon bundle that matches {icon_bundle}.name in the database.
icon_providers in ./icon.module
Returns information about all icon providers.
icon_provider_import_form_submit in includes/import.inc
Submit callback for 'icon_provider_import_form'.

... See full list

File

includes/utilities.inc, line 242
utilities.inc Provides useful functions and common tasks.

Code

function icon_extension_invoke($type, $extension, $hook, &$data = NULL, &$context1 = NULL, &$context2 = NULL) {
  $args = func_get_args();

  // Remove $type, $extension and $hook from the arguments.
  unset($args[0], $args[1], $args[2]);
  if (isset($args[3])) {
    $args[3] =& $data;
  }
  if (isset($args[4])) {
    $args[4] =& $context1;
  }
  if (isset($args[5])) {
    $args[5] =& $context2;
  }
  if (icon_extension_hook($type, $extension, $hook)) {
    return call_user_func_array($extension . '_' . $hook, $args);
  }
}