You are here

function nodewords_load_all_includes in Nodewords: D6 Meta Tags 6.3

Same name and namespace in other branches
  1. 6.2 nodewords.module \nodewords_load_all_includes()

Load an include file for each of the modules that have support for Nodewords.

Parameters

$file: The file to load; the name of the module will be preappended to the file name passed. By default the file name is 'nodewords.inc'.

7 calls to nodewords_load_all_includes()
nodewords_admin_settings_form in nodewords_admin/nodewords_admin.admin.inc
Menu callback: settings form.
nodewords_delete_tags in ./nodewords.module
Delete tags from table.
nodewords_get_possible_tags in ./nodewords.module
Query all the modules implementing meta tags and return the list of meta tags.
nodewords_preprocess_page in ./nodewords.module
Implements hook_preprocess_page().
nodewords_tags_edit_fields in ./nodewords.module
Return the form used to set the meta tags values.

... See full list

File

./nodewords.module, line 483
Implement an version that other modules can use to add meta tags.

Code

function nodewords_load_all_includes($file = 'nodewords.inc') {
  foreach (module_implements('metatags_api') as $module) {
    $info = module_invoke($module, 'metatags_api');
    if (isset($info['version']) && nodewords_check_version($info['version'])) {
      if (isset($info['path']) && $info['path'] == '') {

        // Special case: if the path is an empty string, the directory used will be
        // the directory include in the module directory.
        $include_path = drupal_get_path('module', $module) . '/includes/';
      }
      elseif (isset($info['path'])) {
        $include_path = $info['path'] . '/';
      }
      else {
        $include_path = drupal_get_path('module', $module) . '/';
      }
      $include_file = $include_path . $module . '.' . $file;
      if (is_file($include_file)) {
        require_once $include_file;
      }
      elseif ($file != 'nodewords.inc' && is_file($include_file = $include_path . $module . '.' . 'nodewords.inc')) {
        require_once $include_file;
      }
    }
  }
}