You are here

skinr.install in Skinr 6

Same filename and directory in other branches
  1. 8.2 skinr.install
  2. 6.2 skinr.install
  3. 7.2 skinr.install

skinr.install Contains install, update, and uninstall functions for Skinr.

File

skinr.install
View 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

Namesort descending Description
skinr_uninstall Implementation of hook_uninstall().
skinr_update_6100 Update old Skinr variables per http://drupal.org/node/922136.