2007-06-29 18:06:51 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_install().
|
|
|
|
*/
|
2007-09-11 14:50:05 +00:00
|
|
|
function trigger_install() {
|
2007-06-29 18:06:51 +00:00
|
|
|
// Create tables.
|
2007-09-11 14:50:05 +00:00
|
|
|
drupal_install_schema('trigger');
|
2007-06-29 18:06:51 +00:00
|
|
|
|
2007-07-02 14:41:37 +00:00
|
|
|
// Do initial synchronization of actions in code and the database.
|
2007-06-29 18:06:51 +00:00
|
|
|
actions_synchronize(actions_list());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_uninstall().
|
|
|
|
*/
|
2007-09-11 14:50:05 +00:00
|
|
|
function trigger_uninstall() {
|
2007-06-29 18:06:51 +00:00
|
|
|
// Remove tables.
|
2007-09-11 14:50:05 +00:00
|
|
|
drupal_uninstall_schema('trigger');
|
2007-06-29 18:06:51 +00:00
|
|
|
}
|
2007-10-05 14:43:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of hook_schema().
|
|
|
|
*/
|
|
|
|
function trigger_schema() {
|
|
|
|
$schema['trigger_assignments'] = array(
|
|
|
|
'fields' => array(
|
|
|
|
'hook' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'op' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
|
|
|
|
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
|
|
|
|
),
|
|
|
|
'primary key' => array('hook', 'op', 'aid'),
|
|
|
|
);
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
|