module_invoke_all

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/module.inc, строка 399

Версии
5 – 6
module_invoke_all()

Вызывает хук во всех включённых модулях (которые имеют реализацию этого хука).

Параметры

$hook Название хука, который нужно вызвать.

... Аргументы в порядке, объявленном в хуке.

Возвращаемое значение

Массив результатов выполнения хуков. Если хук возвращает массив, этот массив сливается с общим.

Связанные темы

▾ 34 функции вызывают module_invoke_all()

comment_render in modules/comment/comment.module
Отображает комментарии.
drupal_cron_run in includes/common.inc
При вызове выполняет задачи cron
drupal_goto in includes/common.inc
Перенаправляет пользователя на другую страницу сайта на Друпале.
drupal_page_footer in includes/common.inc
Perform end-of-request tasks.
drupal_retrieve_form in includes/form.inc
Возвращает структурированный массив, определяющий форму.
file_download in includes/file.inc
node_access_acquire_grants in modules/node/node.module
This function will call module invoke to get a list of grants and then write them to the database. It is called at node save, and should be called by modules whenever something other than a node_save causes the permissions on a node to change.
node_access_grants in modules/node/node.module
Fetch an array of permission IDs granted to the given user ID.
node_admin_nodes in modules/node/node.module
node_admin_nodes_submit in modules/node/node.module
Submit the node administration update form.
node_type_delete in modules/node/node.module
Удаляет тип ноды из БД.
node_type_reset in modules/node/content_types.inc
Resets all of the relevant fields of a module-defined node type to their default values.
node_type_save in modules/node/node.module
Сохраняет тип ноды в БД
node_view in modules/node/node.module
Генерирует вывод ноды.
poll_view in modules/poll/poll.module
Реализация hook_view().
search_admin_settings in modules/search/search.module
Menu callback; displays the search module settings page.
search_wipe in modules/search/search.module
Wipes a part of or the entire search index.
system_status in modules/system/system.module
Menu callback: displays the site status report. Can also be used as a pure check.
taxonomy_del_term in modules/taxonomy/taxonomy.module
Удаляет термин.
taxonomy_del_vocabulary in modules/taxonomy/taxonomy.module
Удаляет указанный словарь.
taxonomy_save_term in modules/taxonomy/taxonomy.module
Вспомогательная функция для taxonomy_form_term_submit().
taxonomy_save_vocabulary in modules/taxonomy/taxonomy.module
theme_closure in includes/theme.inc
Выполняет hook_footer() который выполняется в конце страницы и расположен после тега, закрывающего тело документа.
theme_comment_flat_expanded in modules/comment/comment.module
Темизирует комментарий в раскрытом виде.
theme_comment_thread_expanded in modules/comment/comment.module
user_admin_account in modules/user/user.module
user_admin_account_submit in modules/user/user.module
Submit the user administration update form.
user_delete in modules/user/user.module
Delete a user.
user_logout in modules/user/user.module
Menu callback; logs the current user out, and redirects to the home page.
_drupal_bootstrap_full in includes/common.inc
_menu_append_contextual_items in includes/menu.inc
Account for menu items that are only defined at certain paths, so will not be cached.
_menu_build in includes/menu.inc
Build the menu by querying both modules and the database.
_node_types_build in modules/node/node.module
Builds and returns the list of available node types.
_ping_notify in modules/ping/ping.module
Call hook_ping() in all modules to notify remote sites that there is new content at this one.

Код

<?php
function module_invoke_all() {
  $args = func_get_args();
  $hook = array_shift($args);
  $return = array();
  foreach (module_implements($hook) as $module) {
    $function = $module .'_'. $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }

  return $return;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему