xmlsitemap_custom.module 1.9 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/add'] = array(
16
17
18
19
    'title' => 'Add custom link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('xmlsitemap_custom_edit_link_form'),
    'access arguments' => array('administer xmlsitemap'),
20
    'type' => MENU_LOCAL_ACTION,
21
22
    'file' => 'xmlsitemap_custom.admin.inc',
  );
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
29
30
    'access arguments' => array('administer xmlsitemap'),
    'type' => MENU_CALLBACK,
    'file' => 'xmlsitemap_custom.admin.inc',
  );
31
  $items['admin/config/search/xmlsitemap/custom/delete/%xmlsitemap_custom'] = array(
32
33
    'title' => 'Edit custom link',
    'page callback' => 'drupal_get_form',
34
    'page arguments' => array('xmlsitemap_custom_delete_link_form', 6),
35
36
37
38
39
40
41
42
43
44
45
46
47
    '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.
 *
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
    ),
  );
}