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)
51 if(
$_POST[
'filter_type'][$type] == 1)
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']);
68 parent::__construct();
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 $this->ctrl->setReturn($this,
'');
97 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
99 $this->ctrl->forwardCommand($cp);
106 $cmd =
"showSavedResults";
133 $_SESSION[
'search'][
'combination'] = $this->combination = $a_combination;
145 $_SESSION[
'search'][
'string'] = $this->
string = $a_str;
157 $_SESSION[
'search'][
'details'] = $this->details = $a_details;
161 return $this->details ? $this->details :
array();
167 return $this->root_node ? $this->root_node : ROOT_FOLDER_ID;
171 $_SESSION[
'search_root'] = $this->root_node = $a_node_id;
190 $this->root_node = $form->getItemByPostVar(
'area')->getValue();
191 $this->search_cache->setRoot($this->root_node);
192 $this->search_cache->save();
193 $this->search_cache->deleteCachedEntries();
195 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
206 if((
int) $_REQUEST[
'search_type'] == -1)
208 $a_fields =
array(
'login',
'firstname',
'lastname',
'email');
209 $result_field =
'login';
212 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
216 $auto->setMoreLinkAvailable(
true);
217 $auto->setSearchFields($a_fields);
218 $auto->setResultField($result_field);
219 $auto->enableFieldSearchableCheck(
true);
220 $auto->setUserLimitations(
true);
222 $res = $auto->getList($_REQUEST[
'term']);
224 $res_obj = json_decode(
$res);
230 if(is_array($res_obj->items))
232 echo json_encode($res_obj->items);
239 $q = $_REQUEST[
"term"];
240 include_once(
"./Services/Search/classes/class.ilSearchAutoComplete.php");
253 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
255 $this->tpl->addJavascript(
"./Services/Search/js/Search.js");
257 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
259 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.search.html',
'Services/Search');
260 $this->tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this,
'performSearch'));
262 include_once(
"./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
264 $btn->setCommand(
"performSearch");
265 $btn->setCaption(
"search");
266 $this->tpl->setVariable(
"SUBMIT_BTN",$btn->render());
267 $this->tpl->setVariable(
"TXT_OPTIONS", $lng->txt(
"options"));
269 $this->tpl->setVariable(
"TXT_COMBINATION", $lng->txt(
"search_term_combination"));
274 $this->tpl->setCurrentBlock(
"type_sel");
275 $this->tpl->setVariable(
'TXT_TYPE_DEFAULT',$lng->txt(
"search_fast_info"));
276 $this->tpl->setVariable(
"TXT_TYPE", $lng->txt(
"search_type"));
279 $this->tpl->setVariable(
"FORM", $this->form->getHTML());
280 $this->tpl->parseCurrentBlock();
286 $this->tpl->setVariable(
'TXT_FILTER_BY_CDATE',$this->lng->txt(
'search_filter_cd'));
287 $this->tpl->setVariable(
'TXT_CD_OFF',$this->lng->txt(
'search_off'));
294 $this->tpl->setVariable(
"TXT_AREA", $lng->txt(
"search_area"));
297 $this->tpl->setVariable(
'SEARCH_AREA_FORM', $this->
getSearchAreaForm()->getHTML());
307 include_once
'Services/Search/classes/class.ilSearchResult.php';
316 if(count($result_obj->getResults()))
318 $this->
addPager($result_obj,
'max_page');
320 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
322 $presentation->setResults($result_obj->getResultsForPresentation());
323 $presentation->setSubitemIds($result_obj->getSubitemIds());
324 $presentation->setPreviousNext($this->prev_link, $this->next_link);
325 #$presentation->setSearcher($searcher); 327 if($presentation->render())
330 $this->tpl->setVariable(
'RESULTS_TABLE',$presentation->getHTML(
true));
345 if(!isset(
$_GET[
'page_number'])
and $this->search_mode !=
'in_results' )
348 $this->search_cache->deleteCachedEntries();
370 $result_meta =& $this->
__searchMeta($query_parser,
'keyword');
371 $result->mergeEntries($result_meta);
373 $result_meta =& $this->
__searchMeta($query_parser,
'contribute');
374 $result->mergeEntries($result_meta);
376 $result_meta =& $this->
__searchMeta($query_parser,
'title');
377 $result->mergeEntries($result_meta);
379 $result_meta =& $this->
__searchMeta($query_parser,
'description');
380 $result->mergeEntries($result_meta);
388 if($this->search_mode ==
'in_results')
390 include_once
'Services/Search/classes/class.ilSearchResult.php';
393 $old_result_obj->
read();
395 $result->diffEntriesFromResult($old_result_obj);
404 if(!count(
$result->getResults()))
411 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 412 #ilUtil::sendInfo($message); 418 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
420 $presentation->setResults(
$result->getResultsForPresentation());
421 $presentation->setSubitemIds(
$result->getSubitemIds());
422 $presentation->setPreviousNext($this->prev_link, $this->next_link);
424 if($presentation->render())
427 $this->tpl->setVariable(
'RESULTS_TABLE',$presentation->getHTML(
true));
437 global $ilTabs, $ilHelp;
439 parent::prepareOutput();
441 $ilHelp->setScreenIdComponent(
"src");
443 $ilTabs->addTab(
"search", $this->lng->txt(
"search"),
444 $this->ctrl->getLinkTarget($this));
446 if (!$this->
settings->getHideAdvancedSearch())
448 $ilTabs->addTab(
"adv_search", $this->lng->txt(
"search_advanced"),
449 $this->ctrl->getLinkTargetByClass(
'iladvancedsearchgui'));
452 $ilTabs->activateTab(
"search");
458 foreach($this->
getDetails() as $type => $enabled)
469 $crs_search->setFilter(
array(
'crs'));
470 $result->mergeEntries($crs_search->performSearch());
475 $grp_search->setFilter(
array(
'grp'));
476 $result->mergeEntries($grp_search->performSearch());
482 $result->mergeEntries($content_search->performSearch());
488 $result->mergeEntries($forum_search->performSearch());
494 $gdf_search->setFilter(
array(
'gdf'));
495 $result->mergeEntries($gdf_search->performSearch());
498 $result->mergeEntries($gdf_term_search->performSearch());
504 $result->mergeEntries($exc_search->performSearch());
508 $mcst_search =& ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
509 $result->mergeEntries($mcst_search->performSearch());
515 $result->mergeEntries($tst_search->performSearch());
521 $result->mergeEntries($mep_search->performSearch());
526 $result->mergeEntries($mob_search->performKeywordSearch());
533 $result->mergeEntries($wiki_search->performSearch());
553 include_once
'Services/Search/classes/class.ilQueryParser.php';
557 $query_parser->parse();
559 if(!$query_parser->validate())
561 return $query_parser->getMessage();
563 return $query_parser;
572 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
581 return $obj_search->performSearch();
621 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
631 $meta_search->setMode(
'keyword');
635 $meta_search->setMode(
'contribute');
639 $meta_search->setMode(
'title');
643 $meta_search->setMode(
'description');
646 return $meta_search->performSearch();
660 foreach($this->
getDetails() as $key => $detail_type)
718 return $filter ? $filter :
array();
731 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
735 if(
$_GET[
'page_number'])
737 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
739 if(isset(
$_POST[
'cmd'][
'performSearch']))
743 $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.
if(!is_array($argv)) $options
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.
Create styles array
The data for the language used.
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
__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.