uc_termsofservice.install in Ubercart Terms of Service 6
Same filename and directory in other branches
Install, update, and uninstall functions for the uc_termsofservice module.
File
uc_termsofservice.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the uc_termsofservice module.
*/
/**
* Implements hook_uninstall().
*/
function uc_termsofservice_uninstall() {
// Delete all module variables and then clear the variable cache.
db_query("DELETE FROM {variable} WHERE name LIKE 'uc_termsofservice_%'");
cache_clear_all('variables', 'cache');
}
/**
* Implements hook_update_N().
*/
function uc_termsofservice_update_6101() {
$ret = array();
// Update the cart variables.
if (variable_get('uc_termsofservice_target', 0) == 1) {
variable_set('uc_termsofservice_cart_node', variable_get('uc_termsofservice_node', 0));
variable_set('uc_termsofservice_cart_popup', variable_get('uc_termsofservice_popup', 0));
}
elseif (variable_get('uc_termsofservice_target', 0) == 2) {
variable_set('uc_termsofservice_checkout_required', variable_get('uc_termsofservice_required', 0));
variable_set('uc_termsofservice_checkout_node', variable_get('uc_termsofservice_node', 0));
variable_set('uc_termsofservice_checkout_popup', variable_get('uc_termsofservice_popup', 0));
}
// Delete the useless variables.
$variables = array(
'uc_termsofservice_target',
'uc_termsofservice_required',
'uc_termsofservice_node',
'uc_termsofservice_popup',
);
foreach ($variables as $variable) {
variable_del($variable);
}
return $ret;
}
Functions
Name![]() |
Description |
---|---|
uc_termsofservice_uninstall | Implements hook_uninstall(). |
uc_termsofservice_update_6101 | Implements hook_update_N(). |