You are here

function admin_theme_uninstall in Administration theme 7

Same name and namespace in other branches
  1. 5 admin_theme.install \admin_theme_uninstall()
  2. 6 admin_theme.install \admin_theme_uninstall()

Implementation of hook_uninstall().

File

./admin_theme.install, line 18

Code

function admin_theme_uninstall() {

  // Cleaning up general admin theme variables.
  variable_del('admin_theme_path');
  variable_del('admin_theme_path_disallow');

  // Cleaning up module defined admin theme variables.
  // We need to add admin theme's explicitly,
  // because it's not in the list of modules anymore.
  drupal_load('module', 'admin_theme');
  $admin_theme_options = admin_theme_admin_theme_info();
  $options = array();
  foreach ($admin_theme_options as $option => $info) {
    $info['option'] = $option;
    $info['module'] = 'admin_theme';
    $options[] = $info;
  }

  // Merging admin theme's options with other module options.
  // @fixme Does this work if other modules are also uninstalled simultaneously?
  $list = array_merge(admin_theme_list(), $options);

  // Deleting the module defined variables.
  foreach ($list as $info) {
    $var = admin_theme_variable_name($info['module'], $info['option']);
    variable_del($var);
  }
}