better_messages.install 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Implementaton of hook_install
  4. */
  5. function better_messages_install() {
  6. drupal_set_message(t("Better Messages is installed successfully.<br />Click here to visit the <a href=@href>settings page</a>!", array('@href' => base_path() . 'admin/config/user-interface/better-messages')));
  7. }
  8. /**
  9. * Implementaton of hook_uninstall
  10. */
  11. function better_messages_uninstall() {
  12. db_query("DELETE FROM {variable} WHERE name LIKE 'better_messages_%'");
  13. db_query("DELETE FROM {variable} WHERE name = 'better_messages'");
  14. db_query("DELETE FROM {system} WHERE name = 'better_messages'");
  15. }
  16. function better_messages_update_6000() {
  17. // Rename poorly named variables.
  18. $settings_new = array(
  19. 'position' => variable_get('better_messages_pos', 'center'), 'vertical' => variable_get('better_messages_vertical', 0),
  20. 'horizontal' => variable_get('better_messages_horizontal', 10), 'fixed' => variable_get('better_messages_fixed', 1),
  21. 'width' => variable_get('better_messages_width', '400px'), 'autoclose' => variable_get('better_messages_autoclose', 0),
  22. 'opendelay' => variable_get('better_messages_open_delay', 0.3), 'disable_autoclose' => variable_get('better_messages_disable_autoclose', 0),
  23. 'popin' => array('effect' => variable_get('better_messages_popin_effect', 'fadeIn'), 'duration' => variable_get('better_messages_popin_duration', 'slow')),
  24. 'popout' => array('effect' => variable_get('better_messages_popout_effect', 'fadeOut'), 'duration' => variable_get('better_messages_popout_duration', 'slow')),
  25. 'extra' => array(
  26. 'pages' => variable_get('better_messages_pages', ''),
  27. 'visibility' => variable_get('better_messages_visibility', 0),
  28. )
  29. );
  30. db_query("DELETE FROM {variable} WHERE name LIKE 'better_messages_%'");
  31. variable_set('better_messages', $settings_new);
  32. return array();
  33. }