From 72aadd2fa8db7caf1396003b0a666dda97f6539a Mon Sep 17 00:00:00 2001
From: Joe Shindelar <eojthebrave@gmail.com>
Date: Sun, 4 Nov 2012 11:47:56 -0800
Subject: [PATCH] Issue #1033116 Change all template.php files to
 THEMENAME.theme.

---
 core/modules/php/php.module                        |    2 +-
 .../system/tests/themes/test_theme/template.php    |   19 ---
 .../tests/themes/test_theme/test_theme.theme       |   19 +++
 core/themes/bartik/bartik.theme                    |  153 ++++++++++++++++++++
 core/themes/bartik/template.php                    |  153 --------------------
 core/themes/engines/phptemplate/phptemplate.engine |    2 +-
 core/themes/engines/twig/twig.engine               |    2 +-
 core/themes/seven/seven.theme                      |  118 +++++++++++++++
 core/themes/seven/template.php                     |  118 ---------------
 9 files changed, 293 insertions(+), 293 deletions(-)
 delete mode 100644 core/modules/system/tests/themes/test_theme/template.php
 create mode 100644 core/modules/system/tests/themes/test_theme/test_theme.theme
 create mode 100644 core/themes/bartik/bartik.theme
 delete mode 100644 core/themes/bartik/template.php
 create mode 100644 core/themes/seven/seven.theme
 delete mode 100644 core/themes/seven/template.php

diff --git a/core/modules/php/php.module b/core/modules/php/php.module
index 8e885e4..0a97808 100644
--- a/core/modules/php/php.module
+++ b/core/modules/php/php.module
@@ -105,7 +105,7 @@ function _php_filter_tips($filter, $format, $long = FALSE) {
     $output .= '<li>' . t('<code>register_globals</code> is <strong>turned off</strong>. If you need to use forms, understand and use the functions in <a href="@formapi">the Drupal Form API</a>.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/8'))) . '</li>';
     $output .= '<li>' . t('Use a <code>print</code> or <code>return</code> statement in your code to output content.') . '</li>';
     $output .= '<li>' . t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') . '</li>';
-    $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') . '</li>';
+    $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>$THEME_NAME.theme</code> file rather than embedding it directly into a post or block.') . '</li>';
     $output .= '<li>' . t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') . '</li></ul>';
     $output .= '<p>' . t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') . '</p>';
     $output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its text format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p>
