| 1 |
<?php |
<?php |
| 2 |
// $Id: revision_moderation.install,v 1.5 2008/07/31 17:29:58 westwesterson Exp $ |
// $Id: revision_moderation.install,v 1.6 2008/12/19 22:11:44 add1sun Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_schema(). |
* @file |
| 6 |
|
* Install, update and uninstall functions for the revision moderation module. |
| 7 |
|
*/ |
| 8 |
|
|
| 9 |
|
/** |
| 10 |
|
* Implement hook_schema(). |
| 11 |
*/ |
*/ |
| 12 |
function revision_moderation_schema() { |
function revision_moderation_schema() { |
| 13 |
$schema['revision_moderation'] = array( |
$schema['revision_moderation'] = array( |
| 32 |
} |
} |
| 33 |
|
|
| 34 |
/** |
/** |
| 35 |
* Implementation of hook_install(). |
* Implement hook_install(). |
| 36 |
*/ |
*/ |
| 37 |
function revision_moderation_install() { |
function revision_moderation_install() { |
| 38 |
// Create table |
$ret = array(); |
| 39 |
drupal_install_schema('revision_moderation'); |
$schema['node'] = array(); |
| 40 |
|
revision_moderation_schema_alter($schema); |
| 41 |
|
foreach ($schema['node']['fields'] as $name => $spec) { |
| 42 |
|
db_add_field('node', $name, $spec); |
| 43 |
|
} |
| 44 |
} |
} |
| 45 |
|
|
| 46 |
/** |
/** |
| 47 |
* Implementation of hook_uninstall(). |
* Implement hook_uninstall(). |
| 48 |
*/ |
*/ |
| 49 |
function revision_moderation_uninstall() { |
function revision_moderation_uninstall() { |
|
// Drop the table |
|
|
drupal_uninstall_schema('revision_moderation'); |
|
| 50 |
variable_del('revision_moderation_exempt'); |
variable_del('revision_moderation_exempt'); |
| 51 |
|
$ret = array(); |
| 52 |
|
$schema['node'] = array(); |
| 53 |
|
revision_moderation_schema_alter($schema); |
| 54 |
|
foreach ($schema['node']['fields'] as $name => $spec) { |
| 55 |
|
db_drop_field('node', $name, $spec); |
| 56 |
|
} |
| 57 |
} |
} |