xmlsitemap_custom.module 2.16 KB
Newer Older
1
2
3
4
5
6
7
<?php
// $Id$

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

/**
 * Implements hook_xmlsitemap_link_info().
 */
function xmlsitemap_custom_xmlsitemap_link_info() {
  return array(
    'custom' => array(
      'purge' => FALSE,
    ),
  );
}