You are here

xmlsitemap_taxonomy.install in XML sitemap 7.2

Install and uninstall schema and functions for the xmlsitemap_taxonomy.

File

xmlsitemap_taxonomy/xmlsitemap_taxonomy.install
View source
<?php

/**
 * @file
 * Install and uninstall schema and functions for the xmlsitemap_taxonomy.
 */

/**
 * Implements hook_uninstall().
 */
function xmlsitemap_taxonomy_uninstall() {
  drupal_load('module', 'taxonomy');
  drupal_load('module', 'xmlsitemap');
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vid => $vocabulary) {
    xmlsitemap_link_bundle_delete('taxonomy_term', $vocabulary->machine_name);
  }
}

/**
 * Implements hook_update_last_removed().
 */
function xmlsitemap_taxonomy_update_last_removed() {
  return 6198;
}

/**
 * Cleanup variables.
 */
function xmlsitemap_taxonomy_update_6200() {
  drupal_load('module', 'taxonomy');
  drupal_load('module', 'xmlsitemap');
  $vids = array_keys(taxonomy_get_vocabularies());
  foreach ($vids as $vid) {
    $settings = array(
      'status' => variable_get('xmlsitemap_taxonomy_status_' . $vid, XMLSITEMAP_STATUS_DEFAULT),
      'priority' => variable_get('xmlsitemap_taxonomy_priority_' . $vid, XMLSITEMAP_PRIORITY_DEFAULT),
    );
    variable_set('xmlsitemap_settings_taxonomy_term_' . $vid, $settings);
    variable_del('xmlsitemap_taxonomy_status_' . $vid);
    variable_del('xmlsitemap_taxonomy_priority_' . $vid);
    variable_del('xmlsitemap_taxonomy_calculate_priority_' . $vid);
    variable_del('xmlsitemap_taxonomy_include_empty_terms_' . $vid);
  }
  variable_del('xmlsitemap_taxonomy_include_empty_terms');
  variable_del('xmlsitemap_taxonomy_calculate_priority');
}

/**
 * Empty update.
 */
function xmlsitemap_taxonomy_update_6201() {
}

/**
 * Change bundles on taxonomy terms from vid to $vocabulary->machine_name.
 */
function xmlsitemap_taxonomy_update_7200() {
  drupal_load('module', 'taxonomy');
  drupal_load('module', 'xmlsitemap');
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vid => $vocabulary) {
    xmlsitemap_link_bundle_rename('taxonomy_term', $vid, $vocabulary->machine_name);
  }
}

Functions

Namesort descending Description
xmlsitemap_taxonomy_uninstall Implements hook_uninstall().
xmlsitemap_taxonomy_update_6200 Cleanup variables.
xmlsitemap_taxonomy_update_6201 Empty update.
xmlsitemap_taxonomy_update_7200 Change bundles on taxonomy terms from vid to $vocabulary->machine_name.
xmlsitemap_taxonomy_update_last_removed Implements hook_update_last_removed().