diff --git a/core/modules/system/tests/themes/test_theme/template.php b/core/modules/system/tests/themes/test_theme/template.php
deleted file mode 100644
index 8275818..0000000
--- a/core/modules/system/tests/themes/test_theme/template.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
- * Tests a theme overriding a suggestion of a base theme hook.
- */
-function test_theme_theme_test__suggestion($variables) {
-  return 'Theme hook implementor=test_theme_theme_test__suggestion(). Foo=' . $variables['foo'];
-}
-
-/**
- * Tests a theme implementing an alter hook.
- *
- * The confusing function name here is due to this being an implementation of
- * the alter hook invoked when the 'theme_test' module calls
- * drupal_alter('theme_test_alter').
- */
-function test_theme_theme_test_alter_alter(&$data) {
-  $data = 'test_theme_theme_test_alter_alter was invoked';
-}
diff --git a/core/modules/system/tests/themes/test_theme/test_theme.theme b/core/modules/system/tests/themes/test_theme/test_theme.theme
new file mode 100644
index 0000000..8275818
--- /dev/null
+++ b/core/modules/system/tests/themes/test_theme/test_theme.theme
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * Tests a theme overriding a suggestion of a base theme hook.
+ */
+function test_theme_theme_test__suggestion($variables) {
+  return 'Theme hook implementor=test_theme_theme_test__suggestion(). Foo=' . $variables['foo'];
+}
+
+/**
+ * Tests a theme implementing an alter hook.
+ *
+ * The confusing function name here is due to this being an implementation of
+ * the alter hook invoked when the 'theme_test' module calls
+ * drupal_alter('theme_test_alter').
+ */
+function test_theme_theme_test_alter_alter(&$data) {
+  $data = 'test_theme_theme_test_alter_alter was invoked';
+}
diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme
new file mode 100644
index 0000000..5373c92
--- /dev/null
+++ b/core/themes/bartik/bartik.theme
@@ -0,0 +1,153 @@
+<?php
+
+/**
+ * @file
+ * Functions to support theming in the Bartik theme.
+ */
+
+/**
+ * Implements hook_preprocess_HOOK() for html.tpl.php.
+ *
+ * Adds body classes if certain regions have content.
+ */
+function bartik_preprocess_html(&$variables) {
+  if (!empty($variables['page']['featured'])) {
+    $variables['attributes']['class'][] = 'featured';
+  }
+
+  if (!empty($variables['page']['triptych_first'])
+    || !empty($variables['page']['triptych_middle'])
+    || !empty($variables['page']['triptych_last'])) {
+    $variables['attributes']['class'][] = 'triptych';
+  }
+
+  if (!empty($variables['page']['footer_firstcolumn'])
+    || !empty($variables['page']['footer_secondcolumn'])
+    || !empty($variables['page']['footer_thirdcolumn'])
+    || !empty($variables['page']['footer_fourthcolumn'])) {
+    $variables['attributes']['class'][] = 'footer-columns';
+  }
+}
+
+/**
+ * Implements hook_process_HOOK() for html.tpl.php.
+ */
+function bartik_process_html(&$variables) {
+  // Hook into color.module.
+  if (module_exists('color')) {
+    _color_html_alter($variables);
+  }
+}
+
+/**
+ * Implements hook_process_HOOK() for page.tpl.php.
+ */
+function bartik_process_page(&$variables) {
+  $site_config = config('system.site');
+  // Hook into color.module.
+  if (module_exists('color')) {
+    _color_page_alter($variables);
+  }
+  // Always print the site name and slogan, but if they are toggled off, we'll
+  // just hide them visually.
+  $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
+  $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
+  if ($variables['hide_site_name']) {
+    // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
+    $variables['site_name'] = check_plain($site_config->get('name'));
+  }
+  if ($variables['hide_site_slogan']) {
+    // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
+    $variables['site_slogan'] = filter_xss_admin($site_config->get('slogan'));
+  }
+  // Since the title and the shortcut link are both block level elements,
+  // positioning them next to each other is much simpler with a wrapper div.
+  if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
+    // Add a wrapper div using the title_prefix and title_suffix render elements.
+    $variables['title_prefix']['shortcut_wrapper'] = array(
+      '#markup' => '<div class="shortcut-wrapper clearfix">',
+      '#weight' => 100,
+    );
+    $variables['title_suffix']['shortcut_wrapper'] = array(
+      '#markup' => '</div>',
+      '#weight' => -99,
+    );
+    // Make sure the shortcut link is the first item in title_suffix.
+    $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
+  }
+}
+
+/**
+ * Implements hook_preprocess_HOOK() for maintenance-page.tpl.php.
+ */
+function bartik_preprocess_maintenance_page(&$variables) {
+  // By default, site_name is set to Drupal if no db connection is available
+  // or during site installation. Setting site_name to an empty string makes
+  // the site and update pages look cleaner.
+  // @see template_preprocess_maintenance_page
+  if (!$variables['db_is_active']) {
+    $variables['site_name'] = '';
+  }
+  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
+}
+
+/**
+ * Implements hook_process_HOOK() for maintenance-page.tpl.php.
+ */
+function bartik_process_maintenance_page(&$variables) {
+  $site_config = config('system.site');
+  // Always print the site name and slogan, but if they are toggled off, we'll
+  // just hide them visually.
+  $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
+  $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
+  if ($variables['hide_site_name']) {
+    // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
+    $variables['site_name'] = check_plain($site_config->get('name'));
+  }
+  if ($variables['hide_site_slogan']) {
+    // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
+    $variables['site_slogan'] = filter_xss_admin($site_config->get('slogan'));
+  }
+}
+
+/**
+ * Implements hook_preprocess_HOOK() for block.tpl.php.
+ */
+function bartik_preprocess_block(&$variables) {
+  // In the header region visually hide block titles.
+  if ($variables['block']->region == 'header') {
+    $variables['title_attributes']['class'][] = 'element-invisible';
+  }
+}
+
+/**
+ * Implements theme_menu_tree().
+ */
+function bartik_menu_tree($variables) {
+  return '<ul class="menu clearfix">' . $variables['tree'] . '</ul>';
+}
+
+/**
+ * Implements theme_field__field_type().
+ */
+function bartik_field__taxonomy_term_reference($variables) {
+  $output = '';
+
+  // Render the label, if it's not hidden.
+  if (!$variables['label_hidden']) {
+    $output .= '<h3 class="field-label">' . $variables['label'] . ': </h3>';
+  }
+
+  // Render the items.
+  $output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul class="links">';
+  foreach ($variables['items'] as $delta => $item) {
+    $output .= '<li class="taxonomy-term-reference-' . $delta . '"' . $variables['item_attributes'][$delta] . '>' . drupal_render($item) . '</li>';
+  }
+  $output .= '</ul>';
+
+  // Render the top-level DIV.
+  $variables['attributes']['class'][] = 'clearfix';
+  $output = '<div ' . $variables['attributes'] . '>' . $output . '</div>';
+
+  return $output;
+}
diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php
deleted file mode 100644
index 5373c92..0000000
--- a/core/themes/bartik/template.php
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-
-/**
- * @file
- * Functions to support theming in the Bartik theme.
- */
-
-/**
- * Implements hook_preprocess_HOOK() for html.tpl.php.
- *
- * Adds body classes if certain regions have content.
- */
-function bartik_preprocess_html(&$variables) {
-  if (!empty($variables['page']['featured'])) {
-    $variables['attributes']['class'][] = 'featured';
-  }
-
-  if (!empty($variables['page']['triptych_first'])
-    || !empty($variables['page']['triptych_middle'])
-    || !empty($variables['page']['triptych_last'])) {
-    $variables['attributes']['class'][] = 'triptych';
-  }
-
-  if (!empty($variables['page']['footer_firstcolumn'])
-    || !empty($variables['page']['footer_secondcolumn'])
-    || !empty($variables['page']['footer_thirdcolumn'])
-    || !empty($variables['page']['footer_fourthcolumn'])) {
-    $variables['attributes']['class'][] = 'footer-columns';
-  }
-}
-
-/**
- * Implements hook_process_HOOK() for html.tpl.php.
- */
-function bartik_process_html(&$variables) {
-  // Hook into color.module.
-  if (module_exists('color')) {
-    _color_html_alter($variables);
-  }
-}
-
-/**
- * Implements hook_process_HOOK() for page.tpl.php.
- */
-function bartik_process_page(&$variables) {
-  $site_config = config('system.site');
-  // Hook into color.module.
-  if (module_exists('color')) {
-    _color_page_alter($variables);
-  }
-  // Always print the site name and slogan, but if they are toggled off, we'll
-  // just hide them visually.
-  $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
-  $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
-  if ($variables['hide_site_name']) {
-    // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
-    $variables['site_name'] = check_plain($site_config->get('name'));
-  }
-  if ($variables['hide_site_slogan']) {
-    // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
-    $variables['site_slogan'] = filter_xss_admin($site_config->get('slogan'));
-  }
-  // Since the title and the shortcut link are both block level elements,
-  // positioning them next to each other is much simpler with a wrapper div.
-  if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
-    // Add a wrapper div using the title_prefix and title_suffix render elements.
-    $variables['title_prefix']['shortcut_wrapper'] = array(
-      '#markup' => '<div class="shortcut-wrapper clearfix">',
-      '#weight' => 100,
-    );
-    $variables['title_suffix']['shortcut_wrapper'] = array(
-      '#markup' => '</div>',
-      '#weight' => -99,
-    );
-    // Make sure the shortcut link is the first item in title_suffix.
-    $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
-  }
-}
-
-/**
- * Implements hook_preprocess_HOOK() for maintenance-page.tpl.php.
- */
-function bartik_preprocess_maintenance_page(&$variables) {
-  // By default, site_name is set to Drupal if no db connection is available
-  // or during site installation. Setting site_name to an empty string makes
-  // the site and update pages look cleaner.
-  // @see template_preprocess_maintenance_page
-  if (!$variables['db_is_active']) {
-    $variables['site_name'] = '';
-  }
-  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
-}
-
-/**
- * Implements hook_process_HOOK() for maintenance-page.tpl.php.
- */
-function bartik_process_maintenance_page(&$variables) {
-  $site_config = config('system.site');
-  // Always print the site name and slogan, but if they are toggled off, we'll
-  // just hide them visually.
-  $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
-  $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
-  if ($variables['hide_site_name']) {
-    // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
-    $variables['site_name'] = check_plain($site_config->get('name'));
-  }
-  if ($variables['hide_site_slogan']) {
-    // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
-    $variables['site_slogan'] = filter_xss_admin($site_config->get('slogan'));
-  }
-}
-
-/**
- * Implements hook_preprocess_HOOK() for block.tpl.php.
- */
-function bartik_preprocess_block(&$variables) {
-  // In the header region visually hide block titles.
-  if ($variables['block']->region == 'header') {
-    $variables['title_attributes']['class'][] = 'element-invisible';
-  }
-}
-
-/**
- * Implements theme_menu_tree().
- */
-function bartik_menu_tree($variables) {
-  return '<ul class="menu clearfix">' . $variables['tree'] . '</ul>';
-}
-
-/**
- * Implements theme_field__field_type().
- */
-function bartik_field__taxonomy_term_reference($variables) {
-  $output = '';
-
-  // Render the label, if it's not hidden.
-  if (!$variables['label_hidden']) {
-    $output .= '<h3 class="field-label">' . $variables['label'] . ': </h3>';
-  }
-
-  // Render the items.
-  $output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul class="links">';
-  foreach ($variables['items'] as $delta => $item) {
-    $output .= '<li class="taxonomy-term-reference-' . $delta . '"' . $variables['item_attributes'][$delta] . '>' . drupal_render($item) . '</li>';
-  }
-  $output .= '</ul>';
-
-  // Render the top-level DIV.
-  $variables['attributes']['class'][] = 'clearfix';
-  $output = '<div ' . $variables['attributes'] . '>' . $output . '</div>';
-
-  return $output;
-}
diff --git a/core/themes/engines/phptemplate/phptemplate.engine b/core/themes/engines/phptemplate/phptemplate.engine
index d293b85..88c09c7 100644
--- a/core/themes/engines/phptemplate/phptemplate.engine
+++ b/core/themes/engines/phptemplate/phptemplate.engine
@@ -9,7 +9,7 @@
  * Implements hook_init().
  */
 function phptemplate_init($template) {
-  $file = dirname($template->filename) . '/template.php';
+  $file = dirname($template->filename) . '/' . $template->name . '.theme';
   if (file_exists($file)) {
     include_once DRUPAL_ROOT . '/' . $file;
   }
diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine
index e7de4cf..be89e7e 100644
--- a/core/themes/engines/twig/twig.engine
+++ b/core/themes/engines/twig/twig.engine
@@ -24,7 +24,7 @@ function twig_extension() {
  * Implements hook_init().
  */
 function twig_init($template) {
-  $file = dirname($template->filename) . '/template.php';
+  $file = dirname($template->filename) . '/' . $template->name . '.theme';
   if (file_exists($file)) {
     include_once DRUPAL_ROOT . '/' . $file;
   }
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
new file mode 100644
index 0000000..f135c95
--- /dev/null
+++ b/core/themes/seven/seven.theme
@@ -0,0 +1,118 @@
+<?php
+
+/**
+ * @file
+ * Functions to support theming in the Seven theme.
+ */
+
+/**
+ * Implements hook_preprocess_HOOK() for maintenance-page.tpl.php.
+ */
+function seven_preprocess_maintenance_page(&$vars) {
+  // While markup for normal pages is split into page.tpl.php and html.tpl.php,
+  // the markup for the maintenance page is all in the single
+  // maintenance-page.tpl.php template. So, to have what's done in
+  // seven_preprocess_html() also happen on the maintenance page, it has to be
+  // called here.
+  seven_preprocess_html($vars);
+}
+
+/**
+ * Implements hook_preprocess_HOOK() for html.tpl.php.
+ */
+function seven_preprocess_html(&$vars) {
+  drupal_add_library('system', 'normalize');
+  // Add conditional CSS for IE8 and below.
+  drupal_add_css(path_to_theme() . '/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'weight' => 999, 'preprocess' => FALSE));
+}
+
+/**
+ * Implements hook_preprocess_HOOK() for page.tpl.php.
+ */
+function seven_preprocess_page(&$vars) {
+  $vars['primary_local_tasks'] = $vars['tabs'];
+  unset($vars['primary_local_tasks']['#secondary']);
+  $vars['secondary_local_tasks'] = array(
+    '#theme' => 'menu_local_tasks',
+    '#secondary' => $vars['tabs']['#secondary'],
+  );
+}
+
+/**
+ * Displays the list of available node types for node creation.
+ */
+function seven_node_add_list($variables) {
+  $content = $variables['content'];
+  $output = '';
+  if ($content) {
+    $output = '<ul class="admin-list">';
+    foreach ($content as $type) {
+      $output .= '<li class="clearfix">';
+      $output .= '<span class="label">' . l($type->name, 'node/add/' . $type->type) . '</span>';
+      $output .= '<div class="description">' . filter_xss_admin($type->description) . '</div>';
+      $output .= '</li>';
+    }
+    $output .= '</ul>';
+  }
+  else {
+    $output = '<p>' . t('You have not created any content types yet. Go to the <a href="@create-content">content type creation page</a> to add a new content type.', array('@create-content' => url('admin/structure/types/add'))) . '</p>';
+  }
+  return $output;
+}
+
+/**
+ * Overrides theme_admin_block_content().
+ *
+ * Uses an unordered list markup in both compact and extended mode.
+ */
+function seven_admin_block_content($variables) {
+  $content = $variables['content'];
+  $output = '';
+  if (!empty($content)) {
+    $output = system_admin_compact_mode() ? '<ul class="admin-list compact">' : '<ul class="admin-list">';
+    foreach ($content as $item) {
+      $output .= '<li class="leaf">';
+      $output .= l($item['title'], $item['href'], $item['localized_options']);
+      if (isset($item['description']) && !system_admin_compact_mode()) {
+        $output .= '<div class="description">' . filter_xss_admin($item['description']) . '</div>';
+      }
+      $output .= '</li>';
+    }
+    $output .= '</ul>';
+  }
+  return $output;
+}
+
+/**
+ * Overrides theme_tablesort_indicator().
+ *
+ * Uses Seven's image versions, so the arrows show up as black and not gray on
+ * gray.
+ */
+function seven_tablesort_indicator($variables) {
+  $style = $variables['style'];
+  $theme_path = drupal_get_path('theme', 'seven');
+  if ($style == 'asc') {
+    return theme('image', array('uri' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending')));
+  }
+  else {
+    return theme('image', array('uri' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending')));
+  }
+}
+
+/**
+ * Implements hook_css_alter().
+ */
+function seven_css_alter(&$css) {
+  // Use Seven's vertical tabs style instead of the default one.
+  if (isset($css['core/misc/vertical-tabs.css'])) {
+    $css['core/misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
+  }
+  if (isset($css['core/misc/vertical-tabs-rtl.css'])) {
+    $css['core/misc/vertical-tabs-rtl.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs-rtl.css';
+  }
+  // Use Seven's jQuery UI theme style instead of the default one.
+  if (isset($css['core/misc/ui/themes/base/jquery.ui.theme.css'])) {
+    $css['core/misc/ui/themes/base/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css';
+  }
+}
diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php
deleted file mode 100644
index f135c95..0000000
--- a/core/themes/seven/template.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-
-/**
- * @file
- * Functions to support theming in the Seven theme.
- */
-
-/**
- * Implements hook_preprocess_HOOK() for maintenance-page.tpl.php.
- */
-function seven_preprocess_maintenance_page(&$vars) {
-  // While markup for normal pages is split into page.tpl.php and html.tpl.php,
-  // the markup for the maintenance page is all in the single
-  // maintenance-page.tpl.php template. So, to have what's done in
-  // seven_preprocess_html() also happen on the maintenance page, it has to be
-  // called here.
-  seven_preprocess_html($vars);
-}
-
-/**
- * Implements hook_preprocess_HOOK() for html.tpl.php.
- */
-function seven_preprocess_html(&$vars) {
-  drupal_add_library('system', 'normalize');
-  // Add conditional CSS for IE8 and below.
-  drupal_add_css(path_to_theme() . '/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'weight' => 999, 'preprocess' => FALSE));
-}
-
-/**
- * Implements hook_preprocess_HOOK() for page.tpl.php.
- */
-function seven_preprocess_page(&$vars) {
-  $vars['primary_local_tasks'] = $vars['tabs'];
-  unset($vars['primary_local_tasks']['#secondary']);
-  $vars['secondary_local_tasks'] = array(
-    '#theme' => 'menu_local_tasks',
-    '#secondary' => $vars['tabs']['#secondary'],
-  );
-}
-
-/**
- * Displays the list of available node types for node creation.
- */
-function seven_node_add_list($variables) {
-  $content = $variables['content'];
-  $output = '';
-  if ($content) {
-    $output = '<ul class="admin-list">';
-    foreach ($content as $type) {
-      $output .= '<li class="clearfix">';
-      $output .= '<span class="label">' . l($type->name, 'node/add/' . $type->type) . '</span>';
-      $output .= '<div class="description">' . filter_xss_admin($type->description) . '</div>';
-      $output .= '</li>';
-    }
-    $output .= '</ul>';
-  }
-  else {
-    $output = '<p>' . t('You have not created any content types yet. Go to the <a href="@create-content">content type creation page</a> to add a new content type.', array('@create-content' => url('admin/structure/types/add'))) . '</p>';
-  }
-  return $output;
-}
-
-/**
- * Overrides theme_admin_block_content().
- *
- * Uses an unordered list markup in both compact and extended mode.
- */
-function seven_admin_block_content($variables) {
-  $content = $variables['content'];
-  $output = '';
-  if (!empty($content)) {
-    $output = system_admin_compact_mode() ? '<ul class="admin-list compact">' : '<ul class="admin-list">';
-    foreach ($content as $item) {
-      $output .= '<li class="leaf">';
-      $output .= l($item['title'], $item['href'], $item['localized_options']);
-      if (isset($item['description']) && !system_admin_compact_mode()) {
-        $output .= '<div class="description">' . filter_xss_admin($item['description']) . '</div>';
-      }
-      $output .= '</li>';
-    }
-    $output .= '</ul>';
-  }
-  return $output;
-}
-
-/**
- * Overrides theme_tablesort_indicator().
- *
- * Uses Seven's image versions, so the arrows show up as black and not gray on
- * gray.
- */
-function seven_tablesort_indicator($variables) {
-  $style = $variables['style'];
-  $theme_path = drupal_get_path('theme', 'seven');
-  if ($style == 'asc') {
-    return theme('image', array('uri' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending')));
-  }
-  else {
-    return theme('image', array('uri' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending')));
-  }
-}
-
-/**
- * Implements hook_css_alter().
- */
-function seven_css_alter(&$css) {
-  // Use Seven's vertical tabs style instead of the default one.
-  if (isset($css['core/misc/vertical-tabs.css'])) {
-    $css['core/misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
-  }
-  if (isset($css['core/misc/vertical-tabs-rtl.css'])) {
-    $css['core/misc/vertical-tabs-rtl.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs-rtl.css';
-  }
-  // Use Seven's jQuery UI theme style instead of the default one.
-  if (isset($css['core/misc/ui/themes/base/jquery.ui.theme.css'])) {
-    $css['core/misc/ui/themes/base/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css';
-  }
-}
-- 
1.7.10

