| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Enables the use of contact forms for Organic Groups
|
| 6 |
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Implementation of hook_install().
|
| 10 |
*/
|
| 11 |
function og_contact_install() {
|
| 12 |
// Create tables.
|
| 13 |
drupal_install_schema('og_contact');
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
| 17 |
* Implementation of hook_update_N().
|
| 18 |
*/
|
| 19 |
|
| 20 |
/**
|
| 21 |
* Implementation of hook_uninstall().
|
| 22 |
*/
|
| 23 |
function og_contact_uninstall() {
|
| 24 |
// Remove tables.
|
| 25 |
drupal_uninstall_schema('og_contact');
|
| 26 |
|
| 27 |
variable_del('og_contact_default_status');
|
| 28 |
variable_del('og_contact_form_information');
|
| 29 |
variable_del('og_contact_hourly_threshold');
|
| 30 |
}
|
| 31 |
|
| 32 |
/**
|
| 33 |
* Implementation of hook_schema().
|
| 34 |
*/
|
| 35 |
function og_contact_schema() {
|
| 36 |
$schema['og_contact'] = array(
|
| 37 |
'description' => t('Organic Group Contact Form settings.'),
|
| 38 |
'fields' => array(
|
| 39 |
'gid' => array(
|
| 40 |
'type' => 'int',
|
| 41 |
'unsigned' => TRUE,
|
| 42 |
'not null' => TRUE,
|
| 43 |
'description' => t('Node id of group'),
|
| 44 |
),
|
| 45 |
'noadmin' => array(
|
| 46 |
'type' => 'int',
|
| 47 |
'size' => 'tiny',
|
| 48 |
'not null' => TRUE,
|
| 49 |
'default' => 0,
|
| 50 |
'description' => t('Flag to not send messages to group admins'),
|
| 51 |
),
|
| 52 |
'grouprecipients' => array(
|
| 53 |
'type' => 'int',
|
| 54 |
'size' => 'tiny',
|
| 55 |
'not null' => TRUE,
|
| 56 |
'default' => 0,
|
| 57 |
'description' => t('flag to send to properly authorized non-admins'),
|
| 58 |
),
|
| 59 |
'recipients' => array(
|
| 60 |
'type' => 'text',
|
| 61 |
'size' => 'big',
|
| 62 |
'description' => t('Comma-separated list of recipient e-mail addresses.'),
|
| 63 |
),
|
| 64 |
'reply' => array(
|
| 65 |
'type' => 'text',
|
| 66 |
'size' => 'big',
|
| 67 |
'description' => t('Text of the auto-reply message.'),
|
| 68 |
),
|
| 69 |
'notpublic' => array(
|
| 70 |
'type' => 'int',
|
| 71 |
'size' => 'tiny',
|
| 72 |
'not null' => TRUE,
|
| 73 |
'default' => 0,
|
| 74 |
'description' => t('Flag to not display contact forms to non group members'),
|
| 75 |
),
|
| 76 |
'info' => array(
|
| 77 |
'type' => 'text',
|
| 78 |
'size' => 'big',
|
| 79 |
'description' => t('Text of custom additional information.'),
|
| 80 |
),
|
| 81 |
),
|
| 82 |
);
|
| 83 |
return $schema;
|
| 84 |
}
|