admin_menu_toolbar.install

  1. nittany7 modules/contrib/admin_menu/admin_menu_toolbar/admin_menu_toolbar.install
  2. cis7 modules/contrib/admin_menu/admin_menu_toolbar/admin_menu_toolbar.install
  3. mooc7 modules/contrib/admin_menu/admin_menu_toolbar/admin_menu_toolbar.install

Installation functionality for Administration menu toolbar module.

Functions

Namesort descending Description
admin_menu_toolbar_install Implements hook_install().
admin_menu_toolbar_update_6300 Set module weight to a value higher than admin_menu.

File

modules/contrib/admin_menu/admin_menu_toolbar/admin_menu_toolbar.install
View source
  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. }