annotate modules/trigger/trigger.install @ 20:e3d20ebd63d1 tip

Added tag 6.9 for changeset 3edae6ecd6c6
author Franck Deroche <franck@defr.org>
date Thu, 15 Jan 2009 10:16:10 +0100
parents 3edae6ecd6c6
children
rev   line source
webmaster@1 1 <?php
franck@19 2 // $Id: trigger.install,v 1.5.2.1 2009/01/06 15:46:38 goba 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(
franck@19 28 'description' => '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' => '',
franck@19 35 'description' => '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' => '',
franck@19 42 'description' => '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' => '',
franck@19 49 'description' => "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,
franck@19 55 'description' => '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