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

Drupal example source code file (xmlsitemap_custom.module)

This example Drupal source code file (xmlsitemap_custom.module) 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

access, arguments, array, callback, custom, directory, file, form, function, page, php, title, type, xmlsitemap

The xmlsitemap_custom.module Drupal example source code

<?php
// $Id: xmlsitemap_custom.module,v 1.1.2.10 2010/08/24 06:56:12 davereid Exp $

/**
 * Implements hook_menu().
 */
function xmlsitemap_custom_menu() {
  $items['admin/settings/xmlsitemap/custom'] = array(
    'title' => 'Custom links',
    'page callback' => 'xmlsitemap_custom_list_links',
    'access arguments' => array('administer xmlsitemap'),
    'type' => MENU_LOCAL_TASK,
    'file' => 'xmlsitemap_custom.admin.inc',
  );
  $items['admin/settings/xmlsitemap/custom/add'] = array(
    'title' => 'Add custom link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('xmlsitemap_custom_edit_link_form'),
    'access arguments' => array('administer xmlsitemap'),
    'type' => MENU_CALLBACK,
    'file' => 'xmlsitemap_custom.admin.inc',
    'modal' => TRUE,
  );
  $items['admin/settings/xmlsitemap/custom/edit/%xmlsitemap_custom'] = array(
    'title' => 'Edit custom link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('xmlsitemap_custom_edit_link_form', 5),
    'access arguments' => array('administer xmlsitemap'),
    'type' => MENU_CALLBACK,
    'file' => 'xmlsitemap_custom.admin.inc',
    'modal' => TRUE,
  );
  $items['admin/settings/xmlsitemap/custom/delete/%xmlsitemap_custom'] = array(
    'title' => 'Delete custom link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('xmlsitemap_custom_delete_link_form', 5),
    'access arguments' => array('administer xmlsitemap'),
    'type' => MENU_CALLBACK,
    'file' => 'xmlsitemap_custom.admin.inc',
    'modal' => TRUE,
  );
  return $items;
}

/**
 * Menu load callback; load a custom sitemap link from the {xmlsitemap} table.
 *
 * @param $id
 *   The sitemap link ID of the custom link to load.
 *
 * @see xmlsitemap_link_load()
 */
function xmlsitemap_custom_load($id) {
  return xmlsitemap_link_load('custom', $id);
}

/**
 * Implements hook_xmlsitemap_link_info().
 */
function xmlsitemap_custom_xmlsitemap_link_info() {
  return array(
    'custom' => array(
      'label' => t('Custom links'),
    ),
  );
}

Other Drupal examples (source code examples)

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