Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.675
diff -u -F^f -r1.675 common.inc
--- includes/common.inc	29 Jul 2007 17:28:23 -0000	1.675
+++ includes/common.inc	2 Aug 2007 00:02:33 -0000
@@ -2650,10 +2650,6 @@ function drupal_common_themes() {
     'help' => array(
       'arguments' => array(),
     ),
-    'node' => array(
-      'arguments' => array('node' => NULL, 'teaser' => FALSE, 'page' => FALSE),
-      'file' => 'node',
-    ),
     'submenu' => array(
       'arguments' => array('links' => NULL),
     ),
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.364
diff -u -F^f -r1.364 theme.inc
--- includes/theme.inc	18 Jul 2007 07:05:49 -0000	1.364
+++ includes/theme.inc	2 Aug 2007 00:02:34 -0000
@@ -225,7 +225,6 @@ function _theme_process_registry(&$cache
   $function = $name .'_theme';
   if (function_exists($function)) {
     $result = $function($cache, $type, $theme, $path);
-
     foreach ($result as $hook => $info) {
       $result[$hook]['type'] = $type;
       $result[$hook]['theme path'] = $path;
@@ -1611,6 +1610,7 @@ function template_preprocess_page(&$vari
   $variables['layout'] = $layout;
 
   global $theme;
+  global $user;
   // Populate the rest of the regions.
   $regions = system_region_list($theme);
   // Load all region content assigned via blocks.
@@ -1660,6 +1660,38 @@ function template_preprocess_page(&$vari
   if ((arg(0) == 'node') && is_numeric(arg(1))) {
     $variables['node'] = node_load(arg(1));
   }
+  
+  // 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.).
+  $body_classes = array();
+  // Add a class that tells us whether we're on the front page or not.
+  $body_classes[] = (drupal_is_front_page()) ? 'front' : 'not-front';
+  // Add a class that tells us whether the page is viewed by an authenticated user or not.
+  $body_classes[] = ($user->uid > 0) ? 'logged-in' : 'not-logged-in';
+  // Add arg(0) to make it possible to theme the page depending on the current page
+  // type (e.g. node, admin, user, etc.). 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).
+  $body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-' . form_clean_id(drupal_strtolower(arg(0))));
+  // If on an individual node page, add the node type.
+  if (isset($variables['node']) && $variables['node']->type) {
+    $body_classes[] = 'node-type-'. form_clean_id($variables['node']->type);
+  }
+  // Add information about the number of sidebars.
+  if ($variables['sidebar_left'] && $variables['sidebar_right']) {
+    $body_classes[] = 'two-sidebars sidebar-left sidebar-right';
+  }
+  elseif ($variables['sidebar_left']) {
+    $body_classes[] = 'one-sidebar sidebar-left';
+  }
+  elseif ($variables['sidebar_right']) {
+    $body_classes[] = 'one-sidebar sidebar-right';
+  }
+  else {
+    $body_classes[] = 'no-sidebars';
+  }
+  // Implode with spaces.
+  $variables['body_classes'] = implode(' ', $body_classes);
 
   // Build a list of suggested template files in order of specificity. One
   // suggestion is made for every element of the current path, though
Index: modules/system/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/page.tpl.php,v
retrieving revision 1.2
diff -u -F^f -r1.2 page.tpl.php
--- modules/system/page.tpl.php	4 May 2007 09:41:36 -0000	1.2
+++ modules/system/page.tpl.php	2 Aug 2007 00:02:34 -0000
@@ -1,60 +1,111 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>">
 
 <head>
-  <title><?php print $head_title ?></title>
-  <?php print $head ?>
-  <?php print $styles ?>
-  <?php print $scripts ?>
-  <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>
+  <title><?php print $head_title; ?></title>
+  <?php print $head; ?>
+  <?php print $styles; ?>
+  <?php print $scripts; ?>
+  <script type="text/javascript"> </script> <?php // <-- Prevent flash of unstyled content (FOUC). ?>
 </head>
+<body class="<?php print $body_classes; // <-- Lots of classes for contextual CSS. ?>">
+  <div id="page">
+    <div id="header">
+      <div id="logo-title">
+      
+        <?php if ($logo): ?>
+          <a href="<?php print $base_path; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
+            <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
+          </a>
+        <?php endif; ?>
+        
+        <div id="name-and-slogan">
+          <?php if ($site_name): ?>
+            <h1 id='site-name'>
+              <a href="<?php print $base_path ?>" title="<?php print t('Home'); ?>" rel="home">
+                <span><?php print $site_name; ?></span>
+              </a>
+            </h1>
+          <?php endif; ?>
+          
+          <?php if ($site_slogan): ?>
+            <div id='site-slogan'>
+              <?php print $site_slogan; ?>
+            </div>
+          <?php endif; ?>
+        </div> <!-- /name-and-slogan -->
+        
+      </div> <!-- /logo-title -->
+      
+      <?php if ($search_box): ?>
+        <div id='search-box'><?php print $search_box; ?></div>
+      <?php endif; ?>
+     
+      <div id="navigation" class="menu <?php if ($primary_links) { print "withprimary"; } if ($secondary_links) { print " withsecondary"; } ?> ">
+          <?php if ($primary_links): ?>
+            <div id="primary" class="clear-block">
+              <?php print theme('menu_links', $primary_links); ?>
+            </div>
+          <?php endif; ?>
+          
+          <?php if ($secondary_links): ?>
+            <div id="secondary" class="clear-block">
+              <?php print theme('menu_links', $secondary_links); ?>
+            </div>
+          <?php endif; ?>
+      </div> <!-- /navigation -->
+      
+      <?php if (!empty($header)): ?>
+        <div id="header-region">
+          <?php print $header; ?>
+        </div>
+      <?php endif; ?>
+      
+    </div> <!-- /header -->
 
-<body>
+    <div id="container" class="clear-block">
+                  
+      <?php if (!empty($sidebar_left)): ?>
+        <div id="sidebar-left" class="column sidebar">
+          <?php print $sidebar_left; ?>
+        </div> <!-- /sidebar-left -->
+      <?php endif; ?>
+    
+      <div id="main" class="column"><div id="main-squeeze">
+        <?php if ($breadcrumb): ?><div id="breadcrumb"><?php print $breadcrumb; ?></div><?php endif; ?>
+        <?php if ($mission): ?><div id="mission"><?php print $mission; ?></div><?php endif; ?>
+        
+        <div id="content">
+          <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
+          <?php if ($tabs): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
+          <?php print $messages; ?>
+          <?php print $help; ?>
+          <div id="content-content" class="clear-block">
+            <?php print $content; ?>
+          </div> <!-- /content-content -->
+          <?php print $feed_icons; ?>
+        </div> <!-- /content -->
+
+      </div></div> <!-- /main-squeeze /main -->
+
+      <?php if (!empty($sidebar_right)): ?>
+        <div id="sidebar-right" class="column sidebar">
+          <?php print $sidebar_right; ?>
+        </div> <!-- /sidebar-right -->
+      <?php endif; ?>
+
+    </div> <!-- /container -->
+
+    <div id="footer-wrapper">
+      <div id="footer">
+        <?php print $footer_message; ?>
+      </div> <!-- /footer -->
+    </div> <!-- /footer-wrapper -->
+    
+    <?php print $closure; ?>
+    
+  </div> <!-- /page -->
 
-<table border="0" cellpadding="0" cellspacing="0" id="header">
-  <tr>
-    <td id="logo">
-      <?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?>
-      <?php if ($site_name) { ?><h1 class='site-name'><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a></h1><?php } ?>
-      <?php if ($site_slogan) { ?><div class='site-slogan'><?php print $site_slogan ?></div><?php } ?>
-    </td>
-    <td id="menu">
-      <?php if (isset($secondary_links)) { ?><?php print theme('links', $secondary_links, array('class' =>'links', 'id' => 'subnavlist')) ?><?php } ?>
-      <?php if (isset($primary_links)) { ?><?php print theme('links', $primary_links, array('class' =>'links', 'id' => 'navlist')) ?><?php } ?>
-      <?php print $search_box ?>
-    </td>
-  </tr>
-  <tr>
-    <td colspan="2"><div><?php print $header ?></div></td>
-  </tr>
-</table>
-
-<table border="0" cellpadding="0" cellspacing="0" id="content">
-  <tr>
-    <?php if ($sidebar_left) { ?><td id="sidebar-left">
-      <?php print $sidebar_left ?>
-    </td><?php } ?>
-    <td valign="top">
-      <?php if ($mission) { ?><div id="mission"><?php print $mission ?></div><?php } ?>
-      <div id="main">
-        <?php print $breadcrumb ?>
-        <h1 class="title"><?php print $title ?></h1>
-        <div class="tabs"><?php print $tabs ?></div>
-        <?php print $help ?>
-        <?php if ($show_messages) { print $messages; }?>
-        <?php print $content; ?>
-        <?php print $feed_icons; ?>
-      </div>
-    </td>
-    <?php if ($sidebar_right) { ?><td id="sidebar-right">
-      <?php print $sidebar_right ?>
-    </td><?php } ?>
-  </tr>
-</table>
-
-<div id="footer">
-  <?php print $footer_message ?>
-</div>
-<?php print $closure ?>
 </body>
-</html>
+</html>
\ No newline at end of file
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.66
diff -u -F^f -r1.66 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	3 Jul 2007 18:48:41 -0000	1.66
+++ themes/engines/phptemplate/phptemplate.engine	2 Aug 2007 00:02:34 -0000
@@ -36,8 +36,9 @@ function phptemplate_theme($existing, $t
  *   The name of the theme function being executed.
  */
 function phptemplate_engine_preprocess(&$variables, $hook) {
+  global $user;
   static $count = array();
-
+  
   // Create variables so anything which is themed can be zebra striped automatically.
   $count[$hook] = isset($count[$hook]) && is_int($count[$hook]) ? $count[$hook] : 1;
   $variables['zebra'] = ($count[$hook] % 2) ? 'odd' : 'even';
@@ -46,4 +47,7 @@ function phptemplate_engine_preprocess(&
   // Tell all templates where they are located.
   $variables['directory'] = path_to_theme();
   $variables['is_front'] = drupal_is_front_page();
+  // Tell all templates by which kind of user they're viewed.
+  $variables['logged_in'] = ($user->uid > 0);
+  $variables['is_admin'] = user_access('access administration pages');
 }
