Index: template.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/template.php,v retrieving revision 1.45 diff -u -r1.45 template.php --- template.php 5 Nov 2009 13:13:45 -0000 1.45 +++ template.php 10 Nov 2009 11:12:36 -0000 @@ -36,7 +36,8 @@ * @return * A string containing the breadcrumb output. */ -function zen_breadcrumb($breadcrumb) { +function zen_breadcrumb($variables) { + $breadcrumb = $variables['breadcrumb']; // Determine if we are to display the breadcrumb. $show_breadcrumb = theme_get_setting('zen_breadcrumb'); if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') { @@ -90,10 +91,10 @@ $output = ''; if ($primary = menu_primary_local_tasks()) { - $output .= ''; + $output .= ''; } if ($secondary = menu_secondary_local_tasks()) { - $output .= ''; + $output .= ''; } return $output; @@ -292,23 +293,24 @@ */ function zen_preprocess_node(&$vars, $hook) { // Create the build_mode variable. - switch ($vars['node']->build_mode) { - case NODE_BUILD_NORMAL: + switch ($vars['elements']['#build_mode']) { + case 'full': + case 'teaser': $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full'; break; - case NODE_BUILD_PREVIEW: + case 'preview': $vars['build_mode'] = 'preview'; break; - case NODE_BUILD_SEARCH_INDEX: + case 'search_index': $vars['build_mode'] = 'search_index'; break; - case NODE_BUILD_SEARCH_RESULT: + case 'search_result': $vars['build_mode'] = 'search_result'; break; - case NODE_BUILD_RSS: + case 'rss': $vars['build_mode'] = 'rss'; break; - case NODE_BUILD_PRINT: + case 'print': $vars['build_mode'] = 'print'; break; } @@ -399,8 +401,6 @@ function zen_preprocess_block(&$vars, $hook) { $block = $vars['block']; - // Drupal 7 uses a $content variable instead of $block->content. - $vars['content'] = $block->content; // Drupal 7 should use a $title variable instead of $block->subject. $vars['title'] = $block->subject; @@ -412,9 +412,7 @@ $vars['classes_array'][] = 'count-' . $vars['id']; $vars['edit_links_array'] = array(); - if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) { - include_once './' . _zen_path() . '/zen-internals/template.block-editing.inc'; - zen_preprocess_block_editing($vars, $hook); + if (!empty($vars['contextual_links'])) { $vars['classes_array'][] = 'with-block-editing'; } } @@ -511,10 +509,7 @@ function _zen_path() { static $path = FALSE; if (!$path) { - $matches = drupal_system_listing('zen\.info$', 'themes', 'name', 0); - if (!empty($matches['zen']->filename)) { - $path = dirname($matches['zen']->filename); - } + $path = drupal_get_path('theme', 'zen'); } return $path; } Index: theme-settings.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/theme-settings.php,v retrieving revision 1.7 diff -u -r1.7 theme-settings.php --- theme-settings.php 12 Aug 2009 06:49:46 -0000 1.7 +++ theme-settings.php 10 Nov 2009 09:43:18 -0000 @@ -6,16 +6,14 @@ /** - * Implementation of THEMEHOOK_settings() function. + * Implementation of hook_form_FORM_ID_alter() function. * - * @param $saved_settings - * An array of saved settings for this theme. - * @param $subtheme_defaults - * Allow a subtheme to override the default values. - * @return - * A form array. + * @param $form + * Nested array of form elements that comprise the form. + * @param $form_state + * A keyed array containing the current state of the form. */ -function zen_settings($saved_settings, $subtheme_defaults = array()) { +function zen_form_system_theme_settings_alter(&$form, $form_state) { // Add the form's CSS drupal_add_css(drupal_get_path('theme', 'zen') . '/zen-internals/css/theme-settings.css', 'theme'); @@ -23,15 +21,6 @@ // Add javascript to show/hide optional settings drupal_add_js(drupal_get_path('theme', 'zen') . '/zen-internals/js/theme-settings.js', 'theme'); - // Get the default values from the .info file. - $defaults = zen_theme_get_default_settings('zen'); - - // Allow a subtheme to override the default values. - $defaults = array_merge($defaults, $subtheme_defaults); - - // Merge the saved variables and their default values. - $settings = array_merge($defaults, $saved_settings); - /* * Create the form using Forms API */ @@ -43,7 +32,7 @@ '#type' => 'checkbox', '#title' => t('Show block editing on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), - '#default_value' => $settings['zen_block_editing'], + '#default_value' => theme_get_setting('zen_block_editing'), ); $form['breadcrumb'] = array( @@ -54,7 +43,7 @@ $form['breadcrumb']['zen_breadcrumb'] = array( '#type' => 'select', '#title' => t('Display breadcrumb'), - '#default_value' => $settings['zen_breadcrumb'], + '#default_value' => theme_get_setting('zen_breadcrumb'), '#options' => array( 'yes' => t('Yes'), 'admin' => t('Only in admin section'), @@ -65,7 +54,7 @@ '#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), - '#default_value' => $settings['zen_breadcrumb_separator'], + '#default_value' => theme_get_setting('zen_breadcrumb_separator'), '#size' => 5, '#maxlength' => 10, '#prefix' => '
', // jquery hook to show/hide optional widgets @@ -73,18 +62,18 @@ $form['breadcrumb']['zen_breadcrumb_home'] = array( '#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), - '#default_value' => $settings['zen_breadcrumb_home'], + '#default_value' => theme_get_setting('zen_breadcrumb_home'), ); $form['breadcrumb']['zen_breadcrumb_trailing'] = array( '#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), - '#default_value' => $settings['zen_breadcrumb_trailing'], + '#default_value' => theme_get_setting('zen_breadcrumb_trailing'), '#description' => t('Useful when the breadcrumb is placed just before the title.'), ); $form['breadcrumb']['zen_breadcrumb_title'] = array( '#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), - '#default_value' => $settings['zen_breadcrumb_title'], + '#default_value' => theme_get_setting('zen_breadcrumb_title'), '#description' => t('Useful when the breadcrumb is not placed just before the title.'), '#suffix' => '
', // #div-zen-breadcrumb ); @@ -97,7 +86,7 @@ $form['themedev']['zen_rebuild_registry'] = array( '#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), - '#default_value' => $settings['zen_rebuild_registry'], + '#default_value' => theme_get_setting('zen_rebuild_registry'), '#description' => t('During theme development, it can be very useful to continuously rebuild the theme registry. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')), '#prefix' => '
' . t('Theme registry:') . '', '#suffix' => '
', @@ -109,12 +98,12 @@ 'zen-columns-liquid' => t('Liquid layout') . ' (layout-liquid.css)', 'zen-columns-fixed' => t('Fixed layout') . ' (layout-fixed.css)', ), - '#default_value' => $settings['zen_layout'], + '#default_value' => theme_get_setting('zen_layout'), ); $form['themedev']['zen_wireframes'] = array( '#type' => 'checkbox', '#title' => t('Display borders around main layout elements'), - '#default_value' => $settings['zen_wireframes'], + '#default_value' => theme_get_setting('zen_wireframes'), '#description' => t('Wireframes are useful when prototyping a website.', array('!link' => 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain')), '#prefix' => '
' . t('Wireframes:') . '', '#suffix' => '
', @@ -123,7 +112,4 @@ $form['zen-div-closing'] = array( '#value' => '', ); - - // Return the form - return $form; } Index: zen.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen.info,v retrieving revision 1.8 diff -u -r1.8 zen.info --- zen.info 8 Nov 2009 18:28:48 -0000 1.8 +++ zen.info 10 Nov 2009 09:28:54 -0000 @@ -5,18 +5,21 @@ screenshot = zen-internals/screenshot.png -core = 6.x +core = 7.x engine = phptemplate +regions[help] = Help regions[sidebar_first] = First sidebar regions[sidebar_second] = Second sidebar regions[navigation] = Navigation bar regions[highlight] = Highlighted content regions[content_top] = Content top +regions[content] = Content regions[content_bottom] = Content bottom regions[header] = Header regions[footer] = Footer -regions[page_closure] = Page closure +regions[page_top] = Page top +regions[page_bottom] = Page bottom features[] = logo features[] = name @@ -26,8 +29,8 @@ features[] = comment_user_picture features[] = search features[] = favicon -features[] = primary_links -features[] = secondary_links +features[] = main_menu +features[] = secondary_menu ; Set the default settings to be used in theme-settings.php settings[zen_block_editing] = 1 Index: templates/block.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/templates/block.tpl.php,v retrieving revision 1.6 diff -u -r1.6 block.tpl.php --- templates/block.tpl.php 2 Nov 2009 17:42:27 -0000 1.6 +++ templates/block.tpl.php 10 Nov 2009 11:01:47 -0000 @@ -61,5 +61,7 @@ - + + + Index: templates/maintenance-page.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/templates/maintenance-page.tpl.php,v retrieving revision 1.17 diff -u -r1.17 maintenance-page.tpl.php --- templates/maintenance-page.tpl.php 4 Nov 2009 20:49:23 -0000 1.17 +++ templates/maintenance-page.tpl.php 10 Nov 2009 11:13:59 -0000 @@ -14,15 +14,8 @@ * @see template_preprocess_maintenance_page() */ ?> - - + - - <?php print $head_title; ?> - - - -
Index: templates/node.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/templates/node.tpl.php,v retrieving revision 1.10 diff -u -r1.10 node.tpl.php --- templates/node.tpl.php 2 Nov 2009 17:42:27 -0000 1.10 +++ templates/node.tpl.php 10 Nov 2009 11:03:37 -0000 @@ -74,7 +74,11 @@ */ ?>
- + +
+ +
+

@@ -84,7 +88,7 @@
- +
- -
+ +
- +
- +
Index: templates/page.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/templates/page.tpl.php,v retrieving revision 1.26 diff -u -r1.26 page.tpl.php --- templates/page.tpl.php 5 Nov 2009 13:54:57 -0000 1.26 +++ templates/page.tpl.php 10 Nov 2009 11:09:45 -0000 @@ -60,9 +60,9 @@ * * Navigation: * - $search_box: HTML to display the search box, empty if search has been disabled. - * - $primary_links (array): An array containing the Primary menu links for the + * - $main_menu (array): An array containing the Primary menu links for the * site, if they have been configured. - * - $secondary_links (array): An array containing the Secondary menu links for + * - $secondary_menu (array): An array containing the Secondary menu links for * the site, if they have been configured. * - $breadcrumb: The breadcrumb trail for the current page. * @@ -71,13 +71,13 @@ * - $messages: HTML for status and error messages. Should be displayed prominently. * - $tabs: Tabs linking to any sub-pages beneath the current page (e.g., the * view and edit tabs when displaying a node). - * - $help: Dynamic help text, mostly for admin pages. * - $content: The main content of the current page. * - $feed_icons: A string of all feed icons for the current page. * * Footer/closing data: * - $footer_message: The footer message as defined in the admin settings. - * - $closure: Final closing markup from any modules that have altered the page. + * - $page_top: Markup that needs to be at the top of the body. + * - $page_bottom: Final closing markup from any modules that have altered the page. * This variable should always be output last, after all other dynamic content. * * Helper variables: @@ -85,6 +85,7 @@ * into a string within the variable $classes. * * Regions: + * - $help: Dynamic help text, mostly for admin pages. * - $content_top: Items to appear above the main content of the current page. * - $content_bottom: Items to appear below the main content of the current page. * - $navigation: Items for the navigation bar. @@ -103,18 +104,12 @@ * @see zen_process() */ ?> - - + - - <?php print $head_title; ?> - - - - - - + + +
@@ -146,23 +141,15 @@
- - - - - +
-
- - - + Index: zen-internals/css/zen-fixed.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen-internals/css/zen-fixed.css,v retrieving revision 1.12 diff -u -r1.12 zen-fixed.css --- zen-internals/css/zen-fixed.css 10 Nov 2009 08:25:15 -0000 1.12 +++ zen-internals/css/zen-fixed.css 10 Nov 2009 11:17:05 -0000 @@ -1026,17 +1026,6 @@ .box .content /* Box's content wrapper */ { } -/* - * Markup free clearing (See: http://www.positioniseverything.net/easyclearing.html ) - */ -.clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - /** * Hide elements from all users. * Index: zen-internals/css/zen-liquid.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen-internals/css/zen-liquid.css,v retrieving revision 1.12 diff -u -r1.12 zen-liquid.css --- zen-internals/css/zen-liquid.css 10 Nov 2009 08:25:15 -0000 1.12 +++ zen-internals/css/zen-liquid.css 10 Nov 2009 11:17:03 -0000 @@ -1016,17 +1016,6 @@ .box .content /* Box's content wrapper */ { } -/* - * Markup free clearing (See: http://www.positioniseverything.net/easyclearing.html ) - */ -.clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - /** * Hide elements from all users. * Index: zen-internals/template.theme-registry.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/themes/zen/zen-internals/template.theme-registry.inc,v retrieving revision 1.7 diff -u -r1.7 template.theme-registry.inc --- zen-internals/template.theme-registry.inc 3 Nov 2009 18:27:44 -0000 1.7 +++ zen-internals/template.theme-registry.inc 10 Nov 2009 10:40:06 -0000 @@ -21,10 +21,6 @@ } } - // Since we are rebuilding the theme registry and the theme settings' default - // values may have changed, make sure they are saved in the database properly. - zen_theme_get_default_settings($theme); - // If we are auto-rebuilding the theme registry, warn about the feature. // Always display the warning in the admin section, otherwise limit to three // warnings per hour. @@ -37,29 +33,6 @@ static $base_themes = array(); $base_themes[] = $theme; - // Add a "process" phase to come after the "preprocess" functions. - if ($type == 'theme') { - foreach (array_keys($existing) as $hook) { - // Normally, preprocess functions are added to the registry after - // HOOK_theme() returns, but if we add them first, they won't be re-added. - if (function_exists($theme . '_preprocess')) { - $existing[$hook]['preprocess functions'][] = $theme . '_preprocess'; - } - if (function_exists($theme . '_preprocess_' . $hook)) { - $existing[$hook]['preprocess functions'][] = $theme . '_preprocess_' . $hook; - } - // Now add the process functions. - foreach ($base_themes as $base_theme) { - if (function_exists($base_theme . '_process')) { - $existing[$hook]['preprocess functions'][] = $base_theme . '_process'; - } - if (function_exists($base_theme . '_process_' . $hook)) { - $existing[$hook]['preprocess functions'][] = $base_theme . '_process_' . $hook; - } - } - } - } - // Manipulations only to be done by the base theme. if ($theme == 'zen') { // Insert zen_show_blocks_discovery() before template_preprocess_page(). @@ -68,7 +41,7 @@ // The base theme registers region.tpl.php. return array( 'region' => array( - 'arguments' => array('elements' => NULL), + 'variables' => array('elements' => NULL), //'pattern' => 'region_', 'path' => drupal_get_path('theme', 'zen') . '/templates', 'template' => 'region', @@ -87,30 +60,3 @@ // Else return nothing. return array(); } - -/** - * Return the theme settings' default values from the .info and save them into the database. - * - * @param $theme - * The name of theme. - */ -function zen_theme_get_default_settings($theme) { - $themes = list_themes(); - - // Get the default values from the .info file. - $defaults = !empty($themes[$theme]->info['settings']) ? $themes[$theme]->info['settings'] : array(); - - if (!empty($defaults)) { - // Merge the defaults with the theme settings saved in the database. - $settings = array_merge($defaults, variable_get('theme_'. $theme .'_settings', array())); - // Save the settings back to the database. - variable_set('theme_'. $theme .'_settings', $settings); - // If the active theme has been loaded, force refresh of Drupal internals. - if (!empty($GLOBALS['theme_key'])) { - theme_get_setting('', TRUE); - } - } - - // Return the default settings. - return $defaults; -}