|
1 <?php |
|
2 // $Id: contact.install,v 1.10.2.1 2009/01/06 15:46:36 goba Exp $ |
|
3 |
|
4 /** |
|
5 * Implementation of hook_install(). |
|
6 */ |
|
7 function contact_install() { |
|
8 // Create tables. |
|
9 drupal_install_schema('contact'); |
|
10 } |
|
11 |
|
12 /** |
|
13 * Implementation of hook_uninstall(). |
|
14 */ |
|
15 function contact_uninstall() { |
|
16 // Remove tables. |
|
17 drupal_uninstall_schema('contact'); |
|
18 |
|
19 variable_del('contact_default_status'); |
|
20 variable_del('contact_form_information'); |
|
21 variable_del('contact_hourly_threshold'); |
|
22 } |
|
23 |
|
24 /** |
|
25 * Implementation of hook_schema(). |
|
26 */ |
|
27 function contact_schema() { |
|
28 $schema['contact'] = array( |
|
29 'description' => 'Contact form category settings.', |
|
30 'fields' => array( |
|
31 'cid' => array( |
|
32 'type' => 'serial', |
|
33 'unsigned' => TRUE, |
|
34 'not null' => TRUE, |
|
35 'description' => 'Primary Key: Unique category ID.', |
|
36 ), |
|
37 'category' => array( |
|
38 'type' => 'varchar', |
|
39 'length' => 255, |
|
40 'not null' => TRUE, |
|
41 'default' => '', |
|
42 'description' => 'Category name.', |
|
43 ), |
|
44 'recipients' => array( |
|
45 'type' => 'text', |
|
46 'not null' => TRUE, |
|
47 'size' => 'big', |
|
48 'description' => 'Comma-separated list of recipient e-mail addresses.', |
|
49 ), |
|
50 'reply' => array( |
|
51 'type' => 'text', |
|
52 'not null' => TRUE, |
|
53 'size' => 'big', |
|
54 'description' => 'Text of the auto-reply message.', |
|
55 ), |
|
56 'weight' => array( |
|
57 'type' => 'int', |
|
58 'not null' => TRUE, |
|
59 'default' => 0, |
|
60 'size' => 'tiny', |
|
61 'description' => "The category's weight.", |
|
62 ), |
|
63 'selected' => array( |
|
64 'type' => 'int', |
|
65 'not null' => TRUE, |
|
66 'default' => 0, |
|
67 'size' => 'tiny', |
|
68 'description' => 'Flag to indicate whether or not category is selected by default. (1 = Yes, 0 = No)', |
|
69 ), |
|
70 ), |
|
71 'primary key' => array('cid'), |
|
72 'unique keys' => array( |
|
73 'category' => array('category'), |
|
74 ), |
|
75 'indexes' => array( |
|
76 'list' => array('weight', 'category'), |
|
77 ), |
|
78 ); |
|
79 |
|
80 return $schema; |
|
81 } |