diff --git a/module/VuFind/src/VuFind/Controller/CombinedController.php b/module/VuFind/src/VuFind/Controller/CombinedController.php index efb032d0f55aded71577a631308096ef46da83e7..05525ea46d8b3a56dd15228170cbb1e4ea01e6ac 100644 --- a/module/VuFind/src/VuFind/Controller/CombinedController.php +++ b/module/VuFind/src/VuFind/Controller/CombinedController.php @@ -184,21 +184,13 @@ class CombinedController extends AbstractSearch && intval($config['Layout']['columns']) <= count($combinedResults) ? intval($config['Layout']['columns']) : 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: return $this->createViewModel( array( 'columns' => $columns, 'combinedResults' => $combinedResults, - 'config' => $config, 'params' => $params, - 'placement' => $placement, 'results' => $results, 'supportsCart' => $supportsCart, 'supportsCartOptions' => $supportsCartOptions diff --git a/themes/bootstrap3/templates/combined/results-list.phtml b/themes/bootstrap3/templates/combined/results-list.phtml index 6b5f7ee54cbf47bd1c4e08a62377845df20fc492..479eeb958e35e9e709ad2766c8a0123e53de9982 100644 --- a/themes/bootstrap3/templates/combined/results-list.phtml +++ b/themes/bootstrap3/templates/combined/results-list.phtml @@ -11,7 +11,7 @@ $moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1); $params->setLimit($limit); ?> -<? if ($currentSearch['more_link']): ?> +<? if (isset($currentSearch['more_link'])): ?> <div class="pull-right"> <a href="<?=$moreUrl?>" class="btn btn-link"><i class="fa fa-gears"></i> <?=$this->transEsc('More options')?></a> </div> @@ -73,7 +73,7 @@ ); ?> <?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?> - <? if ($currentSearch['more_link']): ?> + <? if (isset($currentSearch['more_link'])): ?> <p><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="fa fa-long-arrow-right"></i></a></p> <? endif; ?> <? endif; ?> diff --git a/themes/bootstrap3/templates/combined/results.phtml b/themes/bootstrap3/templates/combined/results.phtml index 484a045ace974f4316a8cbc8868cb863cbac0fcb..0d9ae2befc70198f10f283ae2add715130092f98 100644 --- a/themes/bootstrap3/templates/combined/results.phtml +++ b/themes/bootstrap3/templates/combined/results.phtml @@ -34,9 +34,6 @@ $this->escapeHtml($lookfor) . '</li>'; } - // Enable cart if appropriate: - $this->showCartControls = $this->supportsCart && $this->cart()->isActive(); - // Load Javascript dependencies into header: $this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js"); @@ -57,15 +54,27 @@ <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?> </div> <? endif; ?> - <? - $viewParams = array( - 'searchClassId' => $searchClassId, - 'combinedResults' => $this->combinedResults, - 'supportsCartOptions' => $this->supportsCartOptions, - 'showCartControls' => $this->showCartControls - ); - ?> - <?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', $viewParams)?> + <div class="row"> + <? $columns = count($this->combinedResults); ?> + <? $columnIndex = 0; ?> + <? 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; } ?> + <div class="col-sm-<?=floor(12/$columns)?> combined-list" id="combined_<?=$this->escapeHtml($searchClassId)?>"> + <? + $viewParams = array( + 'searchClassId' => $searchClassId, + '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)): ?> <div> <? foreach ($recs as $current): ?> diff --git a/themes/bootstrap3/templates/combined/stack-distributed.phtml b/themes/bootstrap3/templates/combined/stack-distributed.phtml deleted file mode 100644 index 91cb37ec0dd289b76d73188b81256e15f281c726..0000000000000000000000000000000000000000 --- a/themes/bootstrap3/templates/combined/stack-distributed.phtml +++ /dev/null @@ -1,30 +0,0 @@ -<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 diff --git a/themes/bootstrap3/templates/combined/stack-left.phtml b/themes/bootstrap3/templates/combined/stack-left.phtml deleted file mode 100644 index d7dfd261d49a698aa78d84387310c5c935d5e874..0000000000000000000000000000000000000000 --- a/themes/bootstrap3/templates/combined/stack-left.phtml +++ /dev/null @@ -1,24 +0,0 @@ -<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 diff --git a/themes/bootstrap3/templates/combined/stack-right.phtml b/themes/bootstrap3/templates/combined/stack-right.phtml deleted file mode 100644 index d7c30c40ef577f4e66f34a80cfa68ec7714d56d1..0000000000000000000000000000000000000000 --- a/themes/bootstrap3/templates/combined/stack-right.phtml +++ /dev/null @@ -1,24 +0,0 @@ -<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