special_menu_items.install 954 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Implementation of hook_uninstall().
  4. */
  5. function special_menu_items_uninstall() {
  6. variable_del('special_menu_items_nolink_tag');
  7. variable_del('special_menu_items_seperator_tag');
  8. variable_del('special_menu_items_seperator_value');
  9. variable_del('special_menu_items_menu_item_link');
  10. }
  11. /**
  12. * "nolink" to <nolink> and "separator" to <separator>
  13. */
  14. function special_menu_items_update_7000(&$sandbox){
  15. //change "nolink" to <nolink>
  16. db_update('menu_links')
  17. ->fields(array(
  18. 'link_path' => '<nolink>',
  19. 'router_path' => '<nolink>',
  20. ))
  21. ->condition('router_path', 'nolink', '=')
  22. ->execute();
  23. //change "separator" to <separator>
  24. db_update('menu_links')
  25. ->fields(array(
  26. 'link_path' => '<separator>',
  27. 'router_path' => '<separator>',
  28. ))
  29. ->condition('router_path', 'separator', '=')
  30. ->execute();
  31. //we don't need this variable anymore
  32. variable_del('special_menu_items_menu_item_link');
  33. }