? ninesixty-613072.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/ninesixty/README.txt,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 README.txt
--- README.txt	20 Jun 2009 19:25:54 -0000	1.2.2.2
+++ README.txt	20 Apr 2010 22:47:56 -0000
@@ -35,16 +35,22 @@ Modifications:
   coding standards. Tabs were removed for double spaces and underscores
   changed to hyphens.
 
-- Additional .push-x and .pull-x classes have been added.
+- Additional .push-x and .pull-x classes have been added. Note that these
+  classes have been incorporated back into the main 960.gs distribution.
 
 - Right-to-left languages are supported. It's not part of the 960 download.
   It has been extended to support Drupal's rtl language system.
 
-- Removed ".clear-fix" and ".clear" classes from 960.css. Drupal works with
-  ".clear-block" which uses the same technique used in .clear-fix. The .clear
-  class on the other hand is too commonly used as a class name and the
-  properties can cause confusion since anything with that property will
-  disappear. A standard <br /> tag can be used in its place.
+- Altered the ".clear" class from 960.gs. It can now be applied to block level
+  elements that contain child elements. The intended use of the class in 960.gs
+  is to clear floats by applying them to elements which contain no children.
+  The same effect can be accomplished with line-breaks and the .clear class.
+  
+  Example:
+    <br class="clear" />
+  
+  More information about the use of the .clear class can by 960.gs:
+    http://sonspring.com/journal/clearing-floats
 
 - Removed the "outline:0;" rule from reset.css. Adding it back manually
   prevents OS specific outline styles from being used. Specifically Webkit and
@@ -58,16 +64,34 @@ Modifications:
 Notes and rules to play nice with the grids:
 
 - The class .container-[N] ([N] being a numeric value) is a subdivision of the
-  overall width (960 pixels). It can either be .container-12 or .container-16.
-  Depending on which is used, each grid unit (.grid-[N] class) will either be
-  in multiples of 80 pixels for 12 subdivisions or in multiple of 60 pixels for
-  16 subdivisions. All grid blocks include a 10 pixel margin on the left and
-  right side.
-
-- Add a .show-grid class to the body tag to see the grid. It will add a
-  background graphic to guide you. This theme includes a printable sketch
-  sheet and templates for Photoshop and various other formats to guide you
-  from start to finish. See the "extras" folder within this theme.
+  overall width (960 pixels). It can be .container-12, .container-16 or
+  .container-24. Depending on which is used, each grid unit (.grid-[N] class)
+  will be in multiples of 80 pixels for 12 subdivisions, in multiples of 60 pixels
+  for 16 subdivisions or in multiples of 30 pixels for 24 subdivisions. Grid
+  columns include a 10 pixel margin on the left and right side for the 12 and 16
+  columns and 5 pixel margins for the 24 columns.
+
+- You can enable different versions of the grid styles by setting a .info entry.
+  There are four versions.
+  
+  1. 12 and 16 columns (default).
+     settings[960 columns] = 12+16
+
+  2. 12 columns.
+     settings[960 columns] = 12
+
+  3. 16 columns.
+     settings[960 columns] = 16
+
+  4. 24 columns.
+     settings[960 columns] = 24
+
+- NineSixty includes the same printable sketch sheet and templates for
+  Photoshop and various other formats from the 960.gs distribution. See the
+  "extras" folder within this theme. You can also enable a set of debugging
+  styles through the .info file with the following entry.
+  
+    settings[960 debug] = 1
 
 - Do not add left or right margins or padding to anything that's assigned a
   grid class or it may throw off the alignment.
@@ -128,9 +152,6 @@ To-dos:
   classes appropriately. This helper function must be as simple as possible to
   *work with*.
 
-- Separate issue but this can help add grid classes easier.
-  Add $classes to hook templates: http://drupal.org/node/306358
-
 ==============================================================================
 Adding classes based on context:
 
@@ -237,6 +258,5 @@ this issue for more information: http://
 
 ==============================================================================
 
-If you have any questions or suggestions. Please post in the group discussion.
-http://groups.drupal.org/node/16457 or contact me @ joon at dvessel dot com.
-
+If you have any questions or suggestions. Please post in the issue queue for
+NineSixty http://drupal.org/project/ninesixty.
Index: ninesixty.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/ninesixty/ninesixty.info,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 ninesixty.info
--- ninesixty.info	5 Jun 2009 17:52:14 -0000	1.1.2.3
+++ ninesixty.info	20 Apr 2010 22:47:56 -0000
@@ -6,11 +6,31 @@ screenshot = images/screenshot.png
 core = 6.x
 engine = phptemplate
 
-; Stylesheets. Anything within the "framework" folder will be placed before all others.
+; Stylesheets
+; Anything within the "framework" folder will be placed before all others.
 stylesheets[all][] = styles/framework/reset.css
 stylesheets[all][] = styles/framework/text.css
 stylesheets[all][] = styles/framework/960.css
-stylesheets[all][] = styles/framework/debug.css
 
 ; Theme specific styles. Any sub-themes should override this.
 stylesheets[all][] = styles/styles.css
+
+; Do not alter. This is only relevant to NineSixty.
+css grid base           = 960.css
+css grid options[12+16] = 960.css
+css grid options[12]    = 960-12-col.css
+css grid options[16]    = 960-16-col.css
+css grid options[24]    = 960-24-col.css
+
+css grid debug = 960-debug.css
+
+; These settings can be overridden from sub-themes.
+; "960 columns" setting allows the following.
+; - "12+16" combined styles. This is the default.
+; - "12" columns
+; - "16" columns
+; - "24" columns
+settings[960 columns] = 12+16
+
+; Enable/disable debug styles.
+settings[960 debug] = 1
Index: page.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/ninesixty/page.tpl.php,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 page.tpl.php
--- page.tpl.php	24 Feb 2009 15:34:45 -0000	1.1.2.1
+++ page.tpl.php	20 Apr 2010 22:47:56 -0000
@@ -13,10 +13,10 @@
 </head>
 
 <body class="<?php print $body_classes; ?> show-grid">
-  <div id="page" class="container-16 clear-block">
+  <div id="page" class="container-16 clearfix">
 
-    <div id="site-header" class="clear-block">
-      <div id="branding" class="grid-4 clear-block">
+    <div id="site-header" class="clearfix">
+      <div id="branding" class="grid-4 clearfix">
       <?php if ($linked_logo_img): ?>
         <span id="logo" class="grid-1 alpha"><?php print $linked_logo_img; ?></span>
       <?php endif; ?>
@@ -41,7 +41,7 @@
     </div>
 
 
-    <div id="site-subheader" class="prefix-1 suffix-1 clear-block">
+    <div id="site-subheader" class="prefix-1 suffix-1 clearfix">
     <?php if ($mission): ?>
       <div id="mission" class="<?php print ns('grid-14', $header, 7); ?>">
         <?php print $mission; ?>
@@ -49,7 +49,7 @@
     <?php endif; ?>
 
     <?php if ($header): ?>
-      <div id="header-region" class="region <?php print ns('grid-14', $mission, 7); ?> clear-block">
+      <div id="header-region" class="region <?php print ns('grid-14', $mission, 7); ?> clearfix">
         <?php print $header; ?>
       </div>
     <?php endif; ?>
@@ -67,7 +67,7 @@
       <?php print $messages; ?>
       <?php print $help; ?>
 
-      <div id="main-content" class="region clear-block">
+      <div id="main-content" class="region clearfix">
         <?php print $content; ?>
       </div>
 
@@ -87,9 +87,9 @@
   <?php endif; ?>
 
 
-  <div id="footer" class="prefix-1 suffix-1">
+  <div id="footer" class="prefix-1 suffix-1 clear clearfix">
     <?php if ($footer): ?>
-      <div id="footer-region" class="region grid-14 clear-block">
+      <div id="footer-region" class="region grid-14 clearfix">
         <?php print $footer; ?>
       </div>
     <?php endif; ?>
Index: template.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/ninesixty/template.php,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 template.php
--- template.php	18 Jul 2009 17:48:55 -0000	1.1.2.3
+++ template.php	20 Apr 2010 22:47:57 -0000
@@ -14,7 +14,7 @@ function ninesixty_preprocess_page(&$var
   $vars['secondary_menu_links'] = theme('links', $vars['secondary_links'], array('class' => 'links secondary-menu'));
 
   // Make sure framework styles are placed above all others.
-  $vars['css_alt'] = ninesixty_css_reorder($vars['css']);
+  $vars['css_alt'] = ninesixty_css_alter($vars['css']);
   $vars['styles'] = drupal_get_css($vars['css_alt']);
 }
 
