xmlsitemap_custom.module 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // $Id: xmlsitemap_custom.module,v 1.4 2010/01/23 19:24:42 davereid Exp $
  3. /**
  4. * Implements hook_menu().
  5. */
  6. function xmlsitemap_custom_menu() {
  7. $items['admin/config/search/xmlsitemap/custom'] = array(
  8. 'title' => 'Custom links',
  9. 'page callback' => 'xmlsitemap_custom_list_links',
  10. 'access arguments' => array('administer xmlsitemap'),
  11. 'type' => MENU_LOCAL_TASK,
  12. 'file' => 'xmlsitemap_custom.admin.inc',
  13. );
  14. $items['admin/config/search/xmlsitemap/custom/add'] = array(
  15. 'title' => 'Add custom link',
  16. 'page callback' => 'drupal_get_form',
  17. 'page arguments' => array('xmlsitemap_custom_edit_link_form'),
  18. 'access arguments' => array('administer xmlsitemap'),
  19. 'type' => MENU_LOCAL_ACTION,
  20. 'file' => 'xmlsitemap_custom.admin.inc',
  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. 'type' => MENU_CALLBACK,
  28. 'file' => 'xmlsitemap_custom.admin.inc',
  29. );
  30. $items['admin/config/search/xmlsitemap/custom/delete/%xmlsitemap_custom'] = array(
  31. 'title' => 'Edit 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. 'type' => MENU_CALLBACK,
  36. 'file' => 'xmlsitemap_custom.admin.inc',
  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_load_link()
  47. */
  48. function xmlsitemap_custom_load($id) {
  49. return xmlsitemap_load_link(array('type' => 'custom', 'id' => $id));
  50. }
  51. /**
  52. * Implements hook_xmlsitemap_link_info().
  53. */
  54. function xmlsitemap_custom_xmlsitemap_link_info() {
  55. return array(
  56. 'custom' => array(
  57. 'purge' => FALSE,
  58. ),
  59. );
  60. }