diff --git a/themes/jquerymobile/templates/primo/advanced.phtml b/themes/jquerymobile/templates/primo/advanced.phtml new file mode 100644 index 0000000000000000000000000000000000000000..0917a23fc7bfb64e11c9be5fc722fc992ee54846 --- /dev/null +++ b/themes/jquerymobile/templates/primo/advanced.phtml @@ -0,0 +1,88 @@ +<? + // Set page title. + $this->headTitle($this->translate('Advanced Search')); + // Set default value if necessary: + if (!isset($this->searchClassId)) { + $this->searchClassId = 'Solr'; + } + // Load search actions and settings (if any): + $options = $this->searchOptions($this->searchClassId); + $basicSearch = $options->getSearchAction(); + $searchHome = $basicSearch; + $searchHome['action'] = 'Home'; + $lastSort = $options->getLastSort(); + $lastLimit = $options->getLastLimit(); +?> +<div data-role="page" id="Search-home"> + <?=$this->mobileMenu()->header(array('hideSearchLink' => true))?> + <div data-role="content"> + <!-- SEARCH BOXES --> + <form id="advSearchForm" name="searchForm" method="get" action="<?=$this->url($this->options->getSearchAction())?>" data-ajax="false"> + <input type="hidden" name="join" value="AND" /> + <? /* fallback to a fixed set of search groups/fields if JavaScript is turned off */ ?> + <? if ($groups !== false) { + $numGroups = count($groups); + } + if (!isset($numGroups) || $numGroups < 3) { + $numGroups = 1; + } + ?> + <? for ($i = 0; $i < $numGroups; $i++): ?> + <input type="hidden" name="bool<?=$i?>[]" value="AND" /> + <fieldset class="ui-grid-b"> + <? + if (isset($groups[$i])) { + $currentGroup = $groups[$i]->getQueries(); + $numRows = count($currentGroup); + } else { + $currentGroup = false; + } + if (!isset($numRows) || $numRows < 3) { + $numRows = 3; + } + ?> + <? for ($j = 0; $j < $numRows; $j++): ?> + <? $currRow = isset($currentGroup[$j]) ? $currentGroup[$j] : false; ?> + <div class="ui-block-a"> + <input id="search_lookfor<?=$i?>_<?=$j?>" type="text" value="<?=$currRow?$this->escapeHtml($currRow->getString()):''?>" name="lookfor<?=$i?>[]" style="margin-top:.5em;height:28px"/> + </div> + <div class="ui-block-b"> + <select id="search_type<?=$i?>_<?=$j?>" name="type<?=$i?>[]"> + <? foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?> + <option value="<?=$this->escapeHtml($searchVal)?>"<?=($currRow && $currRow->getHandler() == $searchVal)?' selected="selected"':''?>><?=$this->transEsc($searchDesc)?></option> + <? endforeach; ?> + </select> + </div> + <div class="ui-block-c"> + <select id="searchForm_op<?=$i?>_<?=$j?>" name="op<?=$i?>[]"> + <? foreach ($this->options->getAdvancedOperators() as $searchVal => $searchDesc): ?> + <option value="<?=$this->escapeHtml($searchVal)?>"<?=($currRow && $currRow->getOperator() == $searchVal)?' selected="selected"':''?>><?=$this->transEsc($searchDesc)?></option> + <? endforeach; ?> + </select> + </div> + <? endfor; ?> + </fieldset> + <? endfor; ?> + <? $lastSort = $this->options->getLastSort(); ?> + <? if (!empty($lastSort)): ?> + <input type="hidden" name="sort" value="<?=$this->escapeHtml($lastSort)?>" /> + <? endif; ?> + <hr/> + <fieldset class="ui-grid-solo"> + <div class="ui-block-a"> + <input type="submit" name="submit" value="<?=$this->transEsc("Find")?>" data-role="button" data-theme="b"/> + </div> + </fieldset> + <? + /* Load hidden limit preference from Session */ + if (!empty($lastLimit)) { + echo '<input type="hidden" name="limit" value="' . $this->escapeHtml($lastLimit) . '" />'; + } + if (!empty($lastSort)) { + echo '<input type="hidden" name="sort" value="' . $this->escapeHtml($lastSort) . '" />'; + } + ?> + </form> + </div> + <?=$this->mobileMenu()->footer()?> +</div>