admin_menu_toolbar.install 964 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Installation functionality for Administration menu toolbar module.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function admin_menu_toolbar_install() {
  10. // Required to load JS/CSS in hook_init() after admin_menu.
  11. db_update('system')
  12. ->fields(array('weight' => 101))
  13. ->condition('type', 'module')
  14. ->condition('name', 'admin_menu_toolbar')
  15. ->execute();
  16. }
  17. /**
  18. * Set module weight to a value higher than admin_menu.
  19. *
  20. * At this point, admin_menu should have a weight of 100. To account for
  21. * customized weights, we increase the weight relatively.
  22. *
  23. * @see admin_menu_toolbar_install()
  24. */
  25. function admin_menu_toolbar_update_6300() {
  26. $weight = db_query("SELECT weight FROM {system} WHERE type = 'module' AND name = 'admin_menu'")->fetchField();
  27. $weight++;
  28. db_update('system')
  29. ->fields(array('weight' => $weight))
  30. ->condition('type', 'module')
  31. ->condition('name', 'admin_menu_toolbar')
  32. ->execute();
  33. }