/[drupal]/contributions/modules/term_message/term_message.install
ViewVC logotype

Contents of /contributions/modules/term_message/term_message.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Sat Mar 7 20:57:01 2009 UTC (8 months, 3 weeks ago) by binarybill
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +21 -9 lines
File MIME type: text/x-php
#317853 by add1sun.  Changed storage structure of term message to database table.  No update path offered.
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 }

  ViewVC Help
Powered by ViewVC 1.1.2