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) {
63 $this->root_node =
$_SESSION[
'search_root'] ?
$_SESSION[
'search_root'] : ROOT_FOLDER_ID;
66 $this->
setString(
$_POST[
'search'][
'string'] ?
$_POST[
'search'][
'string'] : $_SESSION[
'search'][
'string']);
67 #$this->setDetails($_POST['search']['details'] ? $_POST['search']['details'] : $_SESSION['search']['details']); 68 $this->
setDetails($new_search ?
$_POST[
'search'][
'details'] : $_SESSION[
'search'][
'details']);
69 parent::__construct();
81 $rbacsystem = $DIC[
'rbacsystem'];
86 $next_class = $this->ctrl->getNextClass($this);
87 $cmd = $this->ctrl->getCmd();
89 switch ($next_class) {
90 case "ilpropertyformgui":
94 $ilCtrl->setReturn($this,
'storeRoot');
97 case 'ilobjectcopygui':
99 $this->ctrl->setReturn($this,
'');
100 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
102 $this->ctrl->forwardCommand($cp);
108 $cmd =
"showSavedResults";
135 $_SESSION[
'search'][
'combination'] = $this->combination = $a_combination;
147 $_SESSION[
'search'][
'string'] = $this->
string = $a_str;
159 $_SESSION[
'search'][
'details'] = $this->details = $a_details;
163 return $this->details ? $this->details : array();
169 return $this->root_node ? $this->root_node : ROOT_FOLDER_ID;
173 $_SESSION[
'search_root'] = $this->root_node = $a_node_id;
191 $this->root_node =
$form->getItemByPostVar(
'area')->getValue();
192 $this->search_cache->setRoot($this->root_node);
193 $this->search_cache->save();
194 $this->search_cache->deleteCachedEntries();
196 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
207 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)) {
231 echo json_encode($res_obj->items);
235 $q = $_REQUEST[
"term"];
236 include_once(
"./Services/Search/classes/class.ilSearchAutoComplete.php");
248 $ilLocator = $DIC[
'ilLocator'];
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 $this->tpl->setVariable(
"SEARCH_LABEL",
$lng->txt(
"search"));
263 include_once(
"./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
265 $btn->setCommand(
"performSearch");
266 $btn->setCaption(
"search");
267 $this->tpl->setVariable(
"SUBMIT_BTN", $btn->render());
268 $this->tpl->setVariable(
"TXT_OPTIONS",
$lng->txt(
"options"));
270 $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();
285 $this->tpl->setVariable(
'TXT_FILTER_BY_CDATE', $this->lng->txt(
'search_filter_cd'));
286 $this->tpl->setVariable(
'TXT_CD_OFF', $this->lng->txt(
'search_off'));
293 $this->tpl->setVariable(
"TXT_AREA",
$lng->txt(
"search_area"));
296 $this->tpl->setVariable(
'SEARCH_AREA_FORM', $this->
getSearchAreaForm()->getHTML());
308 include_once
'Services/Search/classes/class.ilSearchResult.php';
317 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()) {
329 $this->tpl->setVariable(
'RESULTS_TABLE', $presentation->getHTML(
true));
346 if (!isset(
$_GET[
'page_number'])
and $this->search_mode !=
'in_results') {
348 $this->search_cache->deleteCachedEntries();
368 $result_meta = &$this->
__searchMeta($query_parser,
'keyword');
369 $result->mergeEntries($result_meta);
371 $result_meta = &$this->
__searchMeta($query_parser,
'contribute');
372 $result->mergeEntries($result_meta);
374 $result_meta = &$this->
__searchMeta($query_parser,
'title');
375 $result->mergeEntries($result_meta);
377 $result_meta = &$this->
__searchMeta($query_parser,
'description');
378 $result->mergeEntries($result_meta);
385 if ($this->search_mode ==
'in_results') {
386 include_once
'Services/Search/classes/class.ilSearchResult.php';
389 $old_result_obj->
read();
391 $result->diffEntriesFromResult($old_result_obj);
400 if (!count(
$result->getResults())) {
404 if (
$result->isLimitReached()) {
405 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 406 #ilUtil::sendInfo($message); 412 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
414 $presentation->setResults(
$result->getResultsForPresentation());
415 $presentation->setSubitemIds(
$result->getSubitemIds());
416 $presentation->setPreviousNext($this->prev_link, $this->next_link);
418 if ($presentation->render()) {
420 $this->tpl->setVariable(
'RESULTS_TABLE', $presentation->getHTML(
true));
432 $ilTabs = $DIC[
'ilTabs'];
433 $ilHelp = $DIC[
'ilHelp'];
435 parent::prepareOutput();
437 $ilHelp->setScreenIdComponent(
"src");
441 $this->lng->txt(
"search"),
442 $this->ctrl->getLinkTarget($this)
445 if (!$this->
settings->getHideAdvancedSearch()) {
448 $this->lng->txt(
"search_advanced"),
449 $this->ctrl->getLinkTargetByClass(
'iladvancedsearchgui')
453 $ilTabs->activateTab(
"search");
467 $crs_search->setFilter(array(
'crs'));
468 $result->mergeEntries($crs_search->performSearch());
473 $grp_search->setFilter(array(
'grp'));
474 $result->mergeEntries($grp_search->performSearch());
480 $result->mergeEntries($content_search->performSearch());
486 $result->mergeEntries($forum_search->performSearch());
492 $gdf_search->setFilter(array(
'gdf'));
493 $result->mergeEntries($gdf_search->performSearch());
496 $result->mergeEntries($gdf_term_search->performSearch());
502 $result->mergeEntries($exc_search->performSearch());
506 $mcst_search = &ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
507 $result->mergeEntries($mcst_search->performSearch());
513 $result->mergeEntries($tst_search->performSearch());
519 $result->mergeEntries($mep_search->performSearch());
524 $result->mergeEntries($mob_search->performKeywordSearch());
531 $result->mergeEntries($wiki_search->performSearch());
551 include_once
'Services/Search/classes/class.ilQueryParser.php';
555 $query_parser->parse();
557 if (!$query_parser->validate()) {
558 return $query_parser->getMessage();
560 return $query_parser;
569 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
577 return $obj_search->performSearch();
615 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
623 $meta_search->setMode(
'keyword');
627 $meta_search->setMode(
'contribute');
631 $meta_search->setMode(
'title');
635 $meta_search->setMode(
'description');
638 return $meta_search->performSearch();
706 return $filter ? $filter : array();
721 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
725 if (
$_GET[
'page_number']) {
726 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
728 if (isset(
$_POST[
'cmd'][
'performSearch'])) {
731 $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.
if(isset($_REQUEST['delete'])) $list
& __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
if(isset($_POST['submit'])) $form
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
__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.