/** * Execute this action * * @return void * @access public * @since 2/16/09 */ public function execute() { if (!$this->isAuthorizedToExecute()) { print $this->getUnauthorizedMessage(); exit; } $query = trim(preg_replace('/[^\\w_.\'\\s-]/i', '', RequestContext::value('query'))); print "\n<ul query=\"" . $query . "\">"; if (strlen($query) >= 2) { $source = new AgentSearchSource(); $results = $source->getResults($query); foreach ($results as $result) { print "\n\t<li id=\"" . $result->getIdString() . "\">" . $result->getName() . "</li>"; } } print "\n</ul>"; exit; }
/** * Answer an array of search result objects after searching for the term passed * * @param string $searchTerm * @return array of WSearchResult objects * @access public * @since 11/27/07 */ public function getResults($searchTerm) { $results = parent::getResults($searchTerm); return $results; }