annotate modules/contact/contact.install @ 19:3edae6ecd6c6 6.9

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