Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.785
diff -u -r1.785 system.module
--- modules/system/system.module 5 Sep 2009 15:05:04 -0000 1.785
+++ modules/system/system.module 6 Sep 2009 19:29:45 -0000
@@ -292,6 +292,7 @@
$type['page'] = array(
'#show_messages' => TRUE,
'#theme' => 'page',
+ '#theme_wrappers' => array('html'),
);
$type['list'] = array(
Index: modules/system/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/page.tpl.php,v
retrieving revision 1.32
diff -u -r1.32 page.tpl.php
--- modules/system/page.tpl.php 31 Aug 2009 19:50:18 -0000 1.32
+++ modules/system/page.tpl.php 6 Sep 2009 19:29:41 -0000
@@ -10,48 +10,12 @@
* 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
- * into a string within the variable $classes.
* - $is_front: TRUE if the current page is the front page. Used to toggle the mission statement.
* - $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 'sidebar_first' and 'sidebar_second' block regions:
- * - two-sidebars: When both sidebars have content.
- * - no-sidebars: When no sidebar content exists.
- * - one-sidebar and sidebar-first or sidebar-second: 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.
@@ -72,45 +36,37 @@
* administration interface.
*
* Page content (in order of occurrence in the default page.tpl.php):
+ * - $classes String of classes that can be used to style contextually through
+ * CSS.
* - $title: The page title, for use in the actual HTML content.
* - $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.
- * - $sidebar_first: Items for the first sidebar.
- * - $sidebar_second: Items for the second sidebar.
- * - $highlight: Items for the highlighted content region.
*
- * Opening and closing data:
- * - $page_top: Initial markup from any modules that have altered the
+ * Regions:
+ * - $page['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['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['sidebar_first']: Items for the first sidebar.
+ * - $page['sidebar_second']: Items for the second sidebar.
+ * - $page['header']: Items for the header region.
+ * - $page['footer']: Items for the footer region.
+ * - $page['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.
- *
+ *
* @see template_preprocess()
* @see template_preprocess_page()
* @see template_process()
*/
?>
-
->
-
-
-
-
-
-
-
-
+
@@ -146,9 +102,9 @@
-
+
-
+
@@ -169,26 +125,26 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -196,12 +152,15 @@
-
+
-
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.984
diff -u -r1.984 common.inc
--- includes/common.inc 5 Sep 2009 15:05:01 -0000 1.984
+++ includes/common.inc 6 Sep 2009 19:29:39 -0000
@@ -3127,7 +3127,7 @@
// Allow modules to alter the JavaScript.
drupal_alter('js', $javascript);
-
+print_r ($javascript);
// Filter out elements of the given scope.
$items = array();
foreach ($javascript as $item) {
@@ -4541,6 +4541,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.519
diff -u -r1.519 theme.inc
--- includes/theme.inc 31 Aug 2009 19:50:17 -0000 1.519
+++ includes/theme.inc 6 Sep 2009 19:29:40 -0000
@@ -2016,6 +2016,48 @@
}
/**
+ * Preprocess variables for html.tpl.php
+ *
+ * @see system_elements()
+ * @see html.tpl.php
+ */
+function template_preprocess_html(&$variables) {
+
+ // 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 = theme_get_setting('favicon_mimetype');
+ 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);
+
+ // Populate the page template suggestions.
+ if ($suggestions = template_page_suggestions(arg(), 'html')) {
+ $variables['template_files'] = $suggestions;
+ }
+}
+
+/**
* Preprocess variables for page.tpl.php
*
* Most themes utilize their own copy of page.tpl.php. The default is located
@@ -2036,33 +2078,21 @@
// Move some variables to the top level for themer convenience and template cleanliness.
$variables['show_messages'] = $variables['page']['#show_messages'];
- // Add favicon.
- if (theme_get_setting('toggle_favicon')) {
- $favicon = theme_get_setting('favicon');
- $type = theme_get_setting('favicon_mimetype');
- drupal_add_html_head('');
- }
-
// Set up layout variable.
$variables['layout'] = 'none';
if (!empty($variables['page']['sidebar_first'])) {
$variables['layout'] = 'first';
}
+ else {
+ $variables['page']['sidebar_first'] = array();
+ }
if (!empty($variables['page']['sidebar_second'])) {
$variables['layout'] = ($variables['layout'] == 'first') ? 'both' : 'second';
}
-
- // 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['page']['sidebar_second'] = array();
}
- $variables['head_title'] = implode(' | ', $head_title);
+
$variables['base_path'] = base_path();
$variables['front_page'] = url();
$variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb());
@@ -2079,11 +2109,6 @@
$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;
@@ -2097,7 +2122,7 @@
$variables['classes_array'][] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in';
// Populate the page template suggestions.
- if ($suggestions = template_page_suggestions(arg())) {
+ if ($suggestions = template_page_suggestions(arg(), 'page')) {
$variables['template_files'] = $suggestions;
foreach ($suggestions as $suggestion) {
if ($suggestion != 'page-front') {
@@ -2126,23 +2151,20 @@
$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]);
- }
- // Append javascript to $page_bottom
- $variables['page_bottom'] .= drupal_get_js('footer');
+function template_process_html(&$variables) {
+ // Place the rendered HTML for the page body into a top level variable.
+ $variables['page'] = $variables['page']['#children'];
$variables['head'] = drupal_get_html_head();
$variables['css'] = drupal_add_css();
@@ -2151,6 +2173,16 @@
}
/**
+ * Process variables for page.tpl.php.
+ *
+ * @see template_preprocess_page()
+ * @see page.tpl.php
+ */
+function template_process_page(&$variables) {
+ $variables['page_bottom']['#children'] = drupal_get_js('footer');
+}
+
+/**
* Generate an array of page template suggestions.
*
* @param $args
@@ -2159,7 +2191,7 @@
* @return
* An array of suggested template files.
*/
-function template_page_suggestions($args) {
+function template_page_suggestions($args, $suggestion) {
// Build a list of suggested template files and body classes in order of
// specificity. One suggestion is made for every element of the current path,
@@ -2172,7 +2204,6 @@
// page-node.tpl.php page-node
// page.tpl.php
- $suggestion = 'page';
$suggestions = array();
foreach ($args as $arg) {
// Remove slashes or null per SA-CORE-2009-003.
@@ -2188,7 +2219,7 @@
}
}
if (drupal_is_front_page()) {
- $suggestions[] = 'page-front';
+ $suggestions[] = $suggestion . '-front';
}
return $suggestions;
Index: themes/garland/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/template.php,v
retrieving revision 1.29
diff -u -r1.29 template.php
--- themes/garland/template.php 1 Sep 2009 20:39:55 -0000 1.29
+++ themes/garland/template.php 6 Sep 2009 19:29:46 -0000
@@ -15,6 +15,17 @@
}
/**
+ * 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);
+ }
+ $vars['styles'] .= "\n\n";
+}
+
+/**
* Override or insert variables into the page template.
*/
function garland_preprocess_page(&$vars) {
@@ -49,7 +60,6 @@
else {
$vars['secondary_nav'] = FALSE;
}
- $vars['ie_styles'] = garland_get_ie_styles();
// Prepare header
$site_fields = array();
@@ -68,7 +78,7 @@
}
/**
- * Override process function used to alter variables as late as possible.
+ * Override or insert variables into the page template.
*/
function garland_process_page(&$vars) {
// Hook into color.module
Index: themes/garland/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/page.tpl.php,v
retrieving revision 1.32
diff -u -r1.32 page.tpl.php
--- themes/garland/page.tpl.php 22 Aug 2009 19:58:28 -0000 1.32
+++ themes/garland/page.tpl.php 6 Sep 2009 19:29:45 -0000
@@ -1,23 +1,11 @@
->
-
-
-
-
-
-
-
-
+?>
+
-
+
-
+