You are here

function admin_theme_registry_alter in Admin 6

Same name and namespace in other branches
  1. 6.2 admin.module \admin_theme_registry_alter()

Implementation of hook_theme_registry_alter().

File

./admin.module, line 381

Code

function admin_theme_registry_alter(&$theme_registry) {
  $hooks = array(
    'page',
    'block',
    'views_view',
    'node',
  );
  foreach ($hooks as $hook) {
    if (empty($theme_registry[$hook]['preprocess functions']) || !in_array('admin_preprocess_' . $hook, $theme_registry[$hook]['preprocess functions'])) {
      $theme_registry[$hook]['preprocess functions'][] = 'admin_preprocess_' . $hook;
    }
  }

  // If the slate theme has been inited, do some additional work.
  global $theme;
  if ($theme == 'slate') {

    // Slap a preprocessor on at the very front of the stack for rebuilding the admin theme.
    if (!in_array('admin_page_alter', $theme_registry['page']['preprocess functions'])) {
      array_unshift($theme_registry['page']['preprocess functions'], 'admin_page_alter');
    }
    $overrides = array(
      'fieldset',
      'node_form',
      'system_settings_form',
      'admin_block_content',
    );
    foreach ($overrides as $hook) {
      $theme_registry[$hook]['function'] = 'slate_' . $hook;
      $theme_registry[$hook]['theme path'] = drupal_get_path('module', 'admin') . '/theme';
    }
  }
}