| 1 |
<?php |
<?php |
| 2 |
// $Id: contact_forms.install,v 1.7 2009/11/08 08:19:18 gpdinoz Exp $ |
// $Id: contact_forms.install,v 1.8 2009/11/08 12:32:28 gpdinoz Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_install(). |
* Implementation of hook_install(). |
| 6 |
*/ |
*/ |
| 7 |
function contact_forms_install() { |
function contact_forms_install() { |
| 8 |
//Alter the contact table to add an info field for each category |
//Alter the contact table to add an info field for each category |
| 9 |
$sql = 'ALTER TABLE {contact} ADD page_info TEXT NULL'; |
$ret = array(); |
| 10 |
db_query($sql); |
db_add_field($ret, 'contact', 'page_info', array('type' => 'text', 'size' => 'big', 'not null' => FALSE)); |
| 11 |
|
|
| 12 |
watchdog ('Contact Forms', 'contact_forms module installed'); |
watchdog ('Contact Forms', 'contact_forms module installed'); |
| 13 |
drupal_set_message(t("Contact Forms module has been enabled. You can edit it's settings at !link", |
drupal_set_message(t("Contact Forms module has been enabled. You can edit it's settings at !link", |
| 26 |
variable_del('contactform_redirect'); |
variable_del('contactform_redirect'); |
| 27 |
|
|
| 28 |
//remove category information field |
//remove category information field |
| 29 |
$sql = 'ALTER TABLE {contact} DROP page_info'; |
$ret = array(); |
| 30 |
db_query($sql); |
db_drop_field($ret, 'contact', 'page_info'); |
| 31 |
|
|
| 32 |
|
|
| 33 |
// clear the cache tables |
// clear the cache tables |
| 34 |
cache_clear_all(null, 'cache'); |
cache_clear_all(null, 'cache'); |
| 44 |
*/ |
*/ |
| 45 |
function contact_forms_update_6100() { |
function contact_forms_update_6100() { |
| 46 |
$ret = array(); |
$ret = array(); |
| 47 |
db_add_field($ret, 'contact', 'page_info', array('type' => 'text', 'not null' => FALSE)); |
db_add_field($ret, 'contact', 'page_info', array('type' => 'text', 'size' => 'big', 'not null' => FALSE)); |
| 48 |
return $ret; |
return $ret; |
| 49 |
} |
} |