| 1 |
<?php
|
| 2 |
// $Id: mass_contact.install,v 1.4 2008/06/04 23:40:38 oadaeh Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* This is the un/install file for the Mass Contact module.
|
| 7 |
*
|
| 8 |
* This module enables users to contact multiple users through selected roles.
|
| 9 |
*/
|
| 10 |
|
| 11 |
/**
|
| 12 |
* Implementation of hook_schema().
|
| 13 |
*/
|
| 14 |
function mass_contact_schema() {
|
| 15 |
$schema['mass_contact'] = array(
|
| 16 |
'description' => t('The base table for nodes.'),
|
| 17 |
'fields' => array(
|
| 18 |
'cid' => array(
|
| 19 |
'description' => t('The primary id field for the category table.'),
|
| 20 |
'type' => 'serial',
|
| 21 |
'unsigned' => TRUE,
|
| 22 |
'not null' => TRUE),
|
| 23 |
'category' => array(
|
| 24 |
'description' => t('The name of the category.'),
|
| 25 |
'type' => 'varchar',
|
| 26 |
'length' => 255,
|
| 27 |
'not null' => TRUE,
|
| 28 |
'default' => ''),
|
| 29 |
'recipients' => array(
|
| 30 |
'description' => t('A list of the users to receive the message.'),
|
| 31 |
'type' => 'text',
|
| 32 |
'size' => 'big',
|
| 33 |
'not null' => TRUE),
|
| 34 |
'reply' => array(
|
| 35 |
'description' => t('.'),
|
| 36 |
'type' => 'text',
|
| 37 |
'size' => 'big',
|
| 38 |
'not null' => TRUE),
|
| 39 |
'weight' => array(
|
| 40 |
'description' => t('.'),
|
| 41 |
'type' => 'int',
|
| 42 |
'size' => 'tiny',
|
| 43 |
'unsigned' => FALSE,
|
| 44 |
'not null' => TRUE,
|
| 45 |
'default' => '0'),
|
| 46 |
'selected' => array(
|
| 47 |
'description' => t('.'),
|
| 48 |
'type' => 'int',
|
| 49 |
'size' => 'tiny',
|
| 50 |
'unsigned' => FALSE,
|
| 51 |
'not null' => TRUE,
|
| 52 |
'default' => '0'),
|
| 53 |
),
|
| 54 |
'primary key' => array('cid'),
|
| 55 |
'unique keys' => array(
|
| 56 |
'category' => array('category')
|
| 57 |
),
|
| 58 |
);
|
| 59 |
|
| 60 |
return $schema;
|
| 61 |
}
|
| 62 |
|
| 63 |
|
| 64 |
/**
|
| 65 |
* Implementation of hook_install().
|
| 66 |
*/
|
| 67 |
function mass_contact_install() {
|
| 68 |
drupal_install_schema('mass_contact');
|
| 69 |
drupal_set_message(t('All tables and entries required by the Mass Contact module have been created.'));
|
| 70 |
}
|
| 71 |
|
| 72 |
|
| 73 |
/**
|
| 74 |
* Implementation of hook_uninstall().
|
| 75 |
*/
|
| 76 |
function mass_contact_uninstall() {
|
| 77 |
drupal_uninstall_schema('mass_contact');
|
| 78 |
|
| 79 |
// db_query('DELETE FROM node_type WHERE type = "mass_contact"');
|
| 80 |
|
| 81 |
variable_del('mass_contact_bcc_d');
|
| 82 |
variable_del('mass_contact_bcc_d_override');
|
| 83 |
variable_del('mass_contact_category_override');
|
| 84 |
variable_del('mass_contact_default_sender_email');
|
| 85 |
variable_del('mass_contact_default_sender_name');
|
| 86 |
variable_del('mass_contact_form_information');
|
| 87 |
variable_del('mass_contact_html_d');
|
| 88 |
variable_del('mass_contact_hourly_threshold');
|
| 89 |
variable_del('mass_contact_message_prefix');
|
| 90 |
variable_del('mass_contact_message_suffix');
|
| 91 |
variable_del('mass_contact_nodecc_d');
|
| 92 |
variable_del('mass_contact_optout_d');
|
| 93 |
variable_del('mass_contact_recipient_limit');
|
| 94 |
}
|