includes/module.inc, строка 340
- 5 – 6
module_implements($hook, $sort = FALSE, $refresh = FALSE)
Определяет какие модули реализуют хук.
Параметры
$hook
Имя хука (например, 'help'
или 'menu'
).
$sort
По умолчанию модули сортируются сначала по весу, затем по имени файла. Если этот параметр установлен в TRUE
, модули будут отсортированы только по имени.
$refresh
Только для внутреннего использования: обновлять ли кешированный список реализаций хуков в модулях (например, после включения модуля но до вызова hook_enable()
).
Возвращаемое значение
Массив имён модулей, которые реализуют этот хук.
Determine which modules are implementing a hook.
Parameters
$hook
The name of the hook (e.g. "help" or "menu").
$sort
By default, modules are ordered by weight and filename, settings this option
to TRUE, module list will be ordered by module name.
$refresh
For internal use only: Whether to force the stored list of hook
implementations to be regenerated (such as after enabling a new module,
before processing hook_enable).
Return value
An array with the names of the modules which are implementing this hook.
Связанные темы
- Хуки
- Позволяет модулям взаимодействовать с ядром Drupal.
- comment_invoke_comment in modules/comment/comment.module
- Invoke a hook_comment() operation in all modules.
- comment_render in modules/comment/comment.module
- Отображает комментарии.
- drupal_mail in includes/common.inc
- Send an e-mail message, using Drupal variables and default settings.
More information in the PHP function reference for mail()
- drupal_prepare_form in includes/form.inc
- Подготавливает полный массив формы, добавляя в него недостающие значения по-умолчанию, вызывая нужные хуки, а также, опционально, выставляя токены валидации для некоторых полей, чтобы обезопасить форму от несанкционированных вмешательств.
- help_links_as_list in modules/help/help.module
- help_menu in modules/help/help.module
- Реализация hook_menu().
- module_disable in includes/module.inc
- Disable a given set of modules.
- module_enable in includes/module.inc
- Включает данный список модулей.
- module_invoke_all in includes/module.inc
- Вызывает хук во всех включённых модулях.
- node_access_rebuild in modules/node/node.module
- Rebuild the node access database. This is occasionally needed by modules
that make system-wide changes to access levels.
- node_access_write_grants in modules/node/node.module
- This function will write a list of grants to the database, deleting
any pre-existing grants. If a realm is provided, it will only
delete grants from that realm, but it will always delete a grant
from the 'all' realm. Modules which utilize...
- node_configure in modules/node/node.module
- Menu callback; presents general node configuration options.
- node_invoke_nodeapi in modules/node/node.module
- Вызывает операцию hook_nodeapi() во всех модулях.
- node_view in modules/node/node.module
- Генерирует вывод ноды.
- search_preprocess in modules/search/search.module
- Invokes hook_search_preprocess() in modules.
- system_performance_settings in modules/system/system.module
- taxonomy_link in modules/taxonomy/taxonomy.module
- Реализация hook_link().
- upload_js in modules/upload/upload.module
- Коллбэк меню для JavaScript загрузок файлов.
- user_authenticate in modules/user/user.module
- user_auth_help_links in modules/user/user.module
- user_view in modules/user/user.module
- _db_rewrite_sql in includes/database.inc
- Вспомогательная функция для db_rewrite_sql().
- _element_info in includes/form.inc
- Retrieve the default properties for the defined element type.
Код
<?php
function module_implements($hook, $sort = FALSE, $refresh = FALSE) {
static $implementations;
if ($refresh) {
$implementations = array();
return;
}
if (!isset($implementations[$hook])) {
$implementations[$hook] = array();
$list = module_list(FALSE, TRUE, $sort);
foreach ($list as $module) {
if (module_hook($module, $hook)) {
$implementations[$hook][] = $module;
}
}
}
return (array)$implementations[$hook];
}
?>
Войдите или
зарегистрируйтесь, чтобы получить возможность отправлять комментарии