content_menu.install 690 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @file
  4. * Installation hooks for Content Menu module
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function content_menu_install() {
  10. // Set weight to come after core menu.module.
  11. // Make sure this module's hooks' weight is set to be executed after the core.
  12. // Menu.module's hooks, so the node add/edit form is already altered by the.
  13. // Menu.module befor content_menu does its form alterations.
  14. $weight = db_select('system', 's')
  15. ->fields('s', array('weight'))
  16. ->condition('name', 'menu', '=')
  17. ->execute()
  18. ->fetchField();
  19. db_update('system')
  20. ->fields(array('weight' => $weight + 1))
  21. ->condition('name', 'content_menu', '=')
  22. ->execute();
  23. }