module_list

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

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

Версии
5 – 6
module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_list = NULL)

Генерирует список всех загруженных модулей. В ходе инициализации (бутстрапа), возвращает только жизненно важные модули. Смотри bootstrap.inc

Параметры

$refresh Вызывать ли обновление списка модулей (например после того, как администратор изменит настройки системы).

$bootstrap Возвращать ли укороченный список модулей, загружаемых в режиме 'bootstrap mode' для скэшированных страниц. Смотри bootstrap.inc.

$sort По умолчанию модули сортируются по весу и имени файла. Устанавливая этот параметр в TRUE, модули будут отсортированы по имени модуля.

$fixed_list (Дополнительно) Заменяет список модулей указанными модулями. Остается. пока не будет следующего вызова с $refresh = TRUE.

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

Ассоциативный массив, ключи и значения которого - имена всех загруженных модулей

▾ 24 функции вызывают module_list()

bootstrap_invoke_all in includes/bootstrap.inc
Call all init or exit hooks without including all modules.
filter_list_all in modules/filter/filter.module
Формирует список всех фильтров.
install_main in ./install.php
The Drupal installation happens in a series of steps. We begin by verifying that the current environment meets our minimum requirements. We then go on to verify that settings.php is properly configured. From there we connect to the configured database...
menu_get_active_help in includes/menu.inc
Возвращает справку связанную с активизированным пунктом меню.
module_disable in includes/module.inc
Отключает заданный набор модулей.
module_enable in includes/module.inc
Включает данный список модулей.
module_exists in includes/module.inc
Определяет, установлен ли указанный модуль.
module_implements in includes/module.inc
Определяет, какие модули реализуют хук.
module_iterate in includes/module.inc
Call a function repeatedly with each module in turn as an argument.
module_load_all in includes/module.inc
Load all the modules that have been enabled in the system table.
module_load_all_includes in includes/module.inc
Load an include file for each of the modules that have been enabled in the system table.
search_admin_settings in modules/search/search.admin.inc
Menu callback; displays the search module settings page. See alsosystem_settings_form()
search_cron in modules/search/search.module
Реализация hook_cron().
system_modules_submit in modules/system/system.admin.inc
Submit callback; handles modules form submission.
system_requirements in modules/system/system.install
Test and report Drupal installation requirements.
system_update_6027 in modules/system/system.install
Add block cache.
user_admin_perm in modules/user/user.admin.inc
Menu callback: administer permissions. See alsouser_admin_perm_submit()
user_filters in modules/user/user.module
List user administration filters that can be applied.
user_module_invoke in modules/user/user.module
Вызывает хук hook_user() в каждом модуле.
_block_rehash in modules/block/block.module
Update the 'blocks' DB table with the blocks currently exported by modules.
_drupal_maintenance_theme in includes/theme.maintenance.inc
Sets up the theming system for site installs, updates and when the site is in off-line mode. It also applies when the database is unavailable.
_theme_process_registry in includes/theme.inc
Process a single invocation of the theme hook. $type will be one of 'module', 'theme_engine', 'base_theme_engine', 'theme', or 'base_theme' and it tells us some important information.
_user_categories in modules/user/user.module
Retrieve a list of all user setting/information categories and sort them by weight.
_user_forms in modules/user/user.module
Retrieve a list of all form elements for the specified category.

Код

<?php
function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_list = NULL) {
  static $list, $sorted_list;

  if ($refresh || $fixed_list) {
    $list = array();
    $sorted_list = NULL;
    if ($fixed_list) {
      foreach ($fixed_list as $name => $module) {
        drupal_get_filename('module', $name, $module['filename']);
        $list[$name] = $name;
      }
    }
    else {
      if ($bootstrap) {
        $result = db_query("SELECT name, filename, throttle FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC");
      }
      else {
        $result = db_query("SELECT name, filename, throttle FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC");
      }
      while ($module = db_fetch_object($result)) {
        if (file_exists($module->filename)) {
          // Determine the current throttle status and see if the module should be
          // loaded based on server load. We have to directly access the throttle
          // variables, since throttle.module may not be loaded yet.
          $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0);
          if (!$throttle) {
            drupal_get_filename('module', $module->name, $module->filename);
            $list[$module->name] = $module->name;
          }
        }
      }
    }
  }
  if ($sort) {
    if (!isset($sorted_list)) {
      $sorted_list = $list;
      ksort($sorted_list);
    }
    return $sorted_list;
  }
  return $list;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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