home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (xmlsitemap_node.install)

This example Drupal source code file (xmlsitemap_node.install) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, array_keys, as, foreach, function, node_type, node_types, php, return, settings, status, xmlsitemap, xmlsitemap_node_update_6200, xmlsitemap_priority_default

The xmlsitemap_node.install Drupal example source code

<?php
// $Id: xmlsitemap_node.install,v 1.14 2010/04/29 16:19:10 davereid Exp $

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

/**
 * Implements hook_uninstall().
 */
function xmlsitemap_node_uninstall() {
  drupal_load('module', 'node');
  drupal_load('module', 'xmlsitemap');
  $node_types = array_keys(node_type_get_names());
  foreach ($node_types as $node_type) {
    xmlsitemap_link_bundle_delete('node', $node_type);
  }
}

/**
 * Cleanup variables.
 */
function xmlsitemap_node_update_6200() {
  drupal_load('module', 'node');
  drupal_load('module', 'xmlsitemap');
  $node_types = array_keys(node_type_get_names());
  foreach ($node_types as $node_type) {
    $settings = array(
      'status' => variable_get('xmlsitemap_node_status_' . $node_type, XMLSITEMAP_STATUS_DEFAULT),
      'priority' => variable_get('xmlsitemap_node_priority_' . $node_type, XMLSITEMAP_PRIORITY_DEFAULT),
    );
    variable_set('xmlsitemap_settings_node_' . $node_type, $settings);
    variable_del('xmlsitemap_node_status_' . $node_type);
    variable_del('xmlsitemap_node_priority_' . $node_type);
    variable_del('xmlsitemap_node_update_' . $node_type);
  }
  return array();
}

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

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal xmlsitemap_node.install source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.