Author: sevein
Date: Wed May 2 17:00:23 2012
New Revision: 11598
Log:
Add partial to render facets, tired to see the same code everywhere
Added:
branches/2.0/apps/qubit/modules/search/templates/_facet.php
Added: branches/2.0/apps/qubit/modules/search/templates/_facet.php
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/2.0/apps/qubit/modules/search/templates/_facet.php Wed May 2
17:00:23 2012 (r11598)
@@ -0,0 +1,30 @@
+<div class="section">
+
+ <h2 class="visible-phone widebtn btn-huge" data-toggle="collapse"
data-target="<?php echo $target ?>"><?php echo $label ?></h2>
+ <h2 class="hidden-phone"><?php echo $label ?></h2>
+
+ <div class="scrollable" id="<?php echo $target ?>">
+
+ <ul>
+
+ <li <?php if ('' == $sf_request->getParameter($facet)) echo
'class="active"' ?>>
+ <?php echo link_to(__('All'), array(
+ $facet => null,
+ 'page' => null) + $sf_request->getParameterHolder()->getAll()) ?>
+ </li>
+
+ <?php foreach($pager->facets[$facet]['terms'] as $id => $term): ?>
+ <li <?php if (in_array($id, @$filters[$facet])) echo 'class="active"'
?>>
+ <?php echo link_to(
+ __($term['term']).'<span>'.$term['count'].'</span>',
+ array(
+ $facet => (@$filters[$facet] ? implode(',',
array_diff(array_merge(@$filters[$facet], array($id)),
array_intersect(@$filters[$facet], array($id)))) : $id),
+ 'page' => null) + $sf_request->getParameterHolder()->getAll()) ?>
+ </li>
+ <?php endforeach; ?>
+
+ </ul>
+
+ </div>
+
+</div>
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.