Mercurial > defr > drupal > core
comparison modules/trigger/trigger.install @ 1:c1f4ac30525a 6.0
Drupal 6.0
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:28:28 +0100 |
parents | |
children | 3edae6ecd6c6 |
comparison
equal
deleted
inserted
replaced
0:5a113a1c4740 | 1:c1f4ac30525a |
---|---|
1 <?php | |
2 // $Id: trigger.install,v 1.5 2007/12/28 12:02:52 dries Exp $ | |
3 | |
4 /** | |
5 * Implementation of hook_install(). | |
6 */ | |
7 function trigger_install() { | |
8 // Create tables. | |
9 drupal_install_schema('trigger'); | |
10 | |
11 // Do initial synchronization of actions in code and the database. | |
12 actions_synchronize(actions_list()); | |
13 } | |
14 | |
15 /** | |
16 * Implementation of hook_uninstall(). | |
17 */ | |
18 function trigger_uninstall() { | |
19 // Remove tables. | |
20 drupal_uninstall_schema('trigger'); | |
21 } | |
22 | |
23 /** | |
24 * Implementation of hook_schema(). | |
25 */ | |
26 function trigger_schema() { | |
27 $schema['trigger_assignments'] = array( | |
28 'description' => t('Maps trigger to hook and operation assignments from trigger.module.'), | |
29 'fields' => array( | |
30 'hook' => array( | |
31 'type' => 'varchar', | |
32 'length' => 32, | |
33 'not null' => TRUE, | |
34 'default' => '', | |
35 'description' => t('Primary Key: The name of the internal Drupal hook upon which an action is firing; for example, nodeapi.'), | |
36 ), | |
37 'op' => array( | |
38 'type' => 'varchar', | |
39 'length' => 32, | |
40 'not null' => TRUE, | |
41 'default' => '', | |
42 'description' => t('Primary Key: The specific operation of the hook upon which an action is firing: for example, presave.'), | |
43 ), | |
44 'aid' => array( | |
45 'type' => 'varchar', | |
46 'length' => 255, | |
47 'not null' => TRUE, | |
48 'default' => '', | |
49 'description' => t("Primary Key: Action's {actions}.aid."), | |
50 ), | |
51 'weight' => array( | |
52 'type' => 'int', | |
53 'not null' => TRUE, | |
54 'default' => 0, | |
55 'description' => t('The weight of the trigger assignment in relation to other triggers.'), | |
56 ), | |
57 ), | |
58 'primary key' => array('hook', 'op', 'aid'), | |
59 ); | |
60 return $schema; | |
61 } | |
62 | |
63 |