function module_load_include

7.x module.inc module_load_include($type, $module, $name = NULL)
6.x module.inc module_load_include($type, $module, $name = NULL)

Load a module include file.

Examples:

  // Load node.admin.inc from the node module.
  module_load_include('inc', 'node', 'node.admin');
  // Load content_types.inc from the node module.
  module_load_include('inc', 'node', 'content_types');  

Do not use this function to load an install file. Use module_load_install() instead.

Parameters

$type: The include file's type (file extension).

$module: The module to which the include file belongs.

$name: Optionally, specify the base file name (without the $type extension). If not set, $module is used.

16 calls to module_load_include()
forum_overview in drupal-6.x/modules/forum/forum.admin.inc
Returns an overview list of existing forums and containers
module_load_all_includes in drupal-6.x/includes/module.inc
Load an include file for each of the modules that have been enabled in the system table.
module_load_install in drupal-6.x/includes/module.inc
Load a module's installation hooks.
openid_association in drupal-6.x/modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_association_request in drupal-6.x/modules/openid/openid.module

... See full list

File

drupal-6.x/includes/module.inc, line 280
API for loading and interacting with Drupal modules.

Code

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;
  }
}