xmlsitemap_custom.module 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Implements hook_menu().
  4. */
  5. function xmlsitemap_custom_menu() {
  6. $items['admin/config/search/xmlsitemap/custom'] = array(
  7. 'title' => 'Custom links',
  8. 'page callback' => 'xmlsitemap_custom_list_links',
  9. 'access arguments' => array('administer xmlsitemap'),
  10. 'type' => MENU_LOCAL_TASK,
  11. 'file' => 'xmlsitemap_custom.admin.inc',
  12. );
  13. $items['admin/config/search/xmlsitemap/custom/add'] = array(
  14. 'title' => 'Add custom link',
  15. 'page callback' => 'drupal_get_form',
  16. 'page arguments' => array('xmlsitemap_custom_edit_link_form'),
  17. 'access arguments' => array('administer xmlsitemap'),
  18. 'type' => MENU_LOCAL_ACTION,
  19. 'file' => 'xmlsitemap_custom.admin.inc',
  20. 'modal' => TRUE,
  21. );
  22. $items['admin/config/search/xmlsitemap/custom/edit/%xmlsitemap_custom'] = array(
  23. 'title' => 'Edit custom link',
  24. 'page callback' => 'drupal_get_form',
  25. 'page arguments' => array('xmlsitemap_custom_edit_link_form', 6),
  26. 'access arguments' => array('administer xmlsitemap'),
  27. 'file' => 'xmlsitemap_custom.admin.inc',
  28. 'modal' => TRUE,
  29. );
  30. $items['admin/config/search/xmlsitemap/custom/delete/%xmlsitemap_custom'] = array(
  31. 'title' => 'Delete custom link',
  32. 'page callback' => 'drupal_get_form',
  33. 'page arguments' => array('xmlsitemap_custom_delete_link_form', 6),
  34. 'access arguments' => array('administer xmlsitemap'),
  35. 'file' => 'xmlsitemap_custom.admin.inc',
  36. 'modal' => TRUE,
  37. );
  38. return $items;
  39. }
  40. /**
  41. * Menu load callback; load a custom sitemap link from the {xmlsitemap} table.
  42. *
  43. * @param $id
  44. * The sitemap link ID of the custom link to load.
  45. *
  46. * @see xmlsitemap_link_load()
  47. */
  48. function xmlsitemap_custom_load($id) {
  49. return xmlsitemap_link_load('custom', $id);
  50. }
  51. /**
  52. * Implements hook_xmlsitemap_link_info().
  53. */
  54. function xmlsitemap_custom_xmlsitemap_link_info() {
  55. return array(
  56. 'custom' => array(
  57. 'label' => t('Custom links'),
  58. ),
  59. );
  60. }