query = $query; } /** * run the search */ public function execute() { $this->pageLookupResults = ft_pageLookup($this->query, true, useHeading('navigation')); $this->fullTextResults = ft_pageSearch($this->query, $highlight); $this->highlight = $highlight; } /** * display the search result * * @return void */ public function show() { $searchHTML = ''; $searchHTML .= $this->getSearchIntroHTML($this->query); $searchHTML .= $this->getPageLookupHTML($this->pageLookupResults); $searchHTML .= $this->getFulltextResultsHTML($this->fullTextResults, $this->highlight); echo $searchHTML; } /** * Build the intro text for the search page * * @param string $query the search query * * @return string */ protected function getSearchIntroHTML($query) { global $ID, $lang; $intro = p_locale_xhtml('searchpage'); // allow use of placeholder in search intro $pagecreateinfo = (auth_quickaclcheck($ID) >= AUTH_CREATE) ? $lang['searchcreatepage'] : ''; $intro = str_replace( array('@QUERY@', '@SEARCH@', '@CREATEPAGEINFO@'), array(hsc(rawurlencode($query)), hsc($query), $pagecreateinfo), $intro ); return $intro; } /** * Build HTML for a list of pages with matching pagenames * * @param array $data search results * * @return string */ protected function getPageLookupHTML($data) { if (empty($data)) { return ''; } global $lang; $html = '