perm); if (in_array('admin menu', $perms, TRUE)) { $key = array_search('admin menu', $perms); $perms[$key] = 'use admin toolbar'; $perms = implode(', ', $perms); $return[] = update_sql("UPDATE {permission} SET perm = '{$perms}' WHERE pid = {$row->pid}"); } } // Remove old theme instantiation stack & reset admin theme if // referring to deprecated admin themes. variable_del('admin_theme_invalidated'); $theme = variable_get('admin_theme', '0'); if ($theme === 'admin' || $theme === 'slate') { variable_del('admin_theme'); } return $return; } /** * Update 6202: Update the format of the admin_toolbar variable. */ function admin_update_6202() { $ret = array(); $settings = variable_get('admin_toolbar', array()); if (isset($settings['blocks'])) { $needs_update = FALSE; // First pass, determine if we need to update these. foreach ($settings['blocks'] as $bid => $status) { if (!is_numeric($status)) { $needs_update = TRUE; break; } } if ($needs_update) { module_load_include('module', 'admin', 'admin'); $defaults = admin_get_default_blocks(TRUE); // Second pass, do the update! foreach ($settings['blocks'] as $bid => $status) { if ($status) { $settings['blocks'][$bid] = isset($defaults[$bid]) ? $defaults[$bid] : BLOCK_NO_CACHE; } else { unset($settings['blocks'][$bid]); } } variable_set('admin_toolbar', $settings); $ret[] = array('success' => TRUE, 'query' => 'Updated admin settings.'); } } return $ret; }