? theme/.DS_Store
Index: includes/plugins.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/plugins.inc,v
retrieving revision 1.60
diff -r1.60 plugins.inc
88a89,97
>       'grid' => array(
>         'title' => t('Grid'),
>         'help' => t('Displays rows in a grid.'),
>         'handler' => 'views_plugin_style_grid',
>         'theme' => 'views_view_grid',
>         'uses row plugin' => TRUE,
>         'uses options' => TRUE,
>         'type' => 'normal',
>       ),
2472a2482,2523
>  * Style plugin to render each item in a grid cell.
>  */
> class views_plugin_style_grid extends views_plugin_style {
>   /**
>    * Set default options
>    */
>   function options($display) {
>     return array(
>       'columns' => 4,
>     );
>   }
> 
>   /**
>    * Render the given style.
>    */
>   function options_form(&$form, &$form_state) {
>     $form['type'] = array(
>       '#type' => 'textfield',
>       '#title' => t('Number of columns'),
>       '#default_value' => $this->options['columns'],
>     );
>   }
> 
>   /**
>    * Render the list style.
>    */
>   function render() {
>     if (empty($this->row_plugin)) {
>       vpr('views_plugin_style_grid: Missing row plugin');
>       return;
>     }
> 
>     $rows = array();
>     foreach ($this->view->result as $row) {
>       $rows[] = $this->row_plugin->render($row);
>     }
> //    $theme = views_theme_functions('views_view_list', $this->view, $this->display);
>     return theme($this->theme_functions(), $this->view, $this->options, $rows);
>   }
> }
> 
> /**
Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/theme/theme.inc,v
retrieving revision 1.30
diff -r1.30 theme.inc
263a264,287
> 
> /**
>  * Display a view as a grid style.
>  */
> function template_preprocess_views_view_grid(&$vars) {
>   $view     = $vars['view'];
>   $result   = $view->result;
>   $options  = $view->style_handler->options;
>   $handler  = $view->style_handler;
> 
>   $columns  = $options['columns'];
> 
>   $rows = array();
>   $row = array();
>   foreach($vars['rows'] as $count => $item) {
>     $row[] = $item;
>     if (($count + 1) % $columns == 0) {
>       $rows[] = $row;
>       $row = array();
>     }
>   }
>   $vars['rows'] = $rows;
> }
> 
Index: theme/views-view-grid.tpl.php
===================================================================
RCS file: theme/views-view-grid.tpl.php
diff -N theme/views-view-grid.tpl.php
0a1,32
> <?php
> // $Id$
> /**
>  * @file views-view-grid.tpl.php
>  * Default simple view template to display a list of rows.
>  *
>  * - $rows contains a nested array of rows and columns.
>  * @ingroup views_templates
>  */
> ?>
> <table class="views-view-grid">
>   <tbody>
>     <?php foreach ($rows as $row_number => $columns): ?>
> <?php
>   $row_class = 'row-'. ($row_number + 1);
>   if ($row_number == 0) {
>     $row_class .= ' row-first';
>   }
>   elseif (count($rows) == ($row_number + 1)) {
>     $row_class .= ' row-last';
>   }
> ?>
>       <tr class="<?php print $row_class; ?>">
>         <?php foreach ($columns as $column_number => $item): ?>
>           <td class="<?php print 'col-'. ($column_number + 1); ?>">
>             <?php print $item; ?>
>           </td>
>         <?php endforeach; ?>
>       </tr>
>     <?php endforeach; ?>
>   </tbody>
> </table>
