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

Revert the commit that un-implemented the combined stack features in...

Revert the commit that un-implemented the combined stack features in release-2.3. Necessary to let happy merging continue.
parent cc194af6
No related merge requests found
...@@ -184,13 +184,21 @@ class CombinedController extends AbstractSearch ...@@ -184,13 +184,21 @@ class CombinedController extends AbstractSearch
&& intval($config['Layout']['columns']) <= count($combinedResults) && intval($config['Layout']['columns']) <= count($combinedResults)
? intval($config['Layout']['columns']) ? intval($config['Layout']['columns'])
: count($combinedResults); : count($combinedResults);
$placement = isset($config['Layout']['stack_placement'])
? $config['Layout']['stack_placement']
: 'distributed';
if (!in_array($placement, array('distributed', 'left', 'right'))) {
$placement = 'distributed';
}
// Build view model: // Build view model:
return $this->createViewModel( return $this->createViewModel(
array( array(
'columns' => $columns, 'columns' => $columns,
'combinedResults' => $combinedResults, 'combinedResults' => $combinedResults,
'config' => $config,
'params' => $params, 'params' => $params,
'placement' => $placement,
'results' => $results, 'results' => $results,
'supportsCart' => $supportsCart, 'supportsCart' => $supportsCart,
'supportsCartOptions' => $supportsCartOptions 'supportsCartOptions' => $supportsCartOptions
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
$moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1); $moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1);
$params->setLimit($limit); $params->setLimit($limit);
?> ?>
<? if (isset($currentSearch['more_link'])): ?> <? if ($currentSearch['more_link']): ?>
<div class="pull-right"> <div class="pull-right">
<a href="<?=$moreUrl?>" class="btn btn-link"><i class="fa fa-gears"></i> <?=$this->transEsc('More options')?></a> <a href="<?=$moreUrl?>" class="btn btn-link"><i class="fa fa-gears"></i> <?=$this->transEsc('More options')?></a>
</div> </div>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
} }
?> ?>
<?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?> <?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?>
<? if (isset($currentSearch['more_link'])): ?> <? if ($currentSearch['more_link']): ?>
<p><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="fa fa-long-arrow-right"></i></a></p> <p><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="fa fa-long-arrow-right"></i></a></p>
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
$this->escapeHtml($lookfor) . '</li>'; $this->escapeHtml($lookfor) . '</li>';
} }
// Enable cart if appropriate:
$this->showCartControls = $this->supportsCart && $this->cart()->isActive();
// Load Javascript dependencies into header: // Load Javascript dependencies into header:
$this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_item_statuses.js");
$this->headScript()->appendFile("check_save_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js");
...@@ -52,27 +55,15 @@ ...@@ -52,27 +55,15 @@
<? if ($this->supportsCart && $this->cart()->isActive()): ?> <? if ($this->supportsCart && $this->cart()->isActive()): ?>
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?>
<? endif; ?> <? endif; ?>
<div class="row"> <?
<? $columns = count($this->combinedResults); ?> $viewParams = array(
<? $columnIndex = 0; ?> 'searchClassId' => $searchClassId,
<? foreach ($this->combinedResults as $searchClassId => $currentSearch): ?> 'combinedResults' => $this->combinedResults,
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { continue; } ?> 'supportsCartOptions' => $this->supportsCartOptions,
<div class="col-sm-<?=floor(12/$columns)?> combined-list" id="combined_<?=$this->escapeHtml($searchClassId)?>"> 'showCartControls' => $this->showCartControls
<? );
$viewParams = array( ?>
'searchClassId' => $searchClassId, <?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', $viewParams)?>
'currentSearch' => $currentSearch,
'showCartControls' => $this->supportsCartOptions[$columnIndex++] && $this->cart()->isActive()
);
?>
<? if (isset($currentSearch['ajax']) && $currentSearch['ajax']): ?>
<?=$this->render('combined/results-ajax.phtml', $viewParams)?>
<? else: ?>
<?=$this->render('combined/results-list.phtml', $viewParams)?>
<? endif; ?>
</div>
<? endforeach; ?>
</div>
<? $recs = $combinedResults->getRecommendations('bottom'); if (!empty($recs)): ?> <? $recs = $combinedResults->getRecommendations('bottom'); if (!empty($recs)): ?>
<div> <div>
<? foreach ($recs as $current): ?> <? foreach ($recs as $current): ?>
......
<div class="row">
<? $span = floor(12/$columns); ?>
<? $sectionCount = count($this->combinedResults); ?>
<? $keys = array(); ?>
<? $searches = array(); ?>
<? foreach ($this->combinedResults as $searchClassId => $currentSearch): ?>
<? $keys[] = $searchClassId; ?>
<? $searches[] = $currentSearch; ?>
<? endforeach; ?>
<? for ($column=0;$column<$columns;$column++): ?>
<? $columnIndex = $column; ?>
<div class="col-sm-<?=$span ?> combined-list">
<? while ($columnIndex < $sectionCount): ?>
<? $searchClassId = $keys[$columnIndex]; ?>
<? $currentSearch = $searches[$columnIndex]; ?>
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? $columnIndex += $columns ?>
<? endwhile; ?>
</div>
<? endfor; ?>
</div>
\ No newline at end of file
<div class="row">
<? $columnIndex = 0; ?>
<? $span = floor(12/$columns); ?>
<? $sectionCount = count($this->combinedResults); ?>
<? foreach ($this->combinedResults as $searchClassId => $currentSearch): ?>
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { continue; } ?>
<? if ($columnIndex < $columns): ?>
<div class="col-sm-<?=$span ?><? if($columnIndex == $columns-1): ?> col-sm-pull-<?=$span*($columns-1) ?><? else: ?> col-sm-push-<?=$span ?><? endif; ?> combined-list">
<? endif; ?>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? ++$columnIndex ?>
<? if($columnIndex < $columns || $columnIndex == $sectionCount): ?>
</div>
<? endif; ?>
<? endforeach; ?>
</div>
\ No newline at end of file
<div class="row">
<? $columnIndex = 0; ?>
<? $span = floor(12/$columns); ?>
<? $sectionCount = count($this->combinedResults); ?>
<? foreach ($this->combinedResults as $searchClassId => $currentSearch): ?>
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { continue; } ?>
<? if ($columnIndex < $columns): ?>
<div class="col-sm-<?=$span ?> combined-list">
<? endif; ?>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? ++$columnIndex ?>
<? if($columnIndex < $columns || $columnIndex == $sectionCount): ?>
</div>
<? endif; ?>
<? endforeach; ?>
</div>
\ No newline at end of file
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