Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.928 diff -u -p -r1.928 common.inc --- includes/common.inc 3 Jul 2009 19:21:54 -0000 1.928 +++ includes/common.inc 4 Jul 2009 00:48:22 -0000 @@ -3932,6 +3932,10 @@ function drupal_common_theme() { '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.497 diff -u -p -r1.497 theme.inc --- includes/theme.inc 2 Jul 2009 04:27:22 -0000 1.497 +++ includes/theme.inc 4 Jul 2009 00:48:22 -0000 @@ -1878,6 +1878,49 @@ function template_process(&$variables, $ } /** + * Preprocess variables for html.tpl.php + * + * @see system_elements() + * @see html.tpl.php + */ +function template_preprocess_html(&$variables) { + // Place the rendered HTML for the page body into a top level variable. + $variables['page'] = $variables['page']['#children']; + // 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); + // Closure should be filled last. + $variables['closure'] = theme('closure'); +} + +/** * Preprocess variables for page.tpl.php * * Most themes utilize their own copy of page.tpl.php. The default is located @@ -1899,17 +1942,6 @@ function template_preprocess_page(&$vari $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'])) { @@ -1919,23 +1951,10 @@ function template_preprocess_page(&$vari $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(); @@ -1945,13 +1964,6 @@ function template_preprocess_page(&$vari $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/'; - // Closure should be filled last. - $variables['closure'] = theme('closure'); if ($node = menu_get_object()) { $variables['node'] = $node; @@ -2009,7 +2021,18 @@ function template_process_page(&$variabl foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) { $variables[$region_key] = drupal_render($variables['page'][$region_key]); } +} +/** + * Process variables for html.tpl.php + * + * Perform final addition and modification of variables before passing into + * the template. + * + * @see template_preprocess_html() + * @see html.tpl.php + */ +function template_process_html(&$variables) { $variables['head'] = drupal_get_html_head(); $variables['css'] = drupal_add_css(); $variables['styles'] = drupal_get_css(); 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 4 Jul 2009 00:49:39 -0000 @@ -0,0 +1,44 @@ +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. + * + */ +?> + + +> + +
+