You are here

function seotools_xmlsitemap_vocabularies in Drupal SEO Tools 6

File

plugins/seotools.presets.inc, line 277

Code

function seotools_xmlsitemap_vocabularies() {
  $vocabs = taxonomy_get_vocabularies();
  $setting = array();
  $setting['title'] = 'Vocabularies';
  $settings = array(
    'status' => '1',
    'priority' => '0.5',
  );
  $different = array();
  foreach ($vocabs as $vid => $vocab) {
    if (array_diff(variable_get('xmlsitemap_settings_taxonomy_term_' . $vid, array(
      FALSE,
    )), $settings)) {
      $different[$vid] = $vocab->name;
    }
  }
  if (empty($different)) {
    $setting['value'] = 'All taxonomies are set for xmlsitemap.';
    $setting['severity'] = REQUIREMENT_OK;
  }
  else {
    $setting['value'] = 'No vocabularies not set to use xmlsitemap.';
    $setting['severity'] = REQUIREMENT_ERROR;
  }
  return $setting;
}