module_invoke_all

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

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

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

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

Параметры

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

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

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

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

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

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

actions_delete in includes/actions.inc
Удаляет действие из базы данных.
actions_list in includes/actions.inc
Находит все действия (actions) путем вызова hook_action_info().
comment_render in modules/comment/comment.module
Отображает комментарии.
drupal_cron_run in includes/common.inc
При вызове выполняет задачи cron
drupal_flush_all_caches in includes/common.inc
Flush all cached data on the site.
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
Call modules that implement hook_file_download() to find out if a file is accessible and what headers it should be transferred with. If a module returns -1 drupal_access_denied() will be returned. If one or more modules returned headers the download...
locale_translate_export_pot_form in includes/locale.inc
Форма экспорта шаблона перевода.
locale_translate_export_po_form in includes/locale.inc
Форма экспорта выбранного языка в PO-файл.
locale_translate_import_form in includes/locale.inc
User interface for the translation import screen.
locale_translate_overview_screen in includes/locale.inc
Overview screen for translations.
locale_translate_seek_form in includes/locale.inc
User interface for the string search screen.
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.admin.inc
Form builder: Builds the node administration overview.
node_admin_nodes_submit in modules/node/node.admin.inc
Process node_admin_nodes form submissions.
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
Генерирует вывод ноды.
openid_authentication_request in modules/openid/openid.module
poll_view in modules/poll/poll.module
Реализация hook_view().
search_admin_settings in modules/search/search.admin.inc
Menu callback; displays the search module settings page. See alsosystem_settings_form()
search_wipe in modules/search/search.module
Wipes a part of or the entire search index.
system_cron in modules/system/system.module
Реализация hook_cron().
system_status in modules/system/system.admin.inc
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() который выполняется в конце страницы и расположен перед тегом, закрывающим тело документа (</body>).
theme_comment_flat_expanded in modules/comment/comment.module
Темизирует комментарий в раскрытом виде.
theme_comment_thread_expanded in modules/comment/comment.module
Темизирует комментарии в развёрнутом виде.
trigger_assign in modules/trigger/trigger.admin.inc
Build the form that allows users to assign actions to hooks.
trigger_forms in modules/trigger/trigger.module
Implementation of hook_forms(). We reuse code by using the same assignment form definition for each node-op combination.
trigger_menu in modules/trigger/trigger.module
Реализация hook_menu().
user_admin_account in modules/user/user.admin.inc
Form builder; User administration page. See alsouser_admin_account_validate()
user_admin_account_submit in modules/user/user.admin.inc
Submit the user administration update form.
user_delete in modules/user/user.module
Удаляет пользователя.
user_logout in modules/user/user.pages.inc
Menu callback; logs the current user out, and redirects to the home page.
_drupal_bootstrap_full in includes/common.inc
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table
_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 = $args[0];
  unset($args[0]);
  $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_recursive($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }

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

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