4 include_once
'Services/Search/classes/class.ilSearchBaseGUI.php';
43 $lng->loadLanguageModule(
"search");
47 $this->form->checkInput();
49 $new_search = isset(
$_POST[
'cmd'][
'performSearch']) ? true :
false;
52 foreach ($enabled_types as
$type => $pval) {
71 $this->
setString(
$_POST[
'search'][
'string'] ?
$_POST[
'search'][
'string'] : $_SESSION[
'search'][
'string']);
72 #$this->setDetails($_POST['search']['details'] ? $_POST['search']['details'] : $_SESSION['search']['details']); 73 $this->
setDetails($new_search ?
$_POST[
'search'][
'details'] : $_SESSION[
'search'][
'details']);
86 $rbacsystem = $DIC[
'rbacsystem'];
87 $ilCtrl = $DIC[
'ilCtrl'];
91 $next_class = $this->ctrl->getNextClass($this);
92 $cmd = $this->ctrl->getCmd();
94 switch ($next_class) {
95 case "ilpropertyformgui":
99 $ilCtrl->setReturn($this,
'storeRoot');
100 return $ilCtrl->forwardCommand($form);
102 case 'ilobjectcopygui':
104 $this->ctrl->setReturn($this,
'');
105 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
107 $this->ctrl->forwardCommand($cp);
113 $cmd =
"showSavedResults";
128 $_SESSION[
'search'][
'type'] = $this->type = $a_type;
140 $_SESSION[
'search'][
'combination'] = $this->combination = $a_combination;
152 $_SESSION[
'search'][
'string'] = $this->
string = $a_str;
164 $_SESSION[
'search'][
'details'] = $this->details = $a_details;
168 return $this->details ? $this->details : array();
178 $_SESSION[
'search_root'] = $this->root_node = $a_node_id;
196 $this->root_node = $form->getItemByPostVar(
'area')->getValue();
197 $this->search_cache->setRoot($this->root_node);
198 $this->search_cache->save();
199 $this->search_cache->deleteCachedEntries();
201 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
212 if ((
int) $_REQUEST[
'search_type'] == -1) {
213 $a_fields = array(
'login',
'firstname',
'lastname',
'email');
214 $result_field =
'login';
217 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
221 $auto->setMoreLinkAvailable(
true);
222 $auto->setSearchFields($a_fields);
223 $auto->setResultField($result_field);
224 $auto->enableFieldSearchableCheck(
true);
225 $auto->setUserLimitations(
true);
227 $res = $auto->getList($_REQUEST[
'term']);
229 $res_obj = json_decode(
$res);
235 if (is_array($res_obj->items)) {
236 echo json_encode($res_obj->items);
240 $q = $_REQUEST[
"term"];
241 include_once(
"./Services/Search/classes/class.ilSearchAutoComplete.php");
253 $ilLocator = $DIC[
'ilLocator'];
254 $ilCtrl = $DIC[
'ilCtrl'];
258 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
260 $this->tpl->addJavascript(
"./Services/Search/js/Search.js");
262 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
264 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.search.html',
'Services/Search');
265 $this->tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this,
'performSearch'));
267 $this->tpl->setVariable(
"SEARCH_LABEL",
$lng->txt(
"search"));
268 include_once(
"./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
270 $btn->setCommand(
"performSearch");
271 $btn->setCaption(
"search");
272 $this->tpl->setVariable(
"SUBMIT_BTN", $btn->render());
273 $this->tpl->setVariable(
"TXT_OPTIONS",
$lng->txt(
"options"));
275 $this->tpl->setVariable(
"TXT_COMBINATION",
$lng->txt(
"search_term_combination"));
279 $this->tpl->setCurrentBlock(
"type_sel");
280 $this->tpl->setVariable(
'TXT_TYPE_DEFAULT',
$lng->txt(
"search_fast_info"));
281 $this->tpl->setVariable(
"TXT_TYPE",
$lng->txt(
"search_type"));
284 $this->tpl->setVariable(
"FORM", $this->form->getHTML());
285 $this->tpl->parseCurrentBlock();
290 $this->tpl->setVariable(
'TXT_FILTER_BY_CDATE', $this->lng->txt(
'search_filter_cd'));
291 $this->tpl->setVariable(
'TXT_CD_OFF', $this->lng->txt(
'search_off'));
292 $this->tpl->setVariable(
'TXT_CD_ON', $this->lng->txt(
'search_on'));
299 $this->tpl->setVariable(
"TXT_AREA",
$lng->txt(
"search_area"));
302 $this->tpl->setVariable(
'SEARCH_AREA_FORM', $this->
getSearchAreaForm()->getHTML());
314 include_once
'Services/Search/classes/class.ilSearchResult.php';
323 if (count($result_obj->getResults())) {
324 $this->
addPager($result_obj,
'max_page');
326 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
328 $presentation->setResults($result_obj->getResultsForPresentation());
329 $presentation->setSubitemIds($result_obj->getSubitemIds());
330 $presentation->setPreviousNext($this->prev_link, $this->next_link);
331 #$presentation->setSearcher($searcher); 333 if ($presentation->render()) {
335 $this->tpl->setVariable(
'RESULTS_TABLE', $presentation->getHTML(
true));
352 if (!isset(
$_GET[
'page_number']) and $this->search_mode !=
'in_results') {
354 $this->search_cache->deleteCachedEntries();
374 $result_meta = &$this->
__searchMeta($query_parser,
'keyword');
375 $result->mergeEntries($result_meta);
377 $result_meta = &$this->
__searchMeta($query_parser,
'contribute');
378 $result->mergeEntries($result_meta);
380 $result_meta = &$this->
__searchMeta($query_parser,
'title');
381 $result->mergeEntries($result_meta);
383 $result_meta = &$this->
__searchMeta($query_parser,
'description');
384 $result->mergeEntries($result_meta);
391 if ($this->search_mode ==
'in_results') {
392 include_once
'Services/Search/classes/class.ilSearchResult.php';
395 $old_result_obj->
read();
397 $result->diffEntriesFromResult($old_result_obj);
409 if (!count(
$result->getResults())) {
413 if (
$result->isLimitReached()) {
414 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 415 #ilUtil::sendInfo($message); 421 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
423 $presentation->setResults(
$result->getResultsForPresentation());
424 $presentation->setSubitemIds(
$result->getSubitemIds());
425 $presentation->setPreviousNext($this->prev_link, $this->next_link);
427 if ($presentation->render()) {
429 $this->tpl->setVariable(
'RESULTS_TABLE', $presentation->getHTML(
true));
441 $ilTabs = $DIC[
'ilTabs'];
442 $ilHelp = $DIC[
'ilHelp'];
444 parent::prepareOutput();
446 $ilHelp->setScreenIdComponent(
"src");
450 $this->lng->txt(
"search"),
451 $this->ctrl->getLinkTarget($this)
454 if (!$this->
settings->getHideAdvancedSearch()) {
457 $this->lng->txt(
"search_advanced"),
458 $this->ctrl->getLinkTargetByClass(
'iladvancedsearchgui')
462 $ilTabs->activateTab(
"search");
476 $crs_search->setFilter(array(
'crs'));
477 $result->mergeEntries($crs_search->performSearch());
482 $grp_search->setFilter(array(
'grp'));
483 $result->mergeEntries($grp_search->performSearch());
489 $result->mergeEntries($content_search->performSearch());
495 $result->mergeEntries($forum_search->performSearch());
501 $gdf_search->setFilter(array(
'gdf'));
502 $result->mergeEntries($gdf_search->performSearch());
505 $result->mergeEntries($gdf_term_search->performSearch());
511 $result->mergeEntries($exc_search->performSearch());
515 $mcst_search = &ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
516 $result->mergeEntries($mcst_search->performSearch());
522 $result->mergeEntries($tst_search->performSearch());
528 $result->mergeEntries($mep_search->performSearch());
533 $result->mergeEntries($mob_search->performKeywordSearch());
540 $result->mergeEntries($wiki_search->performSearch());
560 include_once
'Services/Search/classes/class.ilQueryParser.php';
564 $query_parser->parse();
566 if (!$query_parser->validate()) {
567 return $query_parser->getMessage();
569 return $query_parser;
578 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
586 return $obj_search->performSearch();
593 if (!$options[
'enabled']) {
599 switch ($options[
'ontype']) {
624 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
632 $meta_search->setMode(
'keyword');
636 $meta_search->setMode(
'contribute');
640 $meta_search->setMode(
'title');
644 $meta_search->setMode(
'description');
647 return $meta_search->performSearch();
660 foreach ($this->
getDetails() as $key => $detail_type) {
715 return $filter ? $filter : array();
730 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
734 if (
$_GET[
'page_number']) {
735 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
737 if (isset(
$_POST[
'cmd'][
'performSearch'])) {
740 $this->search_cache->save();
setType($a_type)
Set/get type of search (detail or 'fast' search) public.
read($a_type=DEFAULT_SEARCH)
read search results
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch
loadCreationFilter()
Load creation date filter.
& __performDetailsSearch(&$query_parser, &$result)
getSearchAreaForm()
Init standard search form.
performSearch()
Perform search.
GUI class for the workflow of copying objects.
const CDATE_OPERATOR_BEFORE
setCombination($a_combination)
Set/get combination of search ('and' or 'or') public.
static getList($a_str)
Get completion list.
static get($a_glyph, $a_text="")
Get glyph html.
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
Auto completion class for user lists.
const CDATE_OPERATOR_AFTER
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getInstance($a_usr_id)
Get singleton instance.
& __parseQueryString()
parse query string, using query parser instance
addPager($result, $a_session_key)
Add Pager.
foreach($_POST as $key=> $value) $res
Presentation of search results using object list gui.
initStandardSearchForm($a_mode)
Init standard search form.
static _getForumSearchInstance($query_parser)
get reference of ilFulltextForumSearch
setCreationDateFilterDate(ilDate $day)
Set creation date filter.
parseCreationFilter(ilObjectSearch $search)
setDetails($a_details)
Set/get details (object types for details search) public.
static _getExerciseSearchInstance($query_parser)
get reference of ilFulltextExerciseSearch
handleCommand($a_cmd)
Handle command.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setString($a_str)
Set/get search string public.
static _getGlossaryDefinitionSearchInstance($query_parser)
get reference of ilFulltextGlossaryDefinitionSearch
static _getMetaDataSearchInstance($query_parser)
get reference of ilFulltext/LikeMetaDataSearch.
& __searchObjects(&$query_parser)
Search in obect title,desctiption.
setCreationDateFilterOperator($a_operator)
__construct()
Constructor public.
initUserSearchCache()
Init user search cache.
storeRoot()
Store new root node.
static _getLMContentSearchInstance($query_parser)
get reference of ilFulltextLMContentSearch
__construct(Container $dic, ilPlugin $plugin)
__getFilter()
Get object type for filter (If detail search is enabled)
static _getObjectSearchInstance($query_parser)
get reference of ilFulltext/LikeObjectSearch.
static getLogger($a_component_id)
Get component logger.
executeCommand()
Control public.
static _getTestSearchInstance($query_parser)
get reference of ilFulltextTestSearch
const SEARCH_FORM_STANDARD
& __searchMeta(&$query_parser, $a_type)
Search in object meta data (keyword)
getSearchCache()
Get user search cache.
autoComplete()
Data resource for autoComplete.
static initJavascript()
Init javascript.