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

Drupal example source code file (xmlsitemap_user.install)

This example Drupal source code file (xmlsitemap_user.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, function, if, phase, php, profiles, requirements, return, sitemap, the, title, to, user, xmlsitemap_user_uninstall

The xmlsitemap_user.install Drupal example source code

<?php
// $Id: xmlsitemap_user.install,v 1.11 2010/12/30 15:54:54 davereid Exp $

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

/**
 * Implements hook_requirements().
 */
function xmlsitemap_user_requirements($phase) {
  $requirements = array();
  $t = get_t();

  if ($phase == 'runtime') {
    if (!user_access('access user profiles', drupal_anonymous_user())) {
      $requirements['xmlsitemap_user_anonymous_permission'] = array(
        'title' => $t('XML sitemap user'),
        'value' => $t('Anonymous access to user profiles'),
        'description' => $t('In order to list user profile links in the sitemap, the anonymous user must have the <a href="@perm-link"><em>View user profiles</em> permission</a>.', array('@perm-link' => url('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID, array('fragment' => 'module-user')))),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }

  return $requirements;
}

/**
 * Implements hook_uninstall().
 */
function xmlsitemap_user_uninstall() {
  drupal_load('module', 'user');
  drupal_load('module', 'xmlsitemap');
  xmlsitemap_link_bundle_delete('user', 'user');
}

/**
 * Implements hook_update_last_removed().
 */
function xmlsitemap_user_update_last_removed() {
  return 6202;
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal xmlsitemap_user.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.