| 1 |
<?php
|
| 2 |
// $Id: contact_forms.install,v 1.5 2008/01/31 01:53:34 gpdinoz Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function contact_forms_install() {
|
| 8 |
//Alter the contact table to add an info field for each category
|
| 9 |
$sql = 'ALTER TABLE {contact} ADD page_info TEXT NULL';
|
| 10 |
db_query($sql);
|
| 11 |
|
| 12 |
// contact_list.module is enabled - disable and put message in watchdog saying contact_forms replaces contact_lists
|
| 13 |
watchdog ('Contact Forms', 'contact_forms module installed');
|
| 14 |
drupal_set_message(t("Contact Forms module has been enabled. You can edit it's settings at !link",
|
| 15 |
array( '!link' => l('Administer > Site building > Contact form ', 'admin/build/contact/settings' ) )
|
| 16 |
));
|
| 17 |
}
|
| 18 |
|
| 19 |
/**
|
| 20 |
* Implementation of hook_uninstall().
|
| 21 |
*/
|
| 22 |
function contact_forms_uninstall() {
|
| 23 |
|
| 24 |
// remove variables
|
| 25 |
variable_del('contactforms_information');
|
| 26 |
variable_del('contactform_title');
|
| 27 |
variable_del('contactform_redirect');
|
| 28 |
|
| 29 |
//remove category information field
|
| 30 |
$sql = 'ALTER TABLE {contact} DROP page_info';
|
| 31 |
db_query($sql);
|
| 32 |
|
| 33 |
// clear the cache tables
|
| 34 |
cache_clear_all(null, 'cache');
|
| 35 |
cache_clear_all(null, 'cache_filter');
|
| 36 |
cache_clear_all(null, 'cache_menu');
|
| 37 |
cache_clear_all(null, 'cache_page');
|
| 38 |
|
| 39 |
watchdog ('Contact Forms', 'Contact Forms module removed');
|
| 40 |
}
|