You are here

function _admin_theme_rebuild in Admin 6

Rebuild the admin theme entry in the database.

4 calls to _admin_theme_rebuild()
admin_flush_caches in ./admin.module
Implementation of hook_flush_caches().
admin_page_alter in ./admin.module
Page preprocessor that runs before any others (including template_preprocess_page()). Check the theme rebuild flag and do so if necessary.
admin_update_6002 in ./admin.install
Update 6002: Update theme namespace to 'slate' & clears out any customizations to key admin menu items.
_admin_init_theme in ./admin.module
Initialize the admin "theme".

File

./admin.module, line 580

Code

function _admin_theme_rebuild($force = FALSE) {
  static $exists;
  if (!isset($exists) && arg(0) == 'admin') {
    $exists = db_result(db_query("SELECT count(*) FROM {system} WHERE name = 'slate' AND type = 'theme'"));
    $force = !$exists ? TRUE : $force;
  }
  if ($force || variable_get('admin_theme_invalidated', FALSE)) {
    $path = drupal_get_path('module', 'admin') . '/theme';
    $theme = new StdClass();
    $theme->name = 'slate';
    $theme->filename = "{$path}/slate.info";
    $theme->engine = 'phptemplate';
    $theme->owner = drupal_get_path('theme_engine', 'phptemplate') . '/phptemplate.engine';
    $theme->info = system_theme_default();
    $theme->info['name'] = 'Slate';
    db_query("DELETE FROM {system} WHERE name = 'slate' AND type = 'theme'");
    db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0);
    variable_set('admin_theme_invalidated', FALSE);
  }
}