commit 8c68770ae112e0db4eb5a64d8d120264a48791ae Author: Joel Pittet Date: Fri Apr 19 16:30:48 2013 -0700 revert for straight conversion + doc updates diff --git a/core/modules/views/templates/views-view-unformatted.html.twig b/core/modules/views/templates/views-view-unformatted.html.twig index 67f548e..ee6d1b2 100644 --- a/core/modules/views/templates/views-view-unformatted.html.twig +++ b/core/modules/views/templates/views-view-unformatted.html.twig @@ -1,25 +1,24 @@ {# /** * @file - * Default simple view template to display a list of rows. + * Default simple View template to display a list of rows. * * Variables available: * - title: The title of this group of rows. May be empty. - * - rows: A list of the view's row items. - * - row.attributes: @todo. - * - row.content: @todo. + * - rows: A list of the View's row items. + * - row_classes: A list of row class attributes keyed by the row's id. * * @see template_preprocess() * @see template_preprocess_views_view_unformatted() * - * @ingroup views_templates + * @ingroup themable */ #} {% if title %}

{{ title }}

{% endif %} -{% for row in rows %} - - {{ row.content }} +{% for id, row in rows %} + + {{ row }} {% endfor %} diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index faf14f1..e11a0fc 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -794,7 +794,7 @@ function template_preprocess_views_view_grid(&$vars) { * * @param array $variables * An associative array containing: - * - view: @todo. + * - view: The View object. * - rows: @todo. */ function template_preprocess_views_view_unformatted(&$variables) { @@ -803,34 +803,34 @@ function template_preprocess_views_view_unformatted(&$variables) { $style = $view->style_plugin; $options = $style->options; + $variables['row_classes'] = array(); + $variables['classes'] = array(); $default_row_class = isset($options['default_row_class']) ? $options['default_row_class'] : FALSE; $row_class_special = isset($options['row_class_special']) ? $options['row_class_special'] : FALSE; // Set up striping values. $count = 0; - $max = count($variables['rows']); - foreach ($variables['rows'] as $id => $row) { - $variables['rows'][$id] = new stdClass(); - $variables['rows'][$id]->attributes = new attribute(array('class' => array())); - $variables['rows'][$id]->content = $row; - + $max = count($rows); + foreach ($rows as $id => $row) { + $variables['row_classes'][$id] = array(); $count++; if ($default_row_class) { - $variables['rows'][$id]->attributes['class'][] = 'views-row'; - $variables['rows'][$id]->attributes['class'][] = 'views-row-' . $count; + $variables['row_classes'][$id]['class'][] = 'views-row'; + $variables['row_classes'][$id]['class'][] = 'views-row-' . $count; } if ($row_class_special) { - $variables['rows'][$id]->attributes['class'][] = 'views-row-' . ($count % 2 ? 'odd' : 'even'); + $variables['row_classes'][$id]['class'][] = 'views-row-' . ($count % 2 ? 'odd' : 'even'); if ($count == 1) { - $variables['rows'][$id]->attributes['class'][] = 'views-row-first'; + $variables['row_classes'][$id]['class'][] = 'views-row-first'; } if ($count == $max) { - $variables['rows'][$id]->attributes['class'][] = 'views-row-last'; + $variables['row_classes'][$id]['class'][] = 'views-row-last'; } } if ($row_class = $view->style_plugin->get_row_class($id)) { - $variables['rows'][$id]->attributes['class'][] = $row_class; + $variables['row_classes'][$id]['class'][] = $row_class; } + $variables['row_classes'][$id] = new Attribute($variables['row_classes'][$id]); } }