5 * Copyright 2004 (c) Guillaume Smet
12 require_once('www/search/include/engines/GroupSearchEngine.class.php');
13 require_once('www/tracker/include/ArtifactTypeHtml.class.php');
15 class ArtifactSearchEngine extends GroupSearchEngine {
18 function ArtifactSearchEngine() {
19 $this->type = SEARCH__TYPE_IS_ARTIFACT;
20 $this->rendererClassName = 'ArtifactHtmlSearchRenderer';
23 function getLabel($parameters) {
24 return $this->ath->getName();
27 function isAvailable($parameters) {
28 if(parent::isAvailable($parameters) && isset($parameters[SEARCH__PARAMETER_ARTIFACT_ID]) && $parameters[SEARCH__PARAMETER_ARTIFACT_ID]) {
29 $ath = new ArtifactTypeHtml($this->Group, $parameters[SEARCH__PARAMETER_ARTIFACT_ID]);
30 if($ath && is_object($ath) && !$ath->isError()) {
38 function & getSearchRenderer($words, $offset, $exact, $parameters) {
39 $this->includeSearchRenderer();
40 $rendererClassName = $this->rendererClassName;
41 $renderer = new $rendererClassName($words, $offset, $exact, $parameters[SEARCH__PARAMETER_GROUP_ID], $parameters[SEARCH__PARAMETER_ARTIFACT_ID]);