4 include_once
'Services/Search/classes/class.ilSearchBaseGUI.php';
40 $lng->loadLanguageModule(
"search");
44 $this->form->checkInput();
46 $new_search = isset(
$_POST[
'cmd'][
'performSearch']) ?
true :
false;
49 foreach($enabled_types as
$type => $pval)
62 $this->root_node =
$_SESSION[
'search_root'] ?
$_SESSION[
'search_root'] : ROOT_FOLDER_ID;
65 $this->
setString(
$_POST[
'search'][
'string'] ?
$_POST[
'search'][
'string'] : $_SESSION[
'search'][
'string']);
66 #$this->setDetails($_POST['search']['details'] ? $_POST['search']['details'] : $_SESSION['search']['details']);
67 $this->
setDetails($new_search ?
$_POST[
'search'][
'details'] : $_SESSION[
'search'][
'details']);
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
87 case "ilpropertyformgui":
91 $ilCtrl->setReturn($this,
'storeRoot');
92 return $ilCtrl->forwardCommand($form);
94 case 'ilobjectcopygui':
96 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
98 $this->ctrl->forwardCommand($cp);
105 $cmd =
"showSavedResults";
120 $_SESSION[
'search'][
'type'] = $this->type = $a_type;
132 $_SESSION[
'search'][
'combination'] = $this->combination = $a_combination;
144 $_SESSION[
'search'][
'string'] = $this->
string = $a_str;
156 $_SESSION[
'search'][
'details'] = $this->details = $a_details;
160 return $this->details ? $this->details : array();
166 return $this->root_node ? $this->root_node : ROOT_FOLDER_ID;
170 $_SESSION[
'search_root'] = $this->root_node = $a_node_id;
189 $this->root_node = $form->getItemByPostVar(
'area')->getValue();
190 $this->search_cache->setRoot($this->root_node);
191 $this->search_cache->save();
192 $this->search_cache->deleteCachedEntries();
194 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
206 include_once(
"./Services/Search/classes/class.ilSearchAutoComplete.php");
218 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
220 $this->tpl->addJavascript(
"./Services/Search/js/Search.js");
222 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
224 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.search.html',
'Services/Search');
225 $this->tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this,
'performSearch'));
227 include_once(
"./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
229 $btn->setCommand(
"performSearch");
230 $btn->setCaption(
"search");
231 $this->tpl->setVariable(
"SUBMIT_BTN",$btn->render());
232 $this->tpl->setVariable(
"TXT_OPTIONS", $lng->txt(
"options"));
234 $this->tpl->setVariable(
"TXT_COMBINATION", $lng->txt(
"search_term_combination"));
239 $this->tpl->setCurrentBlock(
"type_sel");
240 $this->tpl->setVariable(
'TXT_TYPE_DEFAULT',$lng->txt(
"search_fast_info"));
241 $this->tpl->setVariable(
"TXT_TYPE", $lng->txt(
"search_type"));
244 $this->tpl->setVariable(
"FORM", $this->form->getHTML());
245 $this->tpl->parseCurrentBlock();
248 $this->tpl->setVariable(
"TXT_AREA", $lng->txt(
"search_area"));
252 $this->tpl->setVariable(
'SEARCH_AREA_FORM', $this->
getSearchAreaForm()->getHTML());
262 include_once
'Services/Search/classes/class.ilSearchResult.php';
271 if(count($result_obj->getResults()))
273 $this->
addPager($result_obj,
'max_page');
275 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
277 $presentation->setResults($result_obj->getResultsForPresentation());
278 $presentation->setSubitemIds($result_obj->getSubitemIds());
279 $presentation->setPreviousNext($this->prev_link, $this->next_link);
280 #$presentation->setSearcher($searcher);
282 if($presentation->render())
285 $this->tpl->setVariable(
'RESULTS_TABLE',$presentation->getHTML(
true));
300 if(!isset(
$_GET[
'page_number']) and $this->search_mode !=
'in_results' )
303 $this->search_cache->deleteCachedEntries();
325 $result_meta =& $this->
__searchMeta($query_parser,
'keyword');
326 $result->mergeEntries($result_meta);
328 $result_meta =& $this->
__searchMeta($query_parser,
'contribute');
329 $result->mergeEntries($result_meta);
331 $result_meta =& $this->
__searchMeta($query_parser,
'title');
332 $result->mergeEntries($result_meta);
334 $result_meta =& $this->
__searchMeta($query_parser,
'description');
335 $result->mergeEntries($result_meta);
343 if($this->search_mode ==
'in_results')
345 include_once
'Services/Search/classes/class.ilSearchResult.php';
348 $old_result_obj->
read();
350 $result->diffEntriesFromResult($old_result_obj);
359 if(!count(
$result->getResults()))
366 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
367 #ilUtil::sendInfo($message);
373 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
375 $presentation->setResults(
$result->getResultsForPresentation());
376 $presentation->setSubitemIds(
$result->getSubitemIds());
377 $presentation->setPreviousNext($this->prev_link, $this->next_link);
379 if($presentation->render())
382 $this->tpl->setVariable(
'RESULTS_TABLE',$presentation->getHTML(
true));
392 global $ilTabs, $ilHelp;
396 $ilHelp->setScreenIdComponent(
"src");
398 $ilTabs->addTab(
"search", $this->lng->txt(
"search"),
399 $this->ctrl->getLinkTarget($this));
401 if (!$this->settings->getHideAdvancedSearch())
403 $ilTabs->addTab(
"adv_search", $this->lng->txt(
"search_advanced"),
404 $this->ctrl->getLinkTargetByClass(
'iladvancedsearchgui'));
407 $ilTabs->activateTab(
"search");
424 $crs_search->setFilter(array(
'crs'));
425 $result->mergeEntries($crs_search->performSearch());
430 $grp_search->setFilter(array(
'grp'));
431 $result->mergeEntries($grp_search->performSearch());
437 $result->mergeEntries($content_search->performSearch());
443 $result->mergeEntries($forum_search->performSearch());
449 $gdf_search->setFilter(array(
'gdf'));
450 $result->mergeEntries($gdf_search->performSearch());
453 $result->mergeEntries($gdf_term_search->performSearch());
459 $result->mergeEntries($exc_search->performSearch());
463 $mcst_search =& ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
464 $result->mergeEntries($mcst_search->performSearch());
470 $result->mergeEntries($tst_search->performSearch());
476 $result->mergeEntries($mep_search->performSearch());
481 $result->mergeEntries($mob_search->performKeywordSearch());
488 $result->mergeEntries($wiki_search->performSearch());
508 include_once
'Services/Search/classes/class.ilQueryParser.php';
512 $query_parser->parse();
514 if(!$query_parser->validate())
516 return $query_parser->getMessage();
518 return $query_parser;
527 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
534 return $obj_search->performSearch();
545 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
555 $meta_search->setMode(
'keyword');
559 $meta_search->setMode(
'contribute');
563 $meta_search->setMode(
'title');
567 $meta_search->setMode(
'description');
570 return $meta_search->performSearch();
584 foreach($this->
getDetails() as $key => $detail_type)
642 return $filter ? $filter : array();
655 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
658 if(
$_GET[
'page_number'])
660 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
662 if(isset(
$_POST[
'cmd'][
'performSearch']))
665 $this->search_cache->save();