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