| 1 |
<?php
|
| 2 |
// $Id: term_message.install,v 1.3 2009/03/07 16:46:47 agaric Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Contains install and update functions for Term message.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_install().
|
| 11 |
*/
|
| 12 |
function term_message_install() {
|
| 13 |
drupal_install_schema('term_message');
|
| 14 |
return drupal_set_message(
|
| 15 |
t('Term message installed. Go to <a href="!url">Administer > Content > Term message</a> to set notices for content with given taxonomy terms.',
|
| 16 |
array('!url' => url('admin/content/term-message'))
|
| 17 |
)
|
| 18 |
);
|
| 19 |
}
|
| 20 |
|
| 21 |
/**
|
| 22 |
* Implementation of hook_uninstall().
|
| 23 |
*/
|
| 24 |
function term_message_uninstall() {
|
| 25 |
drupal_uninstall_schema('term_message');
|
| 26 |
|
| 27 |
// Delete variables from the database.
|
| 28 |
variable_del('term_message_collapse_form');
|
| 29 |
variable_del('term_message_teaser_lists');
|
| 30 |
}
|
| 31 |
|
| 32 |
/**
|
| 33 |
* Implementation of hook_schema().
|
| 34 |
*/
|
| 35 |
function term_message_schema() {
|
| 36 |
$schema = array();
|
| 37 |
$schema['term_message'] = array(
|
| 38 |
'description' => t('Table for term_message module that stores term ID with message.'),
|
| 39 |
'fields' => array(
|
| 40 |
'tid' => array(
|
| 41 |
'description' => t('Term ID.'),
|
| 42 |
'type' => 'int',
|
| 43 |
'not null' => TRUE,
|
| 44 |
'disp-width' => '6',
|
| 45 |
),
|
| 46 |
'message' => array(
|
| 47 |
'description' => t('Term message.'),
|
| 48 |
'type' => 'varchar',
|
| 49 |
'length' => '256',
|
| 50 |
'not null' => TRUE,
|
| 51 |
)
|
| 52 |
),
|
| 53 |
'primary_key' => array('tid'),
|
| 54 |
);
|
| 55 |
return $schema;
|
| 56 |
}
|