? row_groups_wrapper.patch
Index: semanticviews-view-unformatted.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/semanticviews/Attic/semanticviews-view-unformatted.tpl.php,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 semanticviews-view-unformatted.tpl.php
--- semanticviews-view-unformatted.tpl.php	19 Sep 2009 22:33:48 -0000	1.1.2.3
+++ semanticviews-view-unformatted.tpl.php	15 Jul 2010 18:25:08 -0000
@@ -16,6 +16,9 @@
   <<?php print $list_element; ?><?php print drupal_attributes($list_attributes); ?>>
 <?php endif; ?>
 <?php foreach ($rows as $id => $row): ?>
+  <?php if($row_wrappers[$id]['wrapper_start']): ?>
+    <?php print '<div class="'. $wrapper_class .'">'; ?>
+  <?php endif; ?>
   <?php if (!empty($row_element)): ?>
   <<?php print $row_element; ?><?php print drupal_attributes($row_attributes[$id]); ?>>
   <?php endif; ?>
@@ -23,6 +26,9 @@
   <?php if (!empty($row_element)): ?>
   </<?php print $row_element; ?>>
   <?php endif; ?>
+  <?php if($row_wrappers[$id]['wrapper_end']): ?>
+    <?php print '</div>'; ?>
+  <?php endif; ?>
 <?php endforeach; ?>
 <?php if (!empty($list_element)): ?>
   </<?php print $list_element; ?>>
Index: semanticviews.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/semanticviews/Attic/semanticviews.theme.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 semanticviews.theme.inc
--- semanticviews.theme.inc	10 Apr 2010 04:07:25 -0000	1.1.2.1
+++ semanticviews.theme.inc	15 Jul 2010 18:25:08 -0000
@@ -88,19 +88,36 @@ function template_preprocess_semanticvie
 
   // Get alias tokens.
   $tokens = semanticviews_get_alias_tokens($view);
-
+  
+  
+  // set wrapper class on row if it's defined
+  // determine the $id of the last row
+  if($vars['options']['row']['wrapper_class']){
+    $vars['wrapper_class'] = $vars['options']['row']['wrapper_class'];
+    $last_id = NULL;
+    foreach ($vars['rows'] as $id => $row){
+      $last_id = $id;
+    } 
+  }  
   foreach ($vars['rows'] as $id => $row) {
+    // set wrapper variables to NULL
+    $wrapper_start = NULL;
+    $wrapper_end = NULL;
+    
     // Get token replacements.
     $replacements = semanticviews_get_token_replacements($view->result[$id], $tokens);
     // Add replacement for the row number.
     $replacements['#'] = $id;
 
+    $vars['row_wrappers'][$id] = array();
     $vars['row_attributes'][$id] = array();
     $classes = array();
     if ($vars['options']['row']['class']) {
       $classes[] = strtr($vars['options']['row']['class'], $replacements);
     }
+    
     if ($vars['options']['row']['first_class']) {
+      
       // The FIRST class attribute can be used in two ways. When the "last every
       // nth" option is specified, the FIRST attribute is added to the class in
       // those intervals. This could be useful for grid designs where the first
@@ -110,9 +127,14 @@ function template_preprocess_semanticvie
          // to the first row in the pager set.
          (!$last_every_nth && $id == 0)) {
         $classes[] = strtr($vars['options']['row']['first_class'], $replacements);
+        if($vars['wrapper_class']){
+          // set start wrapper if this is the first item
+          $wrapper_start = TRUE;
+        }
       }
     }
     if ($vars['options']['row']['last_class']) {
+      
       // The LAST class attribute can be used in two ways. When the "last every
       // nth" option is specified, the LAST attribute is added to the class in
       // those intervals. This could be useful for grid designs where the last
@@ -122,6 +144,16 @@ function template_preprocess_semanticvie
          // to the last row in the pager set.
          (!$last_every_nth && ($id + 1) == count($vars['rows']))) {
         $classes[] = strtr($vars['options']['row']['last_class'], $replacements);
+        if($vars['wrapper_class']){
+          // set end wrapper if this is the last item
+          $wrapper_end = TRUE;
+        }
+      } else if($id == $last_id){
+        // if the last row in the view isn't also the last in a full row, 
+        if($vars['wrapper_class']){
+          // set end wrapper
+          $wrapper_end = TRUE;
+        }
       }
     }
 
@@ -132,5 +164,11 @@ function template_preprocess_semanticvie
     if (!empty($classes)) {
       $vars['row_attributes'][$id]['class'] = implode(' ', $classes);
     }
+    
+    if($vars['wrapper_class']){
+      // set wrapper variales to the row
+      $vars['row_wrappers'][$id]['wrapper_start'] = $wrapper_start;
+      $vars['row_wrappers'][$id]['wrapper_end'] = $wrapper_end;
+    }
   }
 }
Index: semanticviews_plugin_style_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/semanticviews/Attic/semanticviews_plugin_style_default.inc,v
retrieving revision 1.1.2.14
diff -u -p -r1.1.2.14 semanticviews_plugin_style_default.inc
--- semanticviews_plugin_style_default.inc	31 Mar 2010 21:41:55 -0000	1.1.2.14
+++ semanticviews_plugin_style_default.inc	15 Jul 2010 18:25:08 -0000
@@ -48,6 +48,7 @@ class semanticviews_plugin_style_default
         'first_class' => array('default' => 'first'),
         'last_class' => array('default' => 'last'),
         'last_every_nth' => array('default' => '0'),
+        'wrapper_class' => array('default' => ''),
         'striping_classes' => array('default' => 'odd even'),
       ),
     );
@@ -183,6 +184,13 @@ class semanticviews_plugin_style_default
       '#size' => '30',
       '#default_value' => $this->options['row']['last_class'],
     );
+    $form['row']['first_last']['wrapper_class'] = array(
+      '#title' => t('Wrapper class attribute'),
+      '#type' => 'textfield',
+      '#size' => '10',
+      '#default_value' => $this->options['row']['wrapper_class'],
+      '#description' => t('Set this value if you want to wrap each group in a div.'),
+    );
 
     // Striping class options.
     $form['row']['striping_classes'] = array(
