module_load_include

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

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

Версии
6
module_load_include($type, $module, $name = NULL)

Загружает подключаемый файл модуля.

Параметры

$type Тип подключаемого файла (расширение файла).

$module Модуль, которому принадлежит подключаемый файл.

$name (Дополнительно) имя подключаемого файла. Если не указано, используется имя модуля.

▾ 17 функции вызывают module_load_include()

drupal_get_schema_unprocessed in includes/common.inc
Возвращает необработанную и не изменённую версию схемы таблицы модуля.
forum_overview in modules/forum/forum.admin.inc
Returns an overview list of existing forums and containers
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.
module_load_install in includes/module.inc
Загружает установочные хуки модуля.
openid_association in modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_association_request in modules/openid/openid.module
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
openid_authentication_request in modules/openid/openid.module
openid_begin in modules/openid/openid.module
The initial step of OpenID authentication responsible for the following: Perform discovery on the claimed OpenID. If possible, create an association with the Provider's endpoint. Create the authentication request. Perform the appropriate redirect.
openid_complete in modules/openid/openid.module
Completes OpenID authentication by validating returned data from the OpenID Provider.
openid_discovery in modules/openid/openid.module
Perform discovery on a claimed ID to determine the OpenID provider endpoint.
openid_verify_assertion in modules/openid/openid.module
Attempt to verify the response received from the OpenID Provider.
update_get_available in modules/update/update.module
Internal helper to try to get the update information from the cache if possible, and to refresh the cache when necessary.
update_refresh in modules/update/update.module
Wrapper to load the include file and then refresh the release data.
update_requirements in modules/update/update.module
Implementation of hook_requirements(). See also_update_message_text()
update_status in modules/update/update.report.inc
Menu callback. Generate a page about the update status of projects.
_update_refresh in modules/update/update.fetch.inc
Fetch project info via XML from a central server.

Код

<?php
function module_load_include($type, $module, $name = NULL) {
  if (empty($name)) {
    $name = $module;
  }

  $file = './'. drupal_get_path('module', $module) ."/$name.$type";

  if (is_file($file)) {
    require_once $file;
  }
  else {
    return FALSE;
  }
}
?>

Пользовательские комментарии

Подгружаем mymodule.admin.inc из модуля mymodule:

module_load_include('inc', 'mymodule', 'mymodule.admin');

В Drupal 5 это делалось так:
include_once(drupal_get_path('module', 'taxonomy') .'/taxonomy.admin.inc');
При этом включался файл taxonomy.admin.inc из модуля taxonomy.

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

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