revision_deletion.install in Revision Deletion 7
Install and uninstall functions for the Revision Deletion module.
File
revision_deletion.installView source
<?php
/**
* @file
* Install and uninstall functions for the Revision Deletion module.
*/
/**
* Implements hook_install().
*/
function revision_deletion_install() {
// Creating the default values for the module's variables.
variable_set('revision_deletion_cron', 0);
variable_set('revision_deletion', array());
variable_set('revision_deletion_frequency', 0);
variable_set('revision_deletion_age', 30 * 24 * 60 * 60);
variable_set('revision_deletion_list_override', 0);
variable_set('revision_deletion_list_show_notes', 1);
variable_set('revision_deletion_list_keep_original', 0);
variable_set('revision_deletion_list_keep_date_last', 0);
variable_set('revision_deletion_list_keep_current', 2 * 7 * 24 * 60 * 60);
}
/**
* Implements hook_uninstall().
*/
function revision_deletion_uninstall() {
// Deleting configuration variables.
variable_del('revision_deletion_cron');
variable_del('revision_deletion');
variable_del('revision_deletion_frequency');
variable_del('revision_deletion_age');
variable_del('revision_deletion_list_override');
variable_del('revision_deletion_list_show_notes');
variable_del('revision_deletion_list_keep_original');
variable_del('revision_deletion_list_keep_date_last');
variable_del('revision_deletion_list_keep_current');
}
/**
* Update the variable names.
*/
function node_revision_delete_update_7100() {
// Updating the variable values to the new variables.
variable_set('revision_deletion_cron', variable_get('revision_delete_cron'));
variable_set('revision_deletion', variable_get('revision_delete'));
variable_set('revision_deletion_frequency', variable_get('revision_delete_frequency'));
variable_set('revision_deletion_age', variable_get('revision_delete_age'));
variable_set('revision_deletion_list_override', variable_get('revision_delete_list_override'));
variable_set('revision_deletion_list_show_notes', variable_get('revision_delete_list_show_notes'));
variable_set('revision_deletion_list_keep_original', variable_get('revision_delete_list_keep_original'));
variable_set('revision_deletion_list_keep_date_last', variable_get('revision_deletion_list_keep_date_last'));
variable_set('revision_deletion_list_keep_current', variable_get('revision_deletion_list_keep_current'));
}
Functions
Name![]() |
Description |
---|---|
node_revision_delete_update_7100 | Update the variable names. |
revision_deletion_install | Implements hook_install(). |
revision_deletion_uninstall | Implements hook_uninstall(). |