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 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.search.html',
'Services/Search');
223 $this->tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this,
'performSearch'));
225 $this->tpl->setVariable(
"TXT_SEARCH", $lng->txt(
"search"));
226 $this->tpl->setVariable(
"TXT_OPTIONS", $lng->txt(
"options"));
228 $this->tpl->setVariable(
"TXT_COMBINATION", $lng->txt(
"search_term_combination"));
233 $this->tpl->setCurrentBlock(
"type_sel");
234 $this->tpl->setVariable(
'TXT_TYPE_DEFAULT',$lng->txt(
"search_fast_info"));
235 $this->tpl->setVariable(
"TXT_TYPE", $lng->txt(
"search_type"));
238 $this->tpl->setVariable(
"FORM", $this->form->getHTML());
239 $this->tpl->parseCurrentBlock();
242 $this->tpl->setVariable(
"TXT_AREA", $lng->txt(
"search_area"));
246 $this->tpl->setVariable(
'SEARCH_AREA_FORM', $this->
getSearchAreaForm()->getHTML());
256 include_once
'Services/Search/classes/class.ilSearchResult.php';
265 if(count($result_obj->getResults()))
267 $this->
addPager($result_obj,
'max_page');
269 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
271 $presentation->setResults($result_obj->getResultsForPresentation());
272 $presentation->setSubitemIds($result_obj->getSubitemIds());
273 $presentation->setPreviousNext($this->prev_link, $this->next_link);
274 #$presentation->setSearcher($searcher);
276 if($presentation->render())
279 $this->tpl->setVariable(
'RESULTS_TABLE',$presentation->getHTML(
true));
294 if(!isset(
$_GET[
'page_number']) and $this->search_mode !=
'in_results' )
297 $this->search_cache->deleteCachedEntries();
319 $result_meta =& $this->
__searchMeta($query_parser,
'keyword');
320 $result->mergeEntries($result_meta);
322 $result_meta =& $this->
__searchMeta($query_parser,
'contribute');
323 $result->mergeEntries($result_meta);
325 $result_meta =& $this->
__searchMeta($query_parser,
'title');
326 $result->mergeEntries($result_meta);
328 $result_meta =& $this->
__searchMeta($query_parser,
'description');
329 $result->mergeEntries($result_meta);
337 if($this->search_mode ==
'in_results')
339 include_once
'Services/Search/classes/class.ilSearchResult.php';
342 $old_result_obj->
read();
344 $result->diffEntriesFromResult($old_result_obj);
353 if(!count(
$result->getResults()))
360 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
361 #ilUtil::sendInfo($message);
367 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
369 $presentation->setResults(
$result->getResultsForPresentation());
370 $presentation->setSubitemIds(
$result->getSubitemIds());
371 $presentation->setPreviousNext($this->prev_link, $this->next_link);
373 if($presentation->render())
376 $this->tpl->setVariable(
'RESULTS_TABLE',$presentation->getHTML(
true));
386 global $ilTabs, $ilHelp;
390 $ilHelp->setScreenIdComponent(
"src");
392 $ilTabs->addTab(
"search", $this->lng->txt(
"search"),
393 $this->ctrl->getLinkTarget($this));
395 if (!$this->settings->getHideAdvancedSearch())
397 $ilTabs->addTab(
"adv_search", $this->lng->txt(
"search_advanced"),
398 $this->ctrl->getLinkTargetByClass(
'iladvancedsearchgui'));
401 $ilTabs->activateTab(
"search");
418 $crs_search->setFilter(array(
'crs'));
419 $result->mergeEntries($crs_search->performSearch());
424 $grp_search->setFilter(array(
'grp'));
425 $result->mergeEntries($grp_search->performSearch());
431 $result->mergeEntries($content_search->performSearch());
437 $result->mergeEntries($forum_search->performSearch());
443 $gdf_search->setFilter(array(
'gdf'));
444 $result->mergeEntries($gdf_search->performSearch());
447 $result->mergeEntries($gdf_term_search->performSearch());
453 $result->mergeEntries($exc_search->performSearch());
457 $mcst_search =& ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
458 $result->mergeEntries($mcst_search->performSearch());
464 $result->mergeEntries($tst_search->performSearch());
470 $result->mergeEntries($mep_search->performSearch());
475 $result->mergeEntries($mob_search->performKeywordSearch());
482 $result->mergeEntries($wiki_search->performSearch());
502 include_once
'Services/Search/classes/class.ilQueryParser.php';
506 $query_parser->parse();
508 if(!$query_parser->validate())
510 return $query_parser->getMessage();
512 return $query_parser;
521 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
528 return $obj_search->performSearch();
539 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
549 $meta_search->setMode(
'keyword');
553 $meta_search->setMode(
'contribute');
557 $meta_search->setMode(
'title');
561 $meta_search->setMode(
'description');
564 return $meta_search->performSearch();
578 foreach($this->
getDetails() as $key => $detail_type)
636 return $filter ? $filter : array();
649 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
652 if(
$_GET[
'page_number'])
654 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
656 if(isset(
$_POST[
'cmd'][
'performSearch']))
659 $this->search_cache->save();