skinr.install in Skinr 6
Same filename and directory in other branches
skinr.install Contains install, update, and uninstall functions for Skinr.
File
skinr.installView source
<?php
/**
* @file skinr.install
* Contains install, update, and uninstall functions for Skinr.
*/
/**
* Implementation of hook_uninstall().
*/
function skinr_uninstall() {
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'skinr_%'");
while ($variable = db_fetch_object($result)) {
variable_del($variable->name);
}
}
/**
* Update old Skinr variables per http://drupal.org/node/922136.
*/
function skinr_update_6100() {
$ret = array();
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'skinr_%'");
while ($variable = db_fetch_object($result)) {
$skinr = variable_get($variable->name, array());
if (!empty($skinr['panels'])) {
$keys = array_keys($skinr['panels']);
foreach ($keys as $key) {
if (strpos($key, '-panel-') !== FALSE) {
$value = $skinr['panels'][$key];
unset($skinr['panels'][$key]);
$new_key = str_replace('-panel-', '-region-', $key);
$skinr['panels'][$new_key] = $value;
}
}
variable_set($variable->name, $skinr);
}
}
return $ret;
}
Functions
Name | Description |
---|---|
skinr_uninstall | Implementation of hook_uninstall(). |
skinr_update_6100 | Update old Skinr variables per http://drupal.org/node/922136. |