Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.733 diff -u -r1.733 system.module --- modules/system/system.module 31 Jul 2009 19:01:02 -0000 1.733 +++ modules/system/system.module 2 Aug 2009 07:57:22 -0000 @@ -273,6 +273,7 @@ '#show_messages' => TRUE, '#show_blocks' => TRUE, '#theme' => 'page', + '#theme_wrapper' => 'html', ); $type['list'] = array( Index: modules/system/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/system/page.tpl.php,v retrieving revision 1.26 diff -u -r1.26 page.tpl.php --- modules/system/page.tpl.php 30 Jul 2009 08:28:47 -0000 1.26 +++ modules/system/page.tpl.php 2 Aug 2009 07:57:20 -0000 @@ -10,7 +10,6 @@ * General utility variables: * - $base_path: The base URL path of the Drupal installation. At the very * least, this will always default to /. - * - $css: An array of CSS files for the current page. * - $directory: The directory the template is located in, e.g. modules/system * or themes/garland. * - $classes_array: Array of html class attribute values. It is flattened @@ -19,39 +18,6 @@ * - $logged_in: TRUE if the user is registered and signed in. * - $is_admin: TRUE if the user has permission to access administration pages. * - * Page metadata: - * - $language: (object) The language the site is being displayed in. - * $language->language contains its textual representation. - * $language->dir contains the language direction. It will either be 'ltr' or 'rtl'. - * - $rdf_namespaces: All the RDF namespace prefixes used in the HTML document. - * - $grddl_profile: A GRDDL profile allowing agents to extract the RDF data. - * - $head_title: A modified version of the page title, for use in the TITLE tag. - * - $head: Markup for the HEAD section (including meta tags, keyword tags, and - * so on). - * - $styles: Style tags necessary to import all CSS files for the page. - * - $scripts: Script tags necessary to load the JavaScript files and settings - * for the page. - * - $classes: String of classes that can be used to style contextually through - * CSS. It should be placed within the tag. When selecting through CSS - * it's recommended that you use the body tag, e.g., "body.front". It can be - * manipulated through the variable $classes_array from preprocess functions. - * The default values can be one or more of the following: - * - page: The current template type, i.e., "theming hook". - * - front: Page is the home page. - * - not-front: Page is not the home page. - * - logged-in: The current viewer is logged in. - * - not-logged-in: The current viewer is not logged in. - * - page-[level 1 path]: The internal first level path. For example, viewing - * example.com/user/2 would result in "page-user". Path aliases do not apply. - * - node-type-[node type]: When viewing a single node, the type of that node. - * For example, if the node is a "Blog entry" it would result in "node-type-blog". - * Note that the machine name will often be in a short form of the human readable label. - * The following only apply with the default 'left' and 'right' block regions: - * - two-sidebars: When both sidebars have content. - * - no-sidebars: When no sidebar content exists. - * - one-sidebar and sidebar-left or sidebar-right: A combination of the two classes - * when only one of the two sidebars have content. - * * Site identity: * - $front_page: The URL of the front page. Use this instead of $base_path, * when linking to the front page. This includes the language domain or prefix. @@ -75,40 +41,22 @@ * - $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. - * - $left: Items for the left sidebar. - * - $right: Items for the right sidebar. - * - $highlight: Items for the highlighted content region. - * - * Opening and closing data: - * - $page_top: Initial markup from any modules that have altered the - * page. This variable should always be output first, before all other dynamic - * content. - * - $footer : The footer region. - * - $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. * + * Regions: + * - $page['help']: Dynamic help text, mostly for admin pages. + * - $page['highlight']: Items for the highlighted content region. + * - $page['content']: The main content of the current page. + * - $page['left']: Items for the left sidebar. + * - $page['right']: Items for the right sidebar. + * - $page['header']: Items for the header region. + * - $page['footer']: Items for the footer region. + * * @see template_preprocess() * @see template_preprocess_page() * @see template_process() */ ?> - -> - - - <?php print $head_title; ?> - - - - - - -
@@ -144,9 +92,9 @@ - +
- +
@@ -167,25 +115,31 @@
-
+ + +
+ +
+ +

- +
- +
- + - + @@ -193,12 +147,11 @@
- - - - - Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.951 diff -u -r1.951 common.inc --- includes/common.inc 31 Jul 2009 19:56:09 -0000 1.951 +++ includes/common.inc 2 Aug 2009 07:57:19 -0000 @@ -4130,6 +4130,10 @@ 'placeholder' => array( 'arguments' => array('text' => NULL) ), + 'html' => array( + 'arguments' => array('page' => NULL), + 'template' => 'html', + ), 'page' => array( 'arguments' => array('page' => NULL), 'template' => 'page', Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.501 diff -u -r1.501 theme.inc --- includes/theme.inc 30 Jul 2009 19:57:09 -0000 1.501 +++ includes/theme.inc 2 Aug 2009 07:57:20 -0000 @@ -1864,6 +1864,85 @@ } /** + * Preprocess variables for html.tpl.php + * + * @see system_elements() + * @see html.tpl.php + */ +function template_preprocess_html(&$variables) { + // Compile a list of classes that are going to be applied to the body element. + // This allows advanced theming based on context (home page, node of certain type, etc.). + // Add a class that tells us whether we're on the front page or not. + $variables['classes_array'][] = $variables['is_front'] ? 'front' : 'not-front'; + // Add a class that tells us whether the page is viewed by an authenticated user or not. + $variables['classes_array'][] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in'; + + // Add information about the number of sidebars. + if (!empty($variables['page']['left']) && !empty($variables['page']['right'])) { + $variables['classes_array'][] = 'two-sidebars'; + } + elseif (!empty($variables['page']['left'])) { + $variables['classes_array'][] = 'one-sidebar sidebar-left'; + } + elseif (!empty($variables['page']['right'])) { + $variables['classes_array'][] = 'one-sidebar sidebar-right'; + } + else { + $variables['classes_array'][] = 'no-sidebars'; + } + + // Populate the body classes. + if ($suggestions = template_page_suggestions(arg())) { + foreach ($suggestions as $suggestion) { + if ($suggestion != 'page-front') { + // Add current suggestion to page classes to make it possible to theme the page + // depending on the current page type (e.g. node, admin, user, etc.) as well as + // more specific data like node-12 or node-edit. To avoid illegal characters in + // the class, we're removing everything disallowed. We are not using 'a-z' as + // that might leave in certain international characters (e.g. German umlauts). + $variables['classes_array'][] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', form_clean_id(drupal_strtolower($suggestion))); + } + } + } + + if ($node = menu_get_object()) { + $variables['classes_array'][] = 'node-type-' . form_clean_id($node->type); + } + + // RDFa allows annotation of XHTML pages with RDF data, while GRDDL provides + // mechanisms for extraction of this RDF content via XSLT transformation + // using an associated GRDDL profile. + $variables['rdf_namespaces'] = drupal_get_rdf_namespaces(); + $variables['grddl_profile'] = 'http://ns.inria.fr/grddl/rdfa/'; + $variables['language'] = $GLOBALS['language']; + $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; + + + // Add favicon. + if (theme_get_setting('toggle_favicon')) { + $favicon = theme_get_setting('favicon'); + $type = file_get_mimetype($favicon); + // Use the genereic MIME type for favicons if no other was found. + if ($type == 'application/octet-stream') { + $type = 'image/x-icon'; + } + drupal_add_html_head(''); + } + + // Construct page title. + if (drupal_get_title()) { + $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal')); + } + else { + $head_title = array(variable_get('site_name', 'Drupal')); + if (variable_get('site_slogan', '')) { + $head_title[] = variable_get('site_slogan', ''); + } + } + $variables['head_title'] = implode(' | ', $head_title); +} + +/** * Preprocess variables for page.tpl.php * * Most themes utilize their own copy of page.tpl.php. The default is located @@ -1885,17 +1964,6 @@ $variables['show_blocks'] = $variables['page']['#show_blocks']; $variables['show_messages'] = $variables['page']['#show_messages']; - // Add favicon. - if (theme_get_setting('toggle_favicon')) { - $favicon = theme_get_setting('favicon'); - $type = file_get_mimetype($favicon); - // Use the genereic MIME type for favicons if no other was found. - if ($type == 'application/octet-stream') { - $type = 'image/x-icon'; - } - drupal_add_html_head(''); - } - // Set up layout variable. $variables['layout'] = 'none'; if (!empty($variables['page']['left'])) { @@ -1905,23 +1973,10 @@ $variables['layout'] = ($variables['layout'] == 'left') ? 'both' : 'right'; } - // Construct page title - if (drupal_get_title()) { - $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal')); - } - else { - $head_title = array(variable_get('site_name', 'Drupal')); - if (variable_get('site_slogan', '')) { - $head_title[] = variable_get('site_slogan', ''); - } - } - $variables['head_title'] = implode(' | ', $head_title); $variables['base_path'] = base_path(); $variables['front_page'] = url(); $variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb()); $variables['feed_icons'] = drupal_get_feeds(); - $variables['language'] = $GLOBALS['language']; - $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; $variables['logo'] = theme_get_setting('logo'); $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : ''; $variables['main_menu'] = theme_get_setting('toggle_main_menu') ? menu_main_menu() : array(); @@ -1931,68 +1986,33 @@ $variables['site_slogan'] = (theme_get_setting('toggle_slogan') ? filter_xss_admin(variable_get('site_slogan', '')) : ''); $variables['tabs'] = theme('menu_local_tasks'); $variables['title'] = drupal_get_title(); - // RDFa allows annotation of XHTML pages with RDF data, while GRDDL provides - // mechanisms for extraction of this RDF content via XSLT transformation - // using an associated GRDDL profile. - $variables['rdf_namespaces'] = drupal_get_rdf_namespaces(); - $variables['grddl_profile'] = 'http://ns.inria.fr/grddl/rdfa/'; if ($node = menu_get_object()) { $variables['node'] = $node; } - // Compile a list of classes that are going to be applied to the body element. - // This allows advanced theming based on context (home page, node of certain type, etc.). - // Add a class that tells us whether we're on the front page or not. - $variables['classes_array'][] = $variables['is_front'] ? 'front' : 'not-front'; - // Add a class that tells us whether the page is viewed by an authenticated user or not. - $variables['classes_array'][] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in'; - // Populate the page template suggestions. if ($suggestions = template_page_suggestions(arg())) { $variables['template_files'] = $suggestions; - foreach ($suggestions as $suggestion) { - if ($suggestion != 'page-front') { - // Add current suggestion to page classes to make it possible to theme the page - // depending on the current page type (e.g. node, admin, user, etc.) as well as - // more specific data like node-12 or node-edit. To avoid illegal characters in - // the class, we're removing everything disallowed. We are not using 'a-z' as - // that might leave in certain international characters (e.g. German umlauts). - $variables['classes_array'][] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', form_clean_id(drupal_strtolower($suggestion))); - } - } - } - - // If on an individual node page, add the node type to body classes. - if (isset($variables['node']) && $variables['node']->type) { - $variables['classes_array'][] = 'node-type-' . form_clean_id($variables['node']->type); - } - // Add information about the number of sidebars. - if ($variables['layout'] == 'both') { - $variables['classes_array'][] = 'two-sidebars'; - } - elseif ($variables['layout'] == 'none') { - $variables['classes_array'][] = 'no-sidebars'; - } - else { - $variables['classes_array'][] = 'one-sidebar sidebar-' . $variables['layout']; } } + /** - * Process variables for page.tpl.php + * Process variables for html.tpl.php * * Perform final addition and modification of variables before passing into * the template. To customize these variables, call drupal_render() on elements * in $variables['page'] during THEME_preprocess_page(). * - * @see template_preprocess_page() - * @see page.tpl.php + * @see template_preprocess_html() + * @see html.tpl.php */ -function template_process_page(&$variables) { - // Render each region into top level variables. - foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) { - $variables[$region_key] = drupal_render($variables['page'][$region_key]); - } +function template_process_html(&$variables) { + // Render page_top and page_bottom into top level variables. + $variables['page_top'] = drupal_render($variables['page']['page_top']); + $variables['page_bottom'] = drupal_render($variables['page']['page_bottom']); + // Place the rendered HTML for the page body into a top level variable. + $variables['page'] = $variables['page']['#children']; // Append javascript to $page_bottom $variables['page_bottom'] .= drupal_get_js('footer'); Index: themes/garland/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/template.php,v retrieving revision 1.23 diff -u -r1.23 template.php --- themes/garland/template.php 28 Jul 2009 10:09:25 -0000 1.23 +++ themes/garland/template.php 2 Aug 2009 07:57:22 -0000 @@ -15,13 +15,19 @@ } /** + * Override or insert variables into the html template. + */ +function garland_process_html(&$vars) { + $vars['styles'] .= "\n\n"; +} + +/** * Override or insert variables into the page template. */ function garland_preprocess_page(&$vars) { $vars['tabs2'] = menu_secondary_local_tasks(); $vars['primary_nav'] = isset($vars['main_menu']) ? theme('links', $vars['main_menu'], array('class' => 'links main-menu')) : FALSE; $vars['secondary_nav'] = isset($vars['secondary_menu']) ? theme('links', $vars['secondary_menu'], array('class' => 'links secondary-menu')) : FALSE; - $vars['ie_styles'] = garland_get_ie_styles(); // Prepare header $site_fields = array(); Index: themes/garland/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/page.tpl.php,v retrieving revision 1.30 diff -u -r1.30 page.tpl.php --- themes/garland/page.tpl.php 30 Jul 2009 08:28:47 -0000 1.30 +++ themes/garland/page.tpl.php 2 Aug 2009 07:57:22 -0000 @@ -1,23 +1,8 @@ -> - - <?php print $head_title ?> - - - - - - +?> - - -
+
@@ -38,39 +23,35 @@
- +
-
+
>
- +
- +
- +
- +
- - - - Index: themes/seven/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/page.tpl.php,v retrieving revision 1.1 diff -u -r1.1 page.tpl.php --- themes/seven/page.tpl.php 31 Jul 2009 19:35:57 -0000 1.1 +++ themes/seven/page.tpl.php 2 Aug 2009 07:57:22 -0000 @@ -1,19 +1,6 @@ -> - - <?php print $head_title; ?> - - - - - - - - +?>
@@ -28,12 +15,12 @@
- +
- +
- +
- - - - - Index: themes/seven/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/template.php,v retrieving revision 1.1 diff -u -r1.1 template.php --- themes/seven/template.php 31 Jul 2009 19:35:57 -0000 1.1 +++ themes/seven/template.php 2 Aug 2009 07:57:22 -0000 @@ -1,13 +1,15 @@ ' . "\n"; +} /** * Override or insert variables into the page template. */ function seven_preprocess_page(&$vars) { $vars['primary_local_tasks'] = menu_primary_local_tasks(); $vars['secondary_local_tasks'] = menu_secondary_local_tasks(); - $vars['ie_styles'] = ''; $vars['back_to_site'] = l(t('Back to the live site'), ''); } Index: modules/toolbar/toolbar.module =================================================================== RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v retrieving revision 1.4 diff -u -r1.4 toolbar.module --- modules/toolbar/toolbar.module 28 Jul 2009 10:35:56 -0000 1.4 +++ modules/toolbar/toolbar.module 2 Aug 2009 07:57:22 -0000 @@ -46,7 +46,7 @@ * * Add some page classes, so global page theming can adjust to the toolbar. */ -function toolbar_preprocess_page(&$vars) { +function toolbar_preprocess_html(&$vars) { if (user_access('access toolbar')) { $vars['classes_array'][] = 'toolbar toolbar-shortcuts'; } Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.351 diff -u -r1.351 block.module --- modules/block/block.module 20 Jul 2009 18:51:32 -0000 1.351 +++ modules/block/block.module 2 Aug 2009 07:57:20 -0000 @@ -243,6 +243,7 @@ foreach (array_keys($all_regions) as $region) { // Prevent left and right regions from rendering blocks when 'show_blocks' == FALSE. if (!empty($page['#show_blocks']) || ($region != 'left' && $region != 'right')) { + $page[$region] = array(); // Assign blocks to region. if ($blocks = block_get_blocks_by_region($region)) { $page[$region] = $blocks; Index: modules/system/html.tpl.php =================================================================== RCS file: modules/system/html.tpl.php diff -N modules/system/html.tpl.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/system/html.tpl.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,49 @@ +language contains its textual representation. + * $language->dir contains the language direction. It will either be 'ltr' or 'rtl'. + * - $rdf_namespaces: All the RDF namespace prefixes used in the HTML document. + * - $grddl_profile: A GRDDL profile allowing agents to extract the RDF data. + * - $head_title: A modified version of the page title, for use in the TITLE tag. + * - $head: Markup for the HEAD section (including meta tags, keyword tags, and + * so on). + * - $styles: Style tags necessary to import all CSS files for the page. + * - $scripts: Script tags necessary to load the JavaScript files and settings + * for the page. + * - $page: The rendered page content. + * - $closure: Final closing markup from any modules that have altered the page. + * This variable should always be output last, after all other dynamic content. + * - $classes String of classes that can be used to style contextually through + * CSS. + * + * @see template_preprocess() + * @see template_preprocess_html() + * @see template_process() + * @see page.tpl.php + */ +?> +> + + + <?php print $head_title; ?> + + + + + + + + + +