Skip to content
Snippets Groups Projects
Commit 2af5b3a1 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Combined view now enforces list view unless unavailable. Now responds to dynamic number of columns.

parent cecae66e
No related merge requests found
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
<? endforeach; ?> <? endforeach; ?>
<? else: ?> <? else: ?>
<?=$this->render('search/list-' . $params->getView() . '.phtml', array('results' => $results, 'params' => $params))?> <? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?>
<?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?>
<p class="more_link"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?></a></p> <p class="more_link"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?></a></p>
<? endif; ?> <? endif; ?>
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
<? endforeach; ?> <? endforeach; ?>
<? else: ?> <? else: ?>
<?=$this->render('search/list-' . $params->getView() . '.phtml', array('results' => $results, 'params' => $params))?> <? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?>
<?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?>
<p class="pad text-right"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="icon-long-arrow-right"></i></a></p> <p class="pad text-right"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="icon-long-arrow-right"></i></a></p>
<? endif; ?> <? endif; ?>
...@@ -44,8 +44,9 @@ ...@@ -44,8 +44,9 @@
</div> </div>
<? endif; ?> <? endif; ?>
<div class="row-fluid"> <div class="row-fluid">
<? $columns = count($this->combinedResults); ?>
<? foreach ($this->combinedResults as $searchClassId => $currentSearch): ?> <? foreach ($this->combinedResults as $searchClassId => $currentSearch): ?>
<div class="span6 combined-list" id="combined_<?=$this->escapeHtml($searchClassId)?>"> <div class="span<?=floor(12/$columns)?> combined-list" id="combined_<?=$this->escapeHtml($searchClassId)?>">
<? if (isset($currentSearch['ajax']) && $currentSearch['ajax']): ?> <? if (isset($currentSearch['ajax']) && $currentSearch['ajax']): ?>
<?=$this->render('combined/results-ajax.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> <?=$this->render('combined/results-ajax.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?>
<? else: ?> <? else: ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment