From 7113fd0f8a4551ceb77c6b04f5e08d802ccc01b3 Mon Sep 17 00:00:00 2001
From: joe <eojthebrave@gmail.com>
Date: Wed, 13 Jul 2011 21:24:42 -0400
Subject: [PATCH] Rename template.php to .theme.

---
 modules/php/php.module                        |    2 +-
 themes/bartik/bartik.theme                    |  152 +++++++++++++++++++++++
 themes/bartik/template.php                    |  152 -----------------------
 themes/engines/phptemplate/phptemplate.engine |    2 +-
 themes/garland/garland.theme                  |  160 +++++++++++++++++++++++++
 themes/garland/template.php                   |  160 -------------------------
 themes/seven/seven.theme                      |  113 +++++++++++++++++
 themes/seven/template.php                     |  113 -----------------
 themes/tests/test_theme/template.php          |   21 ----
 themes/tests/test_theme/test_theme.theme      |   21 ++++
 10 files changed, 448 insertions(+), 448 deletions(-)
 create mode 100644 themes/bartik/bartik.theme
 delete mode 100644 themes/bartik/template.php
 create mode 100644 themes/garland/garland.theme
 delete mode 100644 themes/garland/template.php
 create mode 100644 themes/seven/seven.theme
 delete mode 100644 themes/seven/template.php
 delete mode 100644 themes/tests/test_theme/template.php
 create mode 100644 themes/tests/test_theme/test_theme.theme

diff --git a/modules/php/php.module b/modules/php/php.module
index 37bf9a1..6a1b93e 100644
--- a/modules/php/php.module
+++ b/modules/php/php.module
@@ -97,7 +97,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/7'))) . '</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/themes/bartik/bartik.theme b/themes/bartik/bartik.theme
new file mode 100644
index 0000000..d523a0a
--- /dev/null
+++ b/themes/bartik/bartik.theme
@@ -0,0 +1,152 @@
+<?php
+
+/**
+ * Add body classes if certain regions have content.
+ */
+function bartik_preprocess_html(&$variables) {
+  if (!empty($variables['page']['featured'])) {
+    $variables['classes_array'][] = 'featured';
+  }
+
+  if (!empty($variables['page']['triptych_first'])
+    || !empty($variables['page']['triptych_middle'])
+    || !empty($variables['page']['triptych_last'])) {
+    $variables['classes_array'][] = 'triptych';
+  }
+
+  if (!empty($variables['page']['footer_firstcolumn'])
+    || !empty($variables['page']['footer_secondcolumn'])
+    || !empty($variables['page']['footer_thirdcolumn'])
+    || !empty($variables['page']['footer_fourthcolumn'])) {
+    $variables['classes_array'][] = 'footer-columns';
+  }
+
+  // Add conditional stylesheets for IE
+  drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
+  drupal_add_css(path_to_theme() . '/css/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));
+}
+
+/**
+ * Override or insert variables into the page template for HTML output.
+ */
+function bartik_process_html(&$variables) {
+  // Hook into color.module.
+  if (module_exists('color')) {
+    _color_html_alter($variables);
+  }
+}
+
+/**
+ * Override or insert variables into the page template.
+ */
+function bartik_process_page(&$variables) {
+  // 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'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
+  }
+  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(variable_get('site_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_maintenance_page().
+ */
+function bartik_preprocess_maintenance_page(&$variables) {
+  if (!$variables['db_is_active']) {
+    unset($variables['site_name']);
+  }
+  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
+}
+
+/**
+ * Override or insert variables into the maintenance page template.
+ */
+function bartik_process_maintenance_page(&$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'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
+  }
+  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(variable_get('site_slogan', ''));
+  }
+}
+
+/**
+ * Override or insert variables into the node template.
+ */
+function bartik_preprocess_node(&$variables) {
+  if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
+    $variables['classes_array'][] = 'node-full';
+  }
+}
+
+/**
+ * Override or insert variables into the block template.
+ */
+function bartik_preprocess_block(&$variables) {
+  // In the header region visually hide block titles.
+  if ($variables['block']->region == 'header') {
+    $variables['title_attributes_array']['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.
+  $output = '<div class="' . $variables['classes'] . (!in_array('clearfix', $variables['classes_array']) ? ' clearfix' : '') . '">' . $output . '</div>';
+
+  return $output;
+}
diff --git a/themes/bartik/template.php b/themes/bartik/template.php
deleted file mode 100644
index d523a0a..0000000
--- a/themes/bartik/template.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-
-/**
- * Add body classes if certain regions have content.
- */
-function bartik_preprocess_html(&$variables) {
-  if (!empty($variables['page']['featured'])) {
-    $variables['classes_array'][] = 'featured';
-  }
-
-  if (!empty($variables['page']['triptych_first'])
-    || !empty($variables['page']['triptych_middle'])
-    || !empty($variables['page']['triptych_last'])) {
-    $variables['classes_array'][] = 'triptych';
-  }
-
-  if (!empty($variables['page']['footer_firstcolumn'])
-    || !empty($variables['page']['footer_secondcolumn'])
-    || !empty($variables['page']['footer_thirdcolumn'])
-    || !empty($variables['page']['footer_fourthcolumn'])) {
-    $variables['classes_array'][] = 'footer-columns';
-  }
-
-  // Add conditional stylesheets for IE
-  drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
-  drupal_add_css(path_to_theme() . '/css/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));
-}
-
-/**
- * Override or insert variables into the page template for HTML output.
- */
-function bartik_process_html(&$variables) {
-  // Hook into color.module.
-  if (module_exists('color')) {
-    _color_html_alter($variables);
-  }
-}
-
-/**
- * Override or insert variables into the page template.
- */
-function bartik_process_page(&$variables) {
-  // 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'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
-  }
-  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(variable_get('site_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_maintenance_page().
- */
-function bartik_preprocess_maintenance_page(&$variables) {
-  if (!$variables['db_is_active']) {
-    unset($variables['site_name']);
-  }
-  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
-}
-
-/**
- * Override or insert variables into the maintenance page template.
- */
-function bartik_process_maintenance_page(&$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'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
-  }
-  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(variable_get('site_slogan', ''));
-  }
-}
-
-/**
- * Override or insert variables into the node template.
- */
-function bartik_preprocess_node(&$variables) {
-  if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
-    $variables['classes_array'][] = 'node-full';
-  }
-}
-
-/**
- * Override or insert variables into the block template.
- */
-function bartik_preprocess_block(&$variables) {
-  // In the header region visually hide block titles.
-  if ($variables['block']->region == 'header') {
-    $variables['title_attributes_array']['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.
-  $output = '<div class="' . $variables['classes'] . (!in_array('clearfix', $variables['classes_array']) ? ' clearfix' : '') . '">' . $output . '</div>';
-
-  return $output;
-}
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index d293b85..88c09c7 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/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/themes/garland/garland.theme b/themes/garland/garland.theme
new file mode 100644
index 0000000..1b144f1
--- /dev/null
+++ b/themes/garland/garland.theme
@@ -0,0 +1,160 @@
+<?php
+
+/**
+ * Return a themed breadcrumb trail.
+ *
+ * @param $breadcrumb
+ *   An array containing the breadcrumb links.
+ * @return a string containing the breadcrumb output.
+ */
+function garland_breadcrumb($variables) {
+  $breadcrumb = $variables['breadcrumb'];
+
+  if (!empty($breadcrumb)) {
+    // Provide a navigational heading to give context for breadcrumb links to
+    // screen-reader users. Make the heading invisible with .element-invisible.
+    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+    $output .= '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+    return $output;
+  }
+}
+
+/**
+ * Override or insert variables into the maintenance page template.
+ */
+function garland_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
+  // garland_preprocess_html() also happen on the maintenance page, it has to be
+  // called here.
+  garland_preprocess_html($vars);
+}
+
+/**
+ * Override or insert variables into the html template.
+ */
+function garland_preprocess_html(&$vars) {
+  // Toggle fixed or fluid width.
+  if (theme_get_setting('garland_width') == 'fluid') {
+    $vars['classes_array'][] = 'fluid-width';
+  }
+  // Add conditional CSS for IE6.
+  drupal_add_css(path_to_theme() . '/fix-ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
+}
+
+/**
+ * Override or insert variables into the html template.
+ */
+function garland_process_html(&$vars) {
+  // Hook into color.module
+  if (module_exists('color')) {
+    _color_html_alter($vars);
+  }
+}
+
+/**
+ * Override or insert variables into the page template.
+ */
+function garland_preprocess_page(&$vars) {
+  // Move secondary tabs into a separate variable.
+  $vars['tabs2'] = array(
+    '#theme' => 'menu_local_tasks',
+    '#secondary' => $vars['tabs']['#secondary'],
+  );
+  unset($vars['tabs']['#secondary']);
+
+  if (isset($vars['main_menu'])) {
+    $vars['primary_nav'] = theme('links__system_main_menu', array(
+      'links' => $vars['main_menu'],
+      'attributes' => array(
+        'class' => array('links', 'inline', 'main-menu'),
+      ),
+      'heading' => array(
+        'text' => t('Main menu'),
+        'level' => 'h2',
+        'class' => array('element-invisible'),
+      )
+    ));
+  }
+  else {
+    $vars['primary_nav'] = FALSE;
+  }
+  if (isset($vars['secondary_menu'])) {
+    $vars['secondary_nav'] = theme('links__system_secondary_menu', array(
+      'links' => $vars['secondary_menu'],
+      'attributes' => array(
+        'class' => array('links', 'inline', 'secondary-menu'),
+      ),
+      'heading' => array(
+        'text' => t('Secondary menu'),
+        'level' => 'h2',
+        'class' => array('element-invisible'),
+      )
+    ));
+  }
+  else {
+    $vars['secondary_nav'] = FALSE;
+  }
+
+  // Prepare header.
+  $site_fields = array();
+  if (!empty($vars['site_name'])) {
+    $site_fields[] = $vars['site_name'];
+  }
+  if (!empty($vars['site_slogan'])) {
+    $site_fields[] = $vars['site_slogan'];
+  }
+  $vars['site_title'] = implode(' ', $site_fields);
+  if (!empty($site_fields)) {
+    $site_fields[0] = '<span>' . $site_fields[0] . '</span>';
+  }
+  $vars['site_html'] = implode(' ', $site_fields);
+
+  // Set a variable for the site name title and logo alt attributes text.
+  $slogan_text = $vars['site_slogan'];
+  $site_name_text = $vars['site_name'];
+  $vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
+}
+
+/**
+ * Override or insert variables into the node template.
+ */
+function garland_preprocess_node(&$vars) {
+  $vars['submitted'] = $vars['date'] . ' — ' . $vars['name'];
+}
+
+/**
+ * Override or insert variables into the comment template.
+ */
+function garland_preprocess_comment(&$vars) {
+  $vars['submitted'] = $vars['created'] . ' — ' . $vars['author'];
+}
+
+/**
+ * Override or insert variables into the block template.
+ */
+function garland_preprocess_block(&$vars) {
+  $vars['title_attributes_array']['class'][] = 'title';
+  $vars['classes_array'][] = 'clearfix';
+}
+
+/**
+ * Override or insert variables into the page template.
+ */
+function garland_process_page(&$vars) {
+  // Hook into color.module
+  if (module_exists('color')) {
+    _color_page_alter($vars);
+  }
+}
+
+/**
+ * Override or insert variables into the region template.
+ */
+function garland_preprocess_region(&$vars) {
+  if ($vars['region'] == 'header') {
+    $vars['classes_array'][] = 'clearfix';
+  }
+}
diff --git a/themes/garland/template.php b/themes/garland/template.php
deleted file mode 100644
index 1b144f1..0000000
--- a/themes/garland/template.php
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-
-/**
- * Return a themed breadcrumb trail.
- *
- * @param $breadcrumb
- *   An array containing the breadcrumb links.
- * @return a string containing the breadcrumb output.
- */
-function garland_breadcrumb($variables) {
-  $breadcrumb = $variables['breadcrumb'];
-
-  if (!empty($breadcrumb)) {
-    // Provide a navigational heading to give context for breadcrumb links to
-    // screen-reader users. Make the heading invisible with .element-invisible.
-    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
-
-    $output .= '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
-    return $output;
-  }
-}
-
-/**
- * Override or insert variables into the maintenance page template.
- */
-function garland_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
-  // garland_preprocess_html() also happen on the maintenance page, it has to be
-  // called here.
-  garland_preprocess_html($vars);
-}
-
-/**
- * Override or insert variables into the html template.
- */
-function garland_preprocess_html(&$vars) {
-  // Toggle fixed or fluid width.
-  if (theme_get_setting('garland_width') == 'fluid') {
-    $vars['classes_array'][] = 'fluid-width';
-  }
-  // Add conditional CSS for IE6.
-  drupal_add_css(path_to_theme() . '/fix-ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
-}
-
-/**
- * Override or insert variables into the html template.
- */
-function garland_process_html(&$vars) {
-  // Hook into color.module
-  if (module_exists('color')) {
-    _color_html_alter($vars);
-  }
-}
-
-/**
- * Override or insert variables into the page template.
- */
-function garland_preprocess_page(&$vars) {
-  // Move secondary tabs into a separate variable.
-  $vars['tabs2'] = array(
-    '#theme' => 'menu_local_tasks',
-    '#secondary' => $vars['tabs']['#secondary'],
-  );
-  unset($vars['tabs']['#secondary']);
-
-  if (isset($vars['main_menu'])) {
-    $vars['primary_nav'] = theme('links__system_main_menu', array(
-      'links' => $vars['main_menu'],
-      'attributes' => array(
-        'class' => array('links', 'inline', 'main-menu'),
-      ),
-      'heading' => array(
-        'text' => t('Main menu'),
-        'level' => 'h2',
-        'class' => array('element-invisible'),
-      )
-    ));
-  }
-  else {
-    $vars['primary_nav'] = FALSE;
-  }
-  if (isset($vars['secondary_menu'])) {
-    $vars['secondary_nav'] = theme('links__system_secondary_menu', array(
-      'links' => $vars['secondary_menu'],
-      'attributes' => array(
-        'class' => array('links', 'inline', 'secondary-menu'),
-      ),
-      'heading' => array(
-        'text' => t('Secondary menu'),
-        'level' => 'h2',
-        'class' => array('element-invisible'),
-      )
-    ));
-  }
-  else {
-    $vars['secondary_nav'] = FALSE;
-  }
-
-  // Prepare header.
-  $site_fields = array();
-  if (!empty($vars['site_name'])) {
-    $site_fields[] = $vars['site_name'];
-  }
-  if (!empty($vars['site_slogan'])) {
-    $site_fields[] = $vars['site_slogan'];
-  }
-  $vars['site_title'] = implode(' ', $site_fields);
-  if (!empty($site_fields)) {
-    $site_fields[0] = '<span>' . $site_fields[0] . '</span>';
-  }
-  $vars['site_html'] = implode(' ', $site_fields);
-
-  // Set a variable for the site name title and logo alt attributes text.
-  $slogan_text = $vars['site_slogan'];
-  $site_name_text = $vars['site_name'];
-  $vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
-}
-
-/**
- * Override or insert variables into the node template.
- */
-function garland_preprocess_node(&$vars) {
-  $vars['submitted'] = $vars['date'] . ' — ' . $vars['name'];
-}
-
-/**
- * Override or insert variables into the comment template.
- */
-function garland_preprocess_comment(&$vars) {
-  $vars['submitted'] = $vars['created'] . ' — ' . $vars['author'];
-}
-
-/**
- * Override or insert variables into the block template.
- */
-function garland_preprocess_block(&$vars) {
-  $vars['title_attributes_array']['class'][] = 'title';
-  $vars['classes_array'][] = 'clearfix';
-}
-
-/**
- * Override or insert variables into the page template.
- */
-function garland_process_page(&$vars) {
-  // Hook into color.module
-  if (module_exists('color')) {
-    _color_page_alter($vars);
-  }
-}
-
-/**
- * Override or insert variables into the region template.
- */
-function garland_preprocess_region(&$vars) {
-  if ($vars['region'] == 'header') {
-    $vars['classes_array'][] = 'clearfix';
-  }
-}
diff --git a/themes/seven/seven.theme b/themes/seven/seven.theme
new file mode 100644
index 0000000..4582749
--- /dev/null
+++ b/themes/seven/seven.theme
@@ -0,0 +1,113 @@
+<?php
+
+/**
+ * Override or insert variables into the maintenance page template.
+ */
+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);
+}
+
+/**
+ * Override or insert variables into the html template.
+ */
+function seven_preprocess_html(&$vars) {
+  // 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), 'preprocess' => FALSE));
+  // Add conditional CSS for IE6.
+  drupal_add_css(path_to_theme() . '/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
+}
+
+/**
+ * Override or insert variables into the page template.
+ */
+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'],
+  );
+}
+
+/**
+ * Display 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 $item) {
+      $output .= '<li class="clearfix">';
+      $output .= '<span class="label">' . l($item['title'], $item['href'], $item['localized_options']) . '</span>';
+      $output .= '<div class="description">' . filter_xss_admin($item['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().
+ *
+ * Use 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;
+}
+
+/**
+ * Override of theme_tablesort_indicator().
+ *
+ * Use our own image versions, so they 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('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending')));
+  }
+  else {
+    return theme('image', array('path' => $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['misc/vertical-tabs.css'])) {
+    $css['misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
+  }
+  if (isset($css['misc/vertical-tabs-rtl.css'])) {
+    $css['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['misc/ui/jquery.ui.theme.css'])) {
+    $css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css';
+  }
+}
diff --git a/themes/seven/template.php b/themes/seven/template.php
deleted file mode 100644
index 4582749..0000000
--- a/themes/seven/template.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-
-/**
- * Override or insert variables into the maintenance page template.
- */
-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);
-}
-
-/**
- * Override or insert variables into the html template.
- */
-function seven_preprocess_html(&$vars) {
-  // 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), 'preprocess' => FALSE));
-  // Add conditional CSS for IE6.
-  drupal_add_css(path_to_theme() . '/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
-}
-
-/**
- * Override or insert variables into the page template.
- */
-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'],
-  );
-}
-
-/**
- * Display 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 $item) {
-      $output .= '<li class="clearfix">';
-      $output .= '<span class="label">' . l($item['title'], $item['href'], $item['localized_options']) . '</span>';
-      $output .= '<div class="description">' . filter_xss_admin($item['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().
- *
- * Use 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;
-}
-
-/**
- * Override of theme_tablesort_indicator().
- *
- * Use our own image versions, so they 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('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending')));
-  }
-  else {
-    return theme('image', array('path' => $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['misc/vertical-tabs.css'])) {
-    $css['misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
-  }
-  if (isset($css['misc/vertical-tabs-rtl.css'])) {
-    $css['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['misc/ui/jquery.ui.theme.css'])) {
-    $css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css';
-  }
-}
diff --git a/themes/tests/test_theme/template.php b/themes/tests/test_theme/template.php
deleted file mode 100644
index ef8118a..0000000
--- a/themes/tests/test_theme/template.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * Tests a theme overriding a suggestion of a base theme hook.
- */
-function test_theme_breadcrumb__suggestion($variables) {
-  // Tests that preprocess functions for the base theme hook get called even
-  // when the suggestion has an implementation.
-  return 'test_theme_breadcrumb__suggestion: ' . $variables['theme_test_preprocess_breadcrumb'];
-}
-
-/**
- * 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/themes/tests/test_theme/test_theme.theme b/themes/tests/test_theme/test_theme.theme
new file mode 100644
index 0000000..ef8118a
--- /dev/null
+++ b/themes/tests/test_theme/test_theme.theme
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Tests a theme overriding a suggestion of a base theme hook.
+ */
+function test_theme_breadcrumb__suggestion($variables) {
+  // Tests that preprocess functions for the base theme hook get called even
+  // when the suggestion has an implementation.
+  return 'test_theme_breadcrumb__suggestion: ' . $variables['theme_test_preprocess_breadcrumb'];
+}
+
+/**
+ * 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';
+}
-- 
1.7.3

