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) {
60 $this->root_node =
$_SESSION[
'search_root'] ?
$_SESSION[
'search_root'] : ROOT_FOLDER_ID;
63 $this->
setString(
$_POST[
'search'][
'string'] ?
$_POST[
'search'][
'string'] : $_SESSION[
'search'][
'string']);
64 #$this->setDetails($_POST['search']['details'] ? $_POST['search']['details'] : $_SESSION['search']['details']); 65 $this->
setDetails($new_search ?
$_POST[
'search'][
'details'] : $_SESSION[
'search'][
'details']);
66 parent::__construct();
80 $next_class = $this->ctrl->getNextClass($this);
81 $cmd = $this->ctrl->getCmd();
83 switch ($next_class) {
84 case "ilpropertyformgui":
88 $ilCtrl->setReturn($this,
'storeRoot');
89 return $ilCtrl->forwardCommand(
$form);
91 case 'ilobjectcopygui':
93 $this->ctrl->setReturn($this,
'');
94 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
96 $this->ctrl->forwardCommand($cp);
102 $cmd =
"showSavedResults";
129 $_SESSION[
'search'][
'combination'] = $this->combination = $a_combination;
141 $_SESSION[
'search'][
'string'] = $this->
string = $a_str;
153 $_SESSION[
'search'][
'details'] = $this->details = $a_details;
157 return $this->details ? $this->details :
array();
163 return $this->root_node ? $this->root_node : ROOT_FOLDER_ID;
167 $_SESSION[
'search_root'] = $this->root_node = $a_node_id;
185 $this->root_node =
$form->getItemByPostVar(
'area')->getValue();
186 $this->search_cache->setRoot($this->root_node);
187 $this->search_cache->save();
188 $this->search_cache->deleteCachedEntries();
190 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
201 if ((
int) $_REQUEST[
'search_type'] == -1) {
202 $a_fields =
array(
'login',
'firstname',
'lastname',
'email');
203 $result_field =
'login';
206 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
210 $auto->setMoreLinkAvailable(
true);
211 $auto->setSearchFields($a_fields);
212 $auto->setResultField($result_field);
213 $auto->enableFieldSearchableCheck(
true);
214 $auto->setUserLimitations(
true);
216 $res = $auto->getList($_REQUEST[
'term']);
218 $res_obj = json_decode(
$res);
224 if (is_array($res_obj->items)) {
225 echo json_encode($res_obj->items);
229 $q = $_REQUEST[
"term"];
230 include_once(
"./Services/Search/classes/class.ilSearchAutoComplete.php");
243 include_once(
"./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
245 $this->tpl->addJavascript(
"./Services/Search/js/Search.js");
247 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
249 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.search.html',
'Services/Search');
250 $this->tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this,
'performSearch'));
252 include_once(
"./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
254 $btn->setCommand(
"performSearch");
255 $btn->setCaption(
"search");
256 $this->tpl->setVariable(
"SUBMIT_BTN", $btn->render());
257 $this->tpl->setVariable(
"TXT_OPTIONS", $lng->txt(
"options"));
259 $this->tpl->setVariable(
"TXT_COMBINATION", $lng->txt(
"search_term_combination"));
263 $this->tpl->setCurrentBlock(
"type_sel");
264 $this->tpl->setVariable(
'TXT_TYPE_DEFAULT', $lng->txt(
"search_fast_info"));
265 $this->tpl->setVariable(
"TXT_TYPE", $lng->txt(
"search_type"));
268 $this->tpl->setVariable(
"FORM", $this->form->getHTML());
269 $this->tpl->parseCurrentBlock();
274 $this->tpl->setVariable(
'TXT_FILTER_BY_CDATE', $this->lng->txt(
'search_filter_cd'));
275 $this->tpl->setVariable(
'TXT_CD_OFF', $this->lng->txt(
'search_off'));
282 $this->tpl->setVariable(
"TXT_AREA", $lng->txt(
"search_area"));
285 $this->tpl->setVariable(
'SEARCH_AREA_FORM', $this->
getSearchAreaForm()->getHTML());
295 include_once
'Services/Search/classes/class.ilSearchResult.php';
304 if (count($result_obj->getResults())) {
305 $this->
addPager($result_obj,
'max_page');
307 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
309 $presentation->setResults($result_obj->getResultsForPresentation());
310 $presentation->setSubitemIds($result_obj->getSubitemIds());
311 $presentation->setPreviousNext($this->prev_link, $this->next_link);
312 #$presentation->setSearcher($searcher); 314 if ($presentation->render()) {
316 $this->tpl->setVariable(
'RESULTS_TABLE', $presentation->getHTML(
true));
331 if (!isset(
$_GET[
'page_number']) and $this->search_mode !=
'in_results') {
333 $this->search_cache->deleteCachedEntries();
353 $result_meta =&$this->
__searchMeta($query_parser,
'keyword');
354 $result->mergeEntries($result_meta);
356 $result_meta =&$this->
__searchMeta($query_parser,
'contribute');
357 $result->mergeEntries($result_meta);
359 $result_meta =&$this->
__searchMeta($query_parser,
'title');
360 $result->mergeEntries($result_meta);
362 $result_meta =&$this->
__searchMeta($query_parser,
'description');
363 $result->mergeEntries($result_meta);
370 if ($this->search_mode ==
'in_results') {
371 include_once
'Services/Search/classes/class.ilSearchResult.php';
374 $old_result_obj->
read();
376 $result->diffEntriesFromResult($old_result_obj);
385 if (!count(
$result->getResults())) {
389 if (
$result->isLimitReached()) {
390 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 391 #ilUtil::sendInfo($message); 397 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
399 $presentation->setResults(
$result->getResultsForPresentation());
400 $presentation->setSubitemIds(
$result->getSubitemIds());
401 $presentation->setPreviousNext($this->prev_link, $this->next_link);
403 if ($presentation->render()) {
405 $this->tpl->setVariable(
'RESULTS_TABLE', $presentation->getHTML(
true));
415 global $ilTabs, $ilHelp;
417 parent::prepareOutput();
419 $ilHelp->setScreenIdComponent(
"src");
423 $this->lng->txt(
"search"),
424 $this->ctrl->getLinkTarget($this)
427 if (!$this->
settings->getHideAdvancedSearch()) {
430 $this->lng->txt(
"search_advanced"),
431 $this->ctrl->getLinkTargetByClass(
'iladvancedsearchgui')
435 $ilTabs->activateTab(
"search");
449 $crs_search->setFilter(
array(
'crs'));
450 $result->mergeEntries($crs_search->performSearch());
455 $grp_search->setFilter(
array(
'grp'));
456 $result->mergeEntries($grp_search->performSearch());
462 $result->mergeEntries($content_search->performSearch());
468 $result->mergeEntries($forum_search->performSearch());
474 $gdf_search->setFilter(
array(
'gdf'));
475 $result->mergeEntries($gdf_search->performSearch());
478 $result->mergeEntries($gdf_term_search->performSearch());
484 $result->mergeEntries($exc_search->performSearch());
488 $mcst_search =&ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
489 $result->mergeEntries($mcst_search->performSearch());
495 $result->mergeEntries($tst_search->performSearch());
501 $result->mergeEntries($mep_search->performSearch());
506 $result->mergeEntries($mob_search->performKeywordSearch());
513 $result->mergeEntries($wiki_search->performSearch());
533 include_once
'Services/Search/classes/class.ilQueryParser.php';
537 $query_parser->parse();
539 if (!$query_parser->validate()) {
540 return $query_parser->getMessage();
542 return $query_parser;
551 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
559 return $obj_search->performSearch();
597 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
605 $meta_search->setMode(
'keyword');
609 $meta_search->setMode(
'contribute');
613 $meta_search->setMode(
'title');
617 $meta_search->setMode(
'description');
620 return $meta_search->performSearch();
688 return $filter ? $filter :
array();
701 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
705 if (
$_GET[
'page_number']) {
706 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
708 if (isset(
$_POST[
'cmd'][
'performSearch'])) {
711 $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.
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)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
getSearchCache()
Get user search cache.
autoComplete()
Data resource for autoComplete.
static initJavascript()
Init javascript.