You are here

function nodewords_get_possible_tags in Nodewords: D6 Meta Tags 6

Same name and namespace in other branches
  1. 6.3 nodewords.module \nodewords_get_possible_tags()
  2. 6.2 nodewords.module \nodewords_get_possible_tags()

Query all the modules implementing meta tags and return the list of meta tags.

Parameters

$load: If TRUE, the file containing the code implementing the meta tags will be loaded.

Return value

An array containing the list of meta tags definitions.

9 calls to nodewords_get_possible_tags()
nodewords_form in ./nodewords.module
Return the form used to set the meta tags values.
nodewords_form_node_type_form_alter in ./nodewords.module
Implements hook_form_FORM_ID_alter().
nodewords_load_tags in ./nodewords.module
Load tags from table.
nodewords_nodeapi in ./nodewords.module
Implements hook_nodeapi().
nodewords_preprocess_page in ./nodewords.module
Implements hook_preprocess_page().

... See full list

File

./nodewords.module, line 850
Implement an API that other modules can use to implement meta tags.

Code

function nodewords_get_possible_tags($load = FALSE) {
  static $tags_info = array();
  if ($load) {
    $tags_info = array();
  }
  if (empty($tags_info)) {

    // Allow third-party modules to alter the  meta tags list, or to add new
    // meta tags.
    foreach (module_implements('nodewords_tags_info') as $module) {
      if (module_hook($module, 'nodewords_api')) {
        $info = module_invoke($module, 'nodewords_api');
        $version = '0.0';
        if (isset($info)) {
          if (is_string($info)) {
            $version = $info;
          }
          elseif (is_array($info) && isset($info['version'])) {
            $version = $info['version'];
            if ($load && !empty($info['file'])) {
              $include_file = $info['file'];
              if (isset($info['path'])) {
                $include_file = $info['path'] . '/' . $include_file;
              }
              include_once $include_file;
            }
          }
        }
        $bool = version_compare($version, NODEWORDS_MINIMUM_API_VERSION, '<') || version_compare($version, NODEWORDS_API_VERSION, '>');
        if ($bool) {
          continue;
        }
        $result = module_invoke($module, 'nodewords_tags_info');
        if (isset($result) && is_array($result)) {
          $tags_info = array_merge($tags_info, $result);
        }
      }
    }
  }
  return $tags_info;
}