You are here

function page_title_include_api_files in Page Title 7.2

Same name and namespace in other branches
  1. 8.2 page_title.module \page_title_include_api_files()
  2. 6.2 page_title.module \page_title_include_api_files()

Function to ensure API files are included. We use a static variable so we can use include, which is faster than include_one

2 calls to page_title_include_api_files()
page_title_get_settings in ./page_title.module
Get the Page Title Setttings
page_title_init in ./page_title.module
Implement hook_init().

File

./page_title.module, line 662
Enhanced control over the page title (in the head tag).

Code

function page_title_include_api_files() {

  // Using $runonce, we can ensure the include code below only gets run once.
  $runonce =& drupal_static(__FUNCTION__, FALSE);
  if ($runonce) {
    return;
  }

  // Include relevant page_title.inc's. We cannot use drupal_load() here due to the folder structure.
  // We also avoice using include_once due to its performance hit on the Filesystem
  foreach (page_title_get_module_apis() as $module => $info) {
    if (file_exists(DRUPAL_ROOT . "/{$info['path']}/{$module}.page_title.inc")) {
      include DRUPAL_ROOT . "/{$info['path']}/{$module}.page_title.inc";
    }
  }
  $runonce = TRUE;
}