xmlsitemap_custom.module 2.0 KB

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