summaryrefslogtreecommitdiffstats
path: root/theme/theme.inc
diff options
context:
space:
mode:
authorEarl Miles2008-09-30 19:47:11 +0000
committerEarl Miles2008-09-30 19:47:11 +0000
commit62151fc923a1dbed2cb97e599e0fb519c12edeeb (patch)
treec0212039652522618b7d3632868108a31ee5ba7f /theme/theme.inc
parent455d23158c785873aa29a72b10008fd72625010d (diff)
#281555: Add row classes (first, last, even, odd, row number) to the unformatted and list styles.
Diffstat (limited to 'theme/theme.inc')
-rw-r--r--theme/theme.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/theme/theme.inc b/theme/theme.inc
index 5759d91..5345eda 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -406,6 +406,25 @@ function template_preprocess_views_view_grid(&$vars) {
}
/**
+ * Display the simple view of rows one after another
+ */
+function template_preprocess_views_view_unformatted(&$vars) {
+ $view = $vars['view'];
+ $rows = $vars['rows'];
+
+ $vars['classes'] = array();
+ // Set up striping values.
+ foreach ($rows as $id => $row) {
+ $vars['classes'][$id] = 'views-row-' . ($id + 1);
+ $vars['classes'][$id] .= ' views-row-' . ($id % 2 ? 'even' : 'odd');
+ if ($id == 0) {
+ $vars['classes'][$id] .= ' views-row-first';
+ }
+ }
+ $vars['classes'][$id] .= ' views-row-last';
+}
+
+/**
* Preprocess an RSS feed
*/
function template_preprocess_views_view_rss(&$vars) {