39 include_once
'Services/Search/classes/class.ilSearchBaseGUI.php';
40 include_once
'Services/MetaData/classes/class.ilMDUtilSelect.php';
41 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchFields.php';
70 $this->tabs_gui = $ilTabs;
72 parent::__construct();
74 $this->lng->loadLanguageModule(
'meta');
82 return ROOT_FOLDER_ID;
94 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd();
100 case 'ilobjectcopygui':
102 $this->ctrl->setReturn($this,
'');
104 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
106 $this->ctrl->forwardCommand($cp);
113 switch(
$_SESSION[
'search_last_sub_section'])
115 case self::TYPE_ADV_MD:
116 $cmd =
"showSavedAdvMDResults";
120 $cmd =
"showSavedResults";
134 $this->options =
array();
135 $this->search_cache->setQuery(
array());
136 $this->search_cache->save();
143 $this->search_mode =
'in_results';
144 $this->search_cache->setResultPageNumber(1);
156 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
157 $this->search_cache->setResultPageNumber(1);
159 $this->search_cache->save();
161 $this->options = $this->search_cache->getQuery();
162 $this->options[
'type'] =
'all';
175 if(!isset(
$_GET[
'page_number'])
and $this->search_mode !=
'in_results' )
178 $this->search_cache->deleteCachedEntries();
181 if(isset(
$_POST[
'query']))
183 $this->search_cache->setQuery(
$_POST[
'query']);
187 include_once
'Services/Search/classes/class.ilSearchResult.php';
249 if($this->search_mode ==
'in_results')
251 include_once
'Services/Search/classes/class.ilSearchResult.php';
256 $res->diffEntriesFromResult($old_result_obj);
263 if(!count(
$res->getResults()))
268 if(
$res->isLimitReached())
270 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 271 #ilUtil::sendInfo($message); 276 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
278 $presentation->setResults(
$res->getResultsForPresentation());
279 $presentation->setPreviousNext($this->prev_link, $this->next_link);
281 if($presentation->render())
283 $this->tpl->setVariable(
'RESULTS',$presentation->getHTML(
true));
295 if(is_object($this->form))
300 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
301 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
303 $this->form->setFormAction($this->ctrl->getFormAction($this,
'performAdvMDSearch'));
304 $this->form->setTitle($this->lng->txt(
'adv_md_search_title'));
305 $this->form->addCommandButton(
'performAdvMDSearch',$this->lng->txt(
'search'));
306 #$this->form->setSubformMode('right'); 309 $this->lng->txt(
'meta_keyword').
'/'.
310 $this->lng->txt(
'meta_description'),
'title');
311 $content->
setValue($this->options[
'title']);
312 $content->setSize(30);
313 $content->setMaxLength(255);
316 $group->setValue($this->options[
'title_ao']);
317 $radio_option =
new ilRadioOption($this->lng->txt(
"search_any_word"),0);
318 $group->addOption($radio_option);
319 $radio_option =
new ilRadioOption($this->lng->txt(
"search_all_words"),1);
320 $group->addOption($radio_option);
322 $this->form->addItem($content);
325 $options[
'adv_all'] = $this->lng->txt(
'search_any');
328 $options[$obj_type] = $this->lng->txt(
'objs_'.$obj_type);
331 $type->setValue($this->options[
'type']);
332 $this->form->addItem($type);
334 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
336 $record_gui->setPropertyForm($this->form);
337 $record_gui->setSearchValues($this->options);
338 $record_gui->parse();
351 if(!isset(
$_GET[
'page_number'])
and $this->search_mode !=
'in_results' )
354 $this->search_cache->delete();
357 include_once
'Services/Search/classes/class.ilSearchResult.php';
366 if($this->search_mode ==
'in_results')
368 include_once
'Services/Search/classes/class.ilSearchResult.php';
373 $res->diffEntriesFromResult($old_result_obj);
381 if(!count(
$res->getResults()))
386 if(
$res->isLimitReached())
388 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 389 #ilUtil::sendInfo($message); 394 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
396 $presentation->setResults(
$res->getResultsForPresentation());
397 $presentation->setPreviousNext($this->prev_link, $this->next_link);
399 if($presentation->render())
401 $this->tpl->setVariable(
'RESULTS',$presentation->getHTML(
true));
417 $this->options =
$_SESSION[
'search_adv_md'];
420 $this->tabs_gui->setSubTabActive(
'search_adv_md');
422 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.advanced_adv_search.html',
'Services/Search');
425 $this->tpl->setVariable(
'SEARCH_FORM',$this->form->getHTML());
436 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
439 $this->form->setFormAction($this->ctrl->getFormAction($this,
'performSearch'));
440 $this->form->setTitle($this->lng->txt(
'search_advanced'));
441 $this->form->addCommandButton(
'performSearch',$this->lng->txt(
'search'));
442 $this->form->addCommandButton(
'reset',$this->lng->txt(
'reset'));
444 foreach($this->
fields->getActiveSections() as $definition)
446 if($definition[
'name'] !=
'default')
449 $section->setTitle($definition[
'name']);
453 foreach($definition[
'fields'] as $field_name)
455 if(is_object($element = $this->
fields->getFormElement($this->search_cache->getQuery(),$field_name,$this->form)))
457 $this->form->addItem($element);
471 $this->tabs_gui->setSubTabActive(
'search_lom');
473 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.advanced_search.html',
'Services/Search');
476 $this->tpl->setVariable(
'SEARCH_FORM',$this->form->getHTML());
482 global $ilTabs, $ilHelp;
484 parent::prepareOutput();
486 $ilHelp->setScreenIdComponent(
"src");
488 $ilTabs->addTab(
"search", $this->lng->txt(
"search"),
489 $this->ctrl->getLinkTargetByClass(
'ilsearchgui'));
490 $ilTabs->addTab(
"adv_search", $this->lng->txt(
"search_advanced"),
491 $this->ctrl->getLinkTarget($this));
492 $ilTabs->activateTab(
"adv_search");
507 include_once
'Services/Search/classes/class.ilSearchResult.php';
516 if(count($result_obj->getResults()))
518 $this->
addPager($result_obj,
'adv_max_page');
520 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
522 $presentation->setResults($result_obj->getResultsForPresentation());
523 $presentation->setPreviousNext($this->prev_link, $this->next_link);
525 if($presentation->render())
527 $this->tpl->setVariable(
'RESULTS',$presentation->getHTML(
true));
540 include_once
'Services/Search/classes/class.ilSearchResult.php';
549 if(count($result_obj->getResults()))
551 $this->
addPager($result_obj,
'adv_max_page');
553 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
555 $presentation->setResults($result_obj->getResultsForPresentation());
556 $presentation->setPreviousNext($this->prev_link, $this->next_link);
558 if($presentation->render())
560 $this->tpl->setVariable(
'RESULTS',$presentation->getHTML(
true));
569 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
570 include_once
'Services/Search/classes/class.ilQueryParser.php';
571 include_once
'Services/Search/classes/class.ilSearchResult.php';
573 if(!$this->options[
'lom_content'])
581 #$query_parser->setCombination($this->options['content_ao']); 583 $query_parser->parse();
585 if($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'lms')
589 $res_cont =& $lm_search->performSearch();
590 $res->mergeEntries($res_cont);
592 if($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'tst')
595 $res_tes =& $tst_search->performSearch();
596 $res->mergeEntries($res_tes);
598 if($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'mep')
601 $res_med =& $med_search->performSearch();
602 $res->mergeEntries($res_med);
604 if($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'glo')
607 $res_glo =& $glo_search->performSearch();
608 $res->mergeEntries($res_glo);
610 if($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'webr')
613 $res_web =& $web_search->performSearch();
614 $res->mergeEntries($res_web);
618 $res->mergeEntries($tit_res);
627 if(!$this->options[
'lom_content'])
632 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
633 include_once
'Services/Search/classes/class.ilQueryParser.php';
636 #$query_parser->setCombination($this->options['title_ao']); 638 $query_parser->parse();
641 $meta_search->setFilter($this->filter);
642 $meta_search->setMode(
'title_description');
643 $meta_search->setOptions($this->options);
644 $res_tit =& $meta_search->performSearch();
646 $meta_search->setMode(
'keyword_all');
647 $res_key =& $meta_search->performSearch();
650 $res_tit->mergeEntries($res_key);
660 if(!$this->options[
'lom_coverage']
and !$this->options[
'lom_structure'])
665 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
666 include_once
'Services/Search/classes/class.ilQueryParser.php';
668 if($this->options[
'lom_coverage'])
671 #$query_parser->setCombination($this->options['coverage_ao']); 673 $query_parser->parse();
680 $meta_search->setFilter($this->filter);
681 $meta_search->setMode(
'general');
682 $meta_search->setOptions($this->options);
683 $res =& $meta_search->performSearch();
691 if(!$this->options[
'lom_status']
and !$this->options[
'lom_version'])
695 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
696 include_once
'Services/Search/classes/class.ilQueryParser.php';
699 #$query_parser->setCombination($this->options['version_ao']); 701 $query_parser->parse();
704 $meta_search->setFilter($this->filter);
705 $meta_search->setMode(
'lifecycle');
706 $meta_search->setOptions($this->options);
707 $res =& $meta_search->performSearch();
713 if(!$this->options[
'lom_language'])
717 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
718 include_once
'Services/Search/classes/class.ilQueryParser.php';
722 $meta_search->setFilter($this->filter);
723 $meta_search->setMode(
'language');
724 $meta_search->setOptions($this->options);
725 $res =& $meta_search->performSearch();
731 if(!strlen($this->options[
'lom_role']))
735 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
736 include_once
'Services/Search/classes/class.ilQueryParser.php';
740 $meta_search->setFilter($this->filter);
741 $meta_search->setMode(
'contribute');
742 $meta_search->setOptions($this->options);
743 $res =& $meta_search->performSearch();
750 if(!$this->options[
'lom_role_entry'])
755 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
756 include_once
'Services/Search/classes/class.ilQueryParser.php';
759 #$query_parser->setCombination($this->options['entity_ao']); 761 $query_parser->parse();
764 $meta_search->setFilter($this->filter);
765 $meta_search->setMode(
'entity');
766 $meta_search->setOptions($this->options);
767 $res =& $meta_search->performSearch();
775 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
776 include_once
'Services/Search/classes/class.ilQueryParser.php';
780 $meta_search->setFilter($this->filter);
781 $meta_search->setMode(
'requirement');
782 $meta_search->setOptions($this->options);
783 $res =& $meta_search->performSearch();
789 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
790 include_once
'Services/Search/classes/class.ilQueryParser.php';
794 $meta_search->setFilter($this->filter);
795 $meta_search->setMode(
'format');
796 $meta_search->setOptions($this->options);
797 $res =& $meta_search->performSearch();
803 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
804 include_once
'Services/Search/classes/class.ilQueryParser.php';
808 $meta_search->setFilter($this->filter);
809 $meta_search->setMode(
'educational');
810 $meta_search->setOptions($this->options);
811 $res =& $meta_search->performSearch();
817 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
818 include_once
'Services/Search/classes/class.ilQueryParser.php';
822 $meta_search->setFilter($this->filter);
823 $meta_search->setMode(
'typical_age_range');
824 $meta_search->setOptions($this->options);
825 $res =& $meta_search->performSearch();
831 if(!$this->options[
'lom_copyright']
and !$this->options[
'lom_costs'])
835 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
836 include_once
'Services/Search/classes/class.ilQueryParser.php';
840 $meta_search->setFilter($this->filter);
841 $meta_search->setMode(
'rights');
842 $meta_search->setOptions($this->options);
843 $res =& $meta_search->performSearch();
851 if(!$this->options[
'lom_purpose'])
855 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
856 include_once
'Services/Search/classes/class.ilQueryParser.php';
860 $meta_search->setFilter($this->filter);
861 $meta_search->setMode(
'classification');
862 $meta_search->setOptions($this->options);
863 $res =& $meta_search->performSearch();
871 if(!$this->options[
'lom_taxon'])
875 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
876 include_once
'Services/Search/classes/class.ilQueryParser.php';
880 $query_parser->parse();
883 $meta_search->setFilter($this->filter);
884 $meta_search->setMode(
'taxon');
885 $meta_search->setOptions($this->options);
886 $res =& $meta_search->performSearch();
902 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
903 foreach(array_keys($this->options) as $key)
905 if(substr($key,0,3) !=
'adv')
916 $field_id = substr($key,4);
919 $field_form =
ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(),
true,
false);
920 $field_form->setElementId(
"query[".$key.
"]");
921 $field_form->setForm($this->form);
924 $field_form->importFromPost($this->options);
925 $field_form->validate();
927 $parser_value = $field->getSearchQueryParserValue($field_form);
929 include_once
'Services/Search/classes/class.ilQueryParser.php';
930 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
932 $adv_md_search->setFilter($this->filter);
933 $adv_md_search->setDefinition($field);
934 $adv_md_search->setSearchElement($field_form);
935 $res_field = $adv_md_search->performSearch();
946 if(!$this->options[
'lom_keyword'])
950 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
951 include_once
'Services/Search/classes/class.ilQueryParser.php';
954 #$query_parser->setCombination($this->options['keyword_ao']); 956 $query_parser->parse();
959 $meta_search->setFilter($this->filter);
960 $meta_search->setMode(
'keyword');
961 $meta_search->setOptions($this->options);
962 $res =& $meta_search->performSearch();
969 if(isset(
$_POST[
'cmd'][
'performSearch']))
973 elseif(isset(
$_POST[
'cmd'][
'performAdvMDSearch']))
979 $this->options =
$_SESSION[
'search_adv'];
984 $this->filter =
array();
986 $this->options[
'type'] =
'all';
987 switch($this->options[
'type'])
990 $this->filter[] =
'cat';
994 $this->filter[] =
'webr';
998 $this->filter[] =
'lm';
999 $this->filter[] =
'dbk';
1000 $this->filter[] =
'pg';
1001 $this->filter[] =
'st';
1002 $this->filter[] =
'sahs';
1003 $this->filter[] =
'htlm';
1007 $this->filter[] =
'glo';
1011 $this->filter[] =
'tst';
1012 $this->filter[] =
'svy';
1013 $this->filter[] =
'qpl';
1014 $this->filter[] =
'spl';
1018 $this->filter[] =
'mep';
1022 $this->filter[] =
'crs';
1026 $this->filter[] =
'file';
1030 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1036 $this->filter[] =
'webr';
1037 $this->filter[] =
'crs';
1038 $this->filter[] =
'mep';
1039 $this->filter[] =
'tst';
1040 $this->filter[] =
'svy';
1041 $this->filter[] =
'qpl';
1042 $this->filter[] =
'spl';
1043 $this->filter[] =
'glo';
1044 $this->filter[] =
'lm';
1045 $this->filter[] =
'dbk';
1046 $this->filter[] =
'pg';
1047 $this->filter[] =
'st';
1048 $this->filter[] =
'sahs';
1049 $this->filter[] =
'htlm';
1050 $this->filter[] =
'file';
1058 'crs' => $this->lng->txt(
'objs_crs'),
1059 'lms' => $this->lng->txt(
'learning_resources'),
1060 'glo' => $this->lng->txt(
'objs_glo'),
1061 'mep' => $this->lng->txt(
'objs_mep'),
1062 'tst' => $this->lng->txt(
'search_tst_svy'),
1063 'file'=> $this->lng->txt(
'objs_file'),
1064 'webr' => $this->lng->txt(
'objs_webr'));
1073 if($this->stored ==
false)
1075 $res->mergeEntries($new_res);
1076 $this->stored =
true;
1082 $res->intersectEntries($new_res);
1097 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
1100 if(
$_GET[
'page_number'])
1102 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
1104 if(
$_POST[
'cmd'][
'performSearch'])
1107 $this->search_cache->save();
1121 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1126 $ilTabs->addSubTabTarget(
'search_lom',$this->ctrl->getLinkTarget($this,
'showSavedResults'));
1127 #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults')); 1140 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
1152 if($type == self::TYPE_LOM)
1154 $_SESSION[
'search_last_sub_section'] = self::TYPE_LOM;
1159 $_SESSION[
'search_last_sub_section'] = self::TYPE_ADV_MD;
read($a_type=DEFAULT_SEARCH)
read search results
This class represents an option in a radio group.
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
showAdvMDSearch()
Show advanced meta data search.
& __performRequirementSearch()
showSavedAdvMDResults()
show advanced meta data results
executeCommand()
Control public.
GUI class for the workflow of copying objects.
remoteSearch()
Search from main menu.
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
static _getWebresourceSearchInstance($query_parser)
get reference of ilFulltextWebresourceSearch
initFormSearch()
Show search form.
& __performEntitySearch()
& __performRightsSearch()
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
& __performContentSearch()
__construct()
Constructor public.
static getInstance()
Get singleton.
& __performClassificationSearch()
searchAdvancedMD($res)
Perform advanced meta data search.
static _getAdvancedMDSearchInstance($query_parser)
get advanced meta data search instance
& __performGeneralSearch()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getInstance($a_usr_id)
Get singleton instance.
$options
array of all options select boxes,'and' 'or' and query strings public
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
addSubItem($a_item)
Add Subitem.
performAdvMDSearch()
perform advanced meta data search
static getSearchableDefinitionIds()
Get searchable definition ids (performance is key)
& __performEducationalSearch()
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
This class represents a text property in a property form.
& __performLifecycleSearch()
handleCommand($a_cmd)
Handle command.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static _getGlossaryDefinitionSearchInstance($query_parser)
get reference of ilFulltextGlossaryDefinitionSearch
& __performKeywordSearch()
__setSearchOptions(&$post_vars)
static _getLMContentSearchInstance($query_parser)
get reference of ilFulltextLMContentSearch
& __performFormatSearch()
static _getActivatedObjTypes()
get activated obj types
initUserSearchCache()
Init user search cache.
static getInstance()
Get singleton instance.
initAdvancedMetaDataForm()
protected
& __performLanguageSearch()
setValue($a_value)
Set Value.
static _getTestSearchInstance($query_parser)
get reference of ilFulltextTestSearch
& __performContributeSearch()
toUnixTime($date, $time=array())
convert input array to unix time
& __performTypicalAgeRangeSearch()
__storeEntries($res, $new_res)