| Versionen | |
|---|---|
| drupal6 – drupal7 | module_hook($module, $hook) |
Determine whether a module implements a hook.
$module The name of the module (without the .module extension).
$hook The name of the hook (e.g. "help" or "menu").
TRUE if the module is both installed and enabled, and the hook is implemented in that module.
includes/
<?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