summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--STARTERKIT/templates/README.txt1
-rw-r--r--template.php21
-rw-r--r--templates/views-view.tpl.php94
4 files changed, 118 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index e29f2fb..4d595f4 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,8 @@
Zen 6.x-2.x-dev, xxxx-xx-xx (development release)
------------------------
+- #661628 by Jacine and JohnAlbin: Integration with Skinr module
+- by Jacine: Added views-view.tpl.php with support for $classes variables.
- by caroltron, gleroux02, _natron, and JohnAlbin: Add panels 3 layouts using
Zen layout method.
diff --git a/STARTERKIT/templates/README.txt b/STARTERKIT/templates/README.txt
index 3c59755..763be38 100644
--- a/STARTERKIT/templates/README.txt
+++ b/STARTERKIT/templates/README.txt
@@ -19,6 +19,7 @@ Located in zen/templates:
block.tpl.php
comment-wrapper.tpl.php
comment.tpl.php
+ views-view.tpl.php
Located in /modules/aggregator:
aggregator-feed-source.tpl.php
diff --git a/template.php b/template.php
index af87aa1..e9c254e 100644
--- a/template.php
+++ b/template.php
@@ -185,6 +185,10 @@ function zen_preprocess(&$vars, $hook) {
else {
$vars['classes_array'] = array($hook);
}
+ // Add support for Skinr
+ if (!empty($vars['skinr']) && array_key_exists('classes_array', $vars)) {
+ $vars['classes_array'][] = $vars['skinr'];
+ }
}
/**
@@ -420,6 +424,23 @@ function zen_preprocess_block(&$vars, $hook) {
}
/**
+ * Override or insert variables into the views-view templates.
+ *
+ * @param $vars
+ * An array of variables to pass to the theme template.
+ * @param $hook
+ * The name of the template being rendered ("views-view" in this case.)
+ */
+function zen_preprocess_views_view(&$vars, $hook) {
+ // Add the default Views classes.
+ $vars['classes_array'][0] = 'view'; // Replace "views-view".
+ $vars['classes_array'][] = 'view-' . $vars['css_name'];
+ $vars['classes_array'][] = 'view-id-' . $vars['name'];
+ $vars['classes_array'][] = 'view-display-id-' . $vars['display_id'];
+ $vars['classes_array'][] = 'view-dom-id-' . $vars['dom_id'];
+}
+
+/**
* Override or insert variables into templates after preprocess functions have run.
*
* @param $vars
diff --git a/templates/views-view.tpl.php b/templates/views-view.tpl.php
new file mode 100644
index 0000000..bc7e228
--- /dev/null
+++ b/templates/views-view.tpl.php
@@ -0,0 +1,94 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Main view template
+ *
+ * Variables available:
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default values can be one or more of the
+ * following:
+ * - view
+ * - view-[name]
+ * - view-id-[name]
+ * - view-display-id-[display id]
+ * - view-dom-id-[dom id]
+ * - $css_name: A css-safe version of the view name.
+ * - $header: The view header
+ * - $footer: The view footer
+ * - $rows: The results of the view query, if any
+ * - $empty: The empty text to display if the view is empty
+ * - $pager: The pager next/prev links to display, if any
+ * - $exposed: Exposed widget form/info to display
+ * - $feed_icon: Feed icon to display, if any
+ * - $more: A link to view more, if any
+ * - $admin_links: A rendered list of administrative links
+ * - $admin_links_raw: A list of administrative links suitable for theme('links')
+ *
+ * @ingroup views_templates
+ */
+?>
+<div class="<?php print $classes; ?>">
+ <?php if ($admin_links): ?>
+ <div class="views-admin-links views-hide">
+ <?php print $admin_links; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($header): ?>
+ <div class="view-header">
+ <?php print $header; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($exposed): ?>
+ <div class="view-filters">
+ <?php print $exposed; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($attachment_before): ?>
+ <div class="attachment attachment-before">
+ <?php print $attachment_before; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($rows): ?>
+ <div class="view-content">
+ <?php print $rows; ?>
+ </div>
+ <?php elseif ($empty): ?>
+ <div class="view-empty">
+ <?php print $empty; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($pager): ?>
+ <?php print $pager; ?>
+ <?php endif; ?>
+
+ <?php if ($attachment_after): ?>
+ <div class="attachment attachment-after">
+ <?php print $attachment_after; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($more): ?>
+ <?php print $more; ?>
+ <?php endif; ?>
+
+ <?php if ($footer): ?>
+ <div class="view-footer">
+ <?php print $footer; ?>
+ </div>
+ <?php endif; ?>
+
+ <?php if ($feed_icon): ?>
+ <div class="feed-icon">
+ <?php print $feed_icon; ?>
+ </div>
+ <?php endif; ?>
+
+</div> <!-- /.view -->