summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin J Doherty2009-09-09 08:28:42 (GMT)
committer Benjamin J Doherty2009-09-09 08:28:42 (GMT)
commitf41d8bcc3456dd3abf84787b3963cdc06d06c14c (patch)
treef8eedd077adcab9a850dd2f05ab7c998096a5f42
parenta282b839047879448a66749f864a81084cb1c8e5 (diff)
check whether row last class attribute is specified. improve inline documentation for LAST class handling.
-rw-r--r--semanticviews.module14
1 files changed, 11 insertions, 3 deletions
diff --git a/semanticviews.module b/semanticviews.module
index 472ab09..93c7c2c 100644
--- a/semanticviews.module
+++ b/semanticviews.module
@@ -74,9 +74,17 @@ function template_preprocess_semanticviews_view_unformatted(&$variables) {
if ($id == 0 && $variables['options']['row']['first_class']) {
$classes[] = $variables['options']['row']['first_class'];
}
- if (($last_every_nth && ($id + 1) % $last_every_nth == 0) ||
- (!$last_every_nth && ($id + 1) == count($variables['rows']))) {
- $classes[] = $variables['options']['row']['last_class'];
+ if ($variables['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
+ // unit in a row needs a zero width margin.
+ if (($last_every_nth && ($id + 1) % $last_every_nth == 0) ||
+ // Otherwise when last every nth is not set, the LAST class is added
+ // to the last row in the row set.
+ (!$last_every_nth && ($id + 1) == count($variables['rows']))) {
+ $classes[] = $variables['options']['row']['last_class'];
+ }
}
// TODO: implement configurable row striping
//$classes[] = $id % 2 ? 'even' : 'odd';