Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.560
diff -u -F^f -r1.560 common.inc
--- includes/common.inc 22 Aug 2006 11:13:03 -0000 1.560
+++ includes/common.inc 23 Aug 2006 04:12:15 -0000
@@ -305,7 +305,8 @@ function drupal_not_found() {
if (empty($return)) {
drupal_set_title(t('Page not found'));
}
- print theme('page', $return);
+ // To conserve CPU and bandwidth, omit the blocks
+ print theme('page', $return, FALSE);
}
/**
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.48
diff -u -F^f -r1.48 chameleon.theme
--- themes/chameleon/chameleon.theme 22 Aug 2006 09:00:31 -0000 1.48
+++ themes/chameleon/chameleon.theme 23 Aug 2006 04:12:15 -0000
@@ -3,7 +3,7 @@
/**
* @file
- * A slim, CSS-driven theme.
+ * A slim, CSS-driven theme which does not depend on a template engine like phptemplate
*/
function chameleon_features() {
@@ -21,7 +21,7 @@ function chameleon_regions() {
);
}
-function chameleon_page($content) {
+function chameleon_page($content, $show_blocks = TRUE) {
$language = $GLOBALS['locale'];
if (theme_get_setting('toggle_favicon')) {
@@ -71,8 +71,10 @@ function chameleon_page($content) {
$output .= "
\n";
$output .= " \n";
- if ($blocks = theme_blocks("left")) {
- $output .= " \n";
+ if ($show_blocks) {
+ if ($blocks = theme_blocks("left")) {
+ $output .= " \n";
+ }
}
$output .= " \n";
@@ -100,8 +102,10 @@ function chameleon_page($content) {
$output .= " | \n";
- if ($blocks = theme_blocks("right")) {
- $output .= " \n";
+ if ($show_blocks) {
+ if ($blocks = theme_blocks("right")) {
+ $output .= " \n";
+ }
}
$output .= "
\n";
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.44
diff -u -F^f -r1.44 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine 22 Aug 2006 09:00:31 -0000 1.44
+++ themes/engines/phptemplate/phptemplate.engine 23 Aug 2006 04:12:15 -0000
@@ -147,7 +147,7 @@ function phptemplate_features() {
* generate a series of page template files suggestions based on the
* current path. If none are found, the default page.tpl.php is used.
*/
-function phptemplate_page($content) {
+function phptemplate_page($content, $show_blocks = TRUE) {
/* Set title and breadcrumb to declared values */
if (drupal_is_front_page()) {
@@ -162,23 +162,27 @@ function phptemplate_page($content) {
/**
* Populate sidebars.
*/
- $layout = 'none';
- global $sidebar_indicator;
- /**
- * Sidebar_indicator tells the block counting code to count sidebars separately.
- */
- $sidebar_indicator = 'left';
- $sidebar_left = theme('blocks', 'left');
- if ($sidebar_left != '') {
- $layout = 'left';
- }
+ if ($show_blocks) {
+ global $sidebar_indicator;
+ /**
+ * Sidebar_indicator tells the block counting code to count sidebars separately.
+ */
+ $sidebar_indicator = 'left';
+ $sidebar_left = theme('blocks', 'left');
+ if ($sidebar_left != '') {
+ $layout = 'left';
+ }
- $sidebar_indicator = 'right';
- $sidebar_right = theme('blocks', 'right');
- if ($sidebar_right != '') {
- $layout = ($layout == 'left') ? 'both' : 'right';
+ $sidebar_indicator = 'right';
+ $sidebar_right = theme('blocks', 'right');
+ if ($sidebar_right != '') {
+ $layout = ($layout == 'left') ? 'both' : 'right';
+ }
+ $sidebar_indicator = NULL;
+ }
+ else {
+ $layout = 'none';
}
- $sidebar_indicator = NULL;
// Construct page title
if (drupal_get_title()) {