@@ -61,49 +61,115 @@ function ns() {
 
 /**
  * This rearranges how the style sheets are included so the framework styles
- * are included first.
+ * are included first. It will also swap out optional grid styles based on the
+ * .info data.
  *
  * Sub-themes can override the framework styles when it contains css files with
  * the same name as a framework style. This can be removed once Drupal supports
  * weighted styles.
  */
-function ninesixty_css_reorder($css) {
-  global $theme_info, $base_theme_info;
+function ninesixty_css_alter($css) {
 
-  // Dig into the framework .info data.
-  $framework = !empty($base_theme_info) ? $base_theme_info[0]->info : $theme_info->info;
-
-  // Pull framework styles from the themes .info file and place them above all stylesheets.
-  if (isset($framework['stylesheets'])) {
-    foreach ($framework['stylesheets'] as $media => $styles_from_960) {
-      // Setup framework group.
-      if (isset($css[$media])) {
-        $css[$media] = array_merge(array('framework' => array()), $css[$media]);
-      }
-      else {
-        $css[$media]['framework'] = array();
-      }
-      foreach ($styles_from_960 as $style_from_960) {
-        // Force framework styles to come first.
-        if (strpos($style_from_960, 'framework') !== FALSE) {
-          $framework_shift = $style_from_960;
-          $remove_styles = array($style_from_960);
-          // Handle styles that may be overridden from sub-themes.
-          foreach ($css[$media]['theme'] as $style_from_var => $preprocess) {
-            if ($style_from_960 != $style_from_var && basename($style_from_960) == basename($style_from_var)) {
-              $framework_shift = $style_from_var;
-              $remove_styles[] = $style_from_var;
-              break;
-            }
-          }
-          $css[$media]['framework'][$framework_shift] = TRUE;
-          foreach ($remove_styles as $remove_style) {
-            unset($css[$media]['theme'][$remove_style]);
+  $grid_base    = ninesixty_theme_info('css grid base', '960.css', 'ninesixty');
+  $grid_options = ninesixty_theme_info('css grid options', array(), 'ninesixty');
+  $column_setting = ninesixty_setting('960 columns', '12+16');
+  $debug_setting  = ninesixty_setting('960 debug');
+  $debug_style    = ninesixty_theme_info('css grid debug', '960-debug.css', 'ninesixty');
+
+  // Pull NineSixty styles to determin all framework styles.
+  // This will be used to force early loading by placing them above all stylesheets.
+  foreach (ninesixty_theme_info('stylesheets', array(), 'ninesixty') as $media => $styles_from_960) {
+    // Setup framework group.
+    if (isset($css[$media])) {
+      $css[$media] = array_merge(array('framework' => array()), $css[$media]);
+    }
+    else {
+      $css[$media]['framework'] = array();
+    }
+    foreach ($styles_from_960 as $style_from_960) {
+      // Force framework styles to come first.
+      if (strpos($style_from_960, 'framework') !== FALSE) {
+        $framework_shift = $style_from_960;
+        $remove_styles = array($style_from_960);
+        // Handle styles that may be overridden from sub-themes.
+        foreach ($css[$media]['theme'] as $style_from_var => $preprocess) {
+          if ($style_from_960 != $style_from_var && basename($style_from_960) == basename($style_from_var)) {
+            $framework_shift = $style_from_var;
+            $remove_styles[] = $style_from_var;
+            break;
           }
         }
+        // Swap with optional grid styles.
+        if (basename($framework_shift) == $grid_base && isset($grid_options[$column_setting])) {
+          $framework_shift = str_replace($grid_base, $grid_options[$column_setting], $framework_shift);
+        }
+        $css[$media]['framework'][$framework_shift] = TRUE;
+        // Add in debug style.
+        if (basename($framework_shift) == $grid_base && $debug_setting == '1') {
+          $css[$media]['framework'][str_replace($grid_base, $debug_style, $framework_shift)] = TRUE;
+        }
+        foreach ($remove_styles as $remove_style) {
+          unset($css[$media]['theme'][$remove_style]);
+        }
       }
     }
   }
 
   return $css;
 }
+
+/**
+ * Pulls theme settings through core's theme_get_setting and falls back to the
+ * 'settings' key found within the active themes .info file. An optional
+ * default can be passed in case no value is found.
+ */
+function ninesixty_setting($setting_key, $default = NULL) {
+  // Core's settings api.
+  $theme_setting = theme_get_setting($setting_key);
+
+  if (!isset($theme_setting)) {
+    // Fallback to the active theme's .info.
+    $info_settings = ninesixty_theme_info('settings', array());
+    if (isset($info_settings[$setting_key])) {
+      // Check for specific setting.
+      // .info setting key = setting[SETTING_KEY] = ...
+      $theme_setting = $info_settings[$setting_key];
+    }
+  }
+
+  return isset($theme_setting) ? $theme_setting : $default;
+}
+
+/**
+ * Get the values defined within the .info file.
+ * 
+ * @param $info_key
+ *  (required) The key to retrieve.
+ * @param $default
+ *  Fall back value if nothing is found.
+ * @param $theme
+ *  Theme specific value. If not set, it will return the value for the active
+ *  theme.
+ */
+function ninesixty_theme_info($info_key, $default = NULL, $theme = NULL) {
+  global $theme_key, $theme_info, $base_theme_info;
+
+  if (!isset($theme)) {
+    $theme = $theme_key;
+  }
+
+  $theme_info_data = array();
+  if ($theme == $theme_info->name) {
+    $theme_info_data = $theme_info->info;
+  }
+  else {
+    foreach ($base_theme_info as $base_info) {
+      if ($theme == $base_info->name) {
+        $theme_info_data = $base_info->info;
+        break;
+      }
+    }
+  }
+
+  return isset($theme_info_data[$info_key]) ? $theme_info_data[$info_key] : $default;
+}
Index: styles/framework/960-rtl.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/ninesixty/styles/framework/960-rtl.css,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 960-rtl.css
--- styles/framework/960-rtl.css	20 Jun 2009 19:25:54 -0000	1.1.2.1
+++ styles/framework/960-rtl.css	20 Apr 2010 22:47:57 -0000
@@ -29,9 +29,14 @@
 /* `Grid >> Children (Alpha ~ First, Omega ~ Last)
 ----------------------------------------------------------------------------------------------------*/
 
+/* A more specific selector used in case .alpha and .omega is appled to the same block. */
+.container-12 .alpha,
+.container-16 .alpha {
+  margin-right: 0;
+}
+
 .alpha {
   margin-left: 10px;
-  margin-right: 0;
 }
 
 .omega {
@@ -514,4 +519,4 @@
 
 .container-16 .pull-15 {
   right: -900px;
-}
+}
\ No newline at end of file
Index: styles/framework/960.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/ninesixty/styles/framework/960.css,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 960.css
--- styles/framework/960.css	20 Jun 2009 19:25:54 -0000	1.1.2.1
+++ styles/framework/960.css	20 Apr 2010 22:47:57 -0000
@@ -40,11 +40,28 @@
 .grid-16 {
   display: inline;
   float: left;
-  position: relative;
   margin-left: 10px;
   margin-right: 10px;
 }
 
+.push-1, .pull-1,
+.push-2, .pull-2,
+.push-3, .pull-3,
+.push-4, .pull-4,
+.push-5, .pull-5,
+.push-6, .pull-6,
+.push-7, .pull-7,
+.push-8, .pull-8,
+.push-9, .pull-9,
+.push-10, .pull-10,
+.push-11, .pull-11,
+.push-12, .pull-12,
+.push-13, .pull-13,
+.push-14, .pull-14,
+.push-15, .pull-15 {
+  position: relative;
+}
+
 .container-12 .grid-3,
 .container-16 .grid-4 {
   width: 220px;
@@ -577,3 +594,37 @@
 .container-16 .pull-15 {
   left: -900px;
 }
+
+/* `Clear Floated Elements
+----------------------------------------------------------------------------------------------------*/
+
+.clear {
+  clear: both;
+}
+
+br.clear {
+  line-height: 0;
+}
+
+/* http://perishablepress.com/press/2009/12/06/new-clearfix-hack */
+/* Drupal core uses .clear-block for the same purpose. */
+
+.clearfix:after {
+  clear: both;
+  content: ' ';
+  display: block;
+  font-size: 0;
+  line-height: 0;
+  visibility: hidden;
+  width: 0;
+  height: 0;
+}
+
+/*
+  The following zoom:1 rule is specifically for IE6 + IE7.
+  Move to separate stylesheet if invalid CSS is a problem.
+*/
+* html .clearfix,
+*:first-child+html .clearfix {
+  zoom: 1;
+}
\ No newline at end of file
