better_messages.install 1.7 KB

1234567891011121314151617181920212223242526272829303132333435
  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/settings/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 {system} WHERE name = 'better_messages'");
  14. }
  15. function better_messages_update_6000() {
  16. // Rename poorly named variables.
  17. $settings_new = array(
  18. 'position' => variable_get('better_messages_pos', 'center'), 'vertical' => variable_get('better_messages_vertical', 0),
  19. 'horizontal' => variable_get('better_messages_horizontal', 10), 'fixed' => variable_get('better_messages_fixed', 1),
  20. 'width' => variable_get('better_messages_width', '400px'), 'autoclose' => variable_get('better_messages_autoclose', 0),
  21. 'opendelay' => variable_get('better_messages_open_delay', 0.3), 'disable_autoclose' => variable_get('better_messages_disable_autoclose', 0),
  22. 'popin' => array('effect' => variable_get('better_messages_popin_effect', 'fadeIn'), 'duration' => variable_get('better_messages_popin_duration', 'slow')),
  23. 'popout' => array('effect' => variable_get('better_messages_popout_effect', 'fadeOut'), 'duration' => variable_get('better_messages_popout_duration', 'slow')),
  24. 'extra' => array(
  25. 'pages' => variable_get('better_messages_pages', ''),
  26. 'visibility' => variable_get('better_messages_visibility', 0),
  27. )
  28. );
  29. db_query("DELETE FROM {variable} WHERE name LIKE 'better_messages_%'");
  30. variable_set('better_messages', $settings_new);
  31. return array();
  32. }