xmlsitemap_custom.module 1.9 KB
Newer Older
1 2 3 4 5 6
<?php

/**
 * Implements hook_menu().
 */
function xmlsitemap_custom_menu() {
7
  $items['admin/config/search/xmlsitemap/custom'] = array(
8 9 10 11 12 13
    'title' => 'Custom links',
    'page callback' => 'xmlsitemap_custom_list_links',
    'access arguments' => array('administer xmlsitemap'),
    'type' => MENU_LOCAL_TASK,
    'file' => 'xmlsitemap_custom.admin.inc',
  );
14
  $items['admin/config/search/xmlsitemap/custom/add'] = array(
15 16 17 18
    'title' => 'Add custom link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('xmlsitemap_custom_edit_link_form'),
    'access arguments' => array('administer xmlsitemap'),
19
    'type' => MENU_LOCAL_ACTION,
20
    'file' => 'xmlsitemap_custom.admin.inc',
21
    'modal' => TRUE,
22
  );
23
  $items['admin/config/search/xmlsitemap/custom/edit/%xmlsitemap_custom'] = array(
24 25
    'title' => 'Edit custom link',
    'page callback' => 'drupal_get_form',
26
    'page arguments' => array('xmlsitemap_custom_edit_link_form', 6),
27 28
    'access arguments' => array('administer xmlsitemap'),
    'file' => 'xmlsitemap_custom.admin.inc',
29
    'modal' => TRUE,
30
  );
31
  $items['admin/config/search/xmlsitemap/custom/delete/%xmlsitemap_custom'] = array(
32
    'title' => 'Delete custom link',
33
    'page callback' => 'drupal_get_form',
34
    'page arguments' => array('xmlsitemap_custom_delete_link_form', 6),
35 36
    'access arguments' => array('administer xmlsitemap'),
    'file' => 'xmlsitemap_custom.admin.inc',
37
    'modal' => TRUE,
38 39 40 41 42 43 44 45 46 47
  );
  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.
 *
48
 * @see xmlsitemap_link_load()
49 50
 */
function xmlsitemap_custom_load($id) {
51
  return xmlsitemap_link_load('custom', $id);
52 53 54 55 56 57 58 59
}

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