/[drupal]/contributions/modules/contact_forms/contact_forms.install
ViewVC logotype

Contents of /contributions/modules/contact_forms/contact_forms.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download) (as text)
Sun Nov 8 08:19:18 2009 UTC (2 weeks, 2 days ago) by gpdinoz
Branch: MAIN
CVS Tags: DRUPAL-6--1-10
Changes since 1.6: +14 -6 lines
File MIME type: text/x-php
Added hook_update thanks to iva2k
1 <?php
2 // $Id: contact_forms.install,v 1.6 2009/10/23 11:40:59 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 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",
14 array( '!link' => l('Administer > Site building > Contact form ', 'admin/build/contact/settings' ) )
15 ));
16 }
17
18 /**
19 * Implementation of hook_uninstall().
20 */
21 function contact_forms_uninstall() {
22
23 // remove variables
24 variable_del('contactforms_information');
25 variable_del('contactform_title');
26 variable_del('contactform_redirect');
27
28 //remove category information field
29 $sql = 'ALTER TABLE {contact} DROP page_info';
30 db_query($sql);
31
32 // clear the cache tables
33 cache_clear_all(null, 'cache');
34 cache_clear_all(null, 'cache_filter');
35 cache_clear_all(null, 'cache_menu');
36 cache_clear_all(null, 'cache_page');
37
38 watchdog ('Contact Forms', 'Contact Forms module removed');
39 }
40
41 /**
42 * Implementation of hook_update_N()
43 */
44 function contact_forms_update_6100() {
45 $ret = array();
46 db_add_field($ret, 'contact', 'page_info', array('type' => 'test', 'not null' => FALSE));
47 return $ret;
48 }

  ViewVC Help
Powered by ViewVC 1.1.2