You are here

function _nodewords_get_settings in Nodewords: D6 Meta Tags 5

Load default and user-defined settings. If $defaults => default settings are returned.

5 calls to _nodewords_get_settings()
nodewords_nodewords in ./nodewords.module
Implementation of hook_nodewords().
nodewords_settings_form in ./nodewords.module
Menu callback: settings form.
_nodewords_check_content in ./nodewords.module
Remove any content from the $tag that is not allowed in a meta content attribute.
_nodewords_form in ./nodewords.module
Create a form - returns a $form variable
_nodewords_get_viewable_tags in ./nodewords.module
Return a list of viewable output tags

File

./nodewords.module, line 721
Assign META tags to nodes, vocabularies, terms and pages.

Code

function _nodewords_get_settings($defaults = FALSE) {
  static $settings = NULL;
  static $default_settings = array(
    'use_teaser' => 1,
    'max_size' => 255,
    'keywords_vids' => array(),
    'keywords_include_parents' => 0,
    'dc_title_only_if_set' => 0,
    'global' => array(
      'copyright' => '',
      'geourl' => '',
      'keywords' => '',
      'robots' => 'index,follow',
    ),
    'head' => array(
      'abstract' => 1,
      'copyright' => 1,
      'DC.Title' => 1,
      'description' => 1,
      'geourl' => 1,
      'keywords' => 1,
      'Revisit-After' => 1,
      'robots' => 1,
    ),
    'edit' => array(
      'abstract' => 0,
      'copyright' => 0,
      'DC.Title' => 0,
      'description' => 1,
      'geourl' => 0,
      'keywords' => 1,
      'Revisit-After' => 0,
      'robots' => 0,
    ),
  );
  if ($defaults) {
    return $default_settings;
  }
  if ($settings == NULL) {
    $settings = variable_get('nodewords', array());
    foreach ($default_settings as $key => $value) {
      if (is_array($value)) {
        $settings[$key] = isset($settings[$key]) ? array_merge($value, $settings[$key]) : $value;
      }
      elseif (!isset($settings[$key])) {
        $settings[$key] = $value;
      }
    }
  }
  return $settings;
}