module_hook

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 module_hook($module, $hook)

Determine whether a module implements a hook.

Übergabeparameter

$module The name of the module (without the .module extension).

$hook The name of the hook (e.g. "help" or "menu").

Rückgabewert

TRUE if the module is both installed and enabled, and the hook is implemented in that module.

Verwandte Themen

▾ 7 functions call module_hook()

help_page in modules/help/help.admin.inc
Menu callback; prints a page listing general help for a module.
module_disable in includes/module.inc
Disable a given set of modules.
module_enable in includes/module.inc
Enable a given list of modules.
module_invoke in includes/module.inc
Invoke a hook in a particular module.
node_hook in modules/node/node.module
Determine whether a node hook exists.
search_data in modules/search/search.module
Perform a standard search on the given keys, and return the formatted results.
system_modules_uninstall in modules/system/system.admin.inc
Builds a form of currently disabled modules.

Code

includes/module.inc, line 366

<?php
function module_hook($module, $hook) {
  $function = $module . '_' . $hook;
  if (defined('MAINTENANCE_MODE')) {
    return function_exists($function);
  }
  else {
    return drupal_function_exists($function);
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen