[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/modules/trigger/ -> trigger.install (source)

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


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7