_querySearch)) { $query = Qs_Request::getGetValue('query', null); $this->_querySearch = trim($query); } $this->doc->setHeader(''); return parent::exec(); } public function setType($type = 'default') { return $this->_type = $type; } protected function _addFilterItem() { if ($this->dataObj->hasFilter() && $this->_hasFilter) { if (!empty($this->_querySearch)) { $this->dataObj->addFilter(array('query' => $this->_querySearch)); $this->list->addUrlVariables(array('query')); } else { $this->dataObj->addFilter(array('query' => '__empty_query')); } } return $this; } public function setListOption($name, $value) { $this->_listOptions[$name] = $value; return $this; } protected function _addItem($item, $groupName = null) { if (!isset($this->_fullViewAlias)) { throw new Qs_Db_Exception('Please enter an alias for full search list'); } $item['templatePath'] = $this->_getTemplatePath(); $item['title'] = $this->dataObj->itemName . ' Search Results for "' . htmlspecialchars($this->_querySearch) . '"'; if ($this->_type == 'small') { $urlParams = array( 'query' => $this->_querySearch ); $item['link4All'] = $this->_fullViewAlias . '?' . http_build_query($urlParams); } if ($this->_search4Autocomplete === true) { $this->_renderAutocompleteBlock($item); } else { $item['type'] = $this->_type; $this->doc->addItem($item); } return $this; } protected function _renderAutocompleteBlock($item) { $smarty = $this->doc->getSmarty(); $smarty->assign('item', new Qs_Doc_Item($item)); $smarty->assign('BASE_URL', BASE_URL); $this->doc->assign( 'autocompleteHTML', $this->doc->getTemplateVariable('autocompleteHTML') . $smarty->fetch($item['tpl']) ); } public function setSearch4Autocomplete($search4Autocomplete) { $this->_search4Autocomplete = (bool) $search4Autocomplete; return $this; } }