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();
97 switch ($next_class) {
98 case "ilpropertyformgui":
101 case 'ilobjectcopygui':
103 $this->ctrl->setReturn($this,
'');
105 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
107 $this->ctrl->forwardCommand($cp);
113 switch (
$_SESSION[
'search_last_sub_section']) {
114 case self::TYPE_ADV_MD:
115 $cmd =
"showSavedAdvMDResults";
119 $cmd =
"showSavedResults";
133 $this->options =
array();
134 $this->search_cache->setQuery(
array());
135 $this->search_cache->save();
142 $this->search_mode =
'in_results';
143 $this->search_cache->setResultPageNumber(1);
155 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
156 $this->search_cache->setResultPageNumber(1);
158 $this->search_cache->save();
160 $this->options = $this->search_cache->getQuery();
161 $this->options[
'type'] =
'all';
174 if (!isset(
$_GET[
'page_number']) and $this->search_mode !=
'in_results') {
176 $this->search_cache->deleteCachedEntries();
179 if (isset(
$_POST[
'query'])) {
180 $this->search_cache->setQuery(
$_POST[
'query']);
184 include_once
'Services/Search/classes/class.ilSearchResult.php';
232 if ($this->search_mode ==
'in_results') {
233 include_once
'Services/Search/classes/class.ilSearchResult.php';
238 $res->diffEntriesFromResult($old_result_obj);
245 if (!count(
$res->getResults())) {
249 if (
$res->isLimitReached()) {
250 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 251 #ilUtil::sendInfo($message); 256 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
258 $presentation->setResults(
$res->getResultsForPresentation());
259 $presentation->setPreviousNext($this->prev_link, $this->next_link);
261 if ($presentation->render()) {
262 $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
274 if (is_object($this->form)) {
278 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
279 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
281 $this->form->setFormAction($this->ctrl->getFormAction($this,
'performAdvMDSearch'));
282 $this->form->setTitle($this->lng->txt(
'adv_md_search_title'));
283 $this->form->addCommandButton(
'performAdvMDSearch', $this->lng->txt(
'search'));
284 #$this->form->setSubformMode('right'); 286 $content =
new ilTextInputGUI($this->lng->txt(
'meta_title') .
'/' .
287 $this->lng->txt(
'meta_keyword') .
'/' .
288 $this->lng->txt(
'meta_description'),
'title');
289 $content->
setValue($this->options[
'title']);
290 $content->setSize(30);
291 $content->setMaxLength(255);
294 $group->setValue($this->options[
'title_ao']);
295 $radio_option =
new ilRadioOption($this->lng->txt(
"search_any_word"), 0);
296 $group->addOption($radio_option);
297 $radio_option =
new ilRadioOption($this->lng->txt(
"search_all_words"), 1);
298 $group->addOption($radio_option);
300 $this->form->addItem($content);
303 $options[
'adv_all'] = $this->lng->txt(
'search_any');
305 $options[$obj_type] = $this->lng->txt(
'objs_' . $obj_type);
307 $type->setOptions($options);
308 $type->setValue($this->options[
'type']);
309 $this->form->addItem(
$type);
311 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
313 $record_gui->setPropertyForm($this->form);
314 $record_gui->setSearchValues($this->options);
315 $record_gui->parse();
328 if (!isset(
$_GET[
'page_number']) and $this->search_mode !=
'in_results') {
330 $this->search_cache->delete();
333 include_once
'Services/Search/classes/class.ilSearchResult.php';
341 if ($this->search_mode ==
'in_results') {
342 include_once
'Services/Search/classes/class.ilSearchResult.php';
347 $res->diffEntriesFromResult($old_result_obj);
355 if (!count(
$res->getResults())) {
359 if (
$res->isLimitReached()) {
360 #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 361 #ilUtil::sendInfo($message); 366 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
368 $presentation->setResults(
$res->getResultsForPresentation());
369 $presentation->setPreviousNext($this->prev_link, $this->next_link);
371 if ($presentation->render()) {
372 $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
386 $this->options =
$_SESSION[
'search_adv_md'];
389 $this->tabs_gui->setSubTabActive(
'search_adv_md');
391 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.advanced_adv_search.html',
'Services/Search');
394 $this->tpl->setVariable(
'SEARCH_FORM', $this->form->getHTML());
405 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
408 $this->form->setFormAction($this->ctrl->getFormAction($this,
'performSearch'));
409 $this->form->setTitle($this->lng->txt(
'search_advanced'));
410 $this->form->addCommandButton(
'performSearch', $this->lng->txt(
'search'));
411 $this->form->addCommandButton(
'reset', $this->lng->txt(
'reset'));
413 foreach ($this->
fields->getActiveSections() as $definition) {
414 if ($definition[
'name'] !=
'default') {
416 $section->setTitle($definition[
'name']);
420 foreach ($definition[
'fields'] as $field_name) {
421 if (is_object($element = $this->
fields->getFormElement($this->search_cache->getQuery(), $field_name,
$this->form))) {
422 $this->form->addItem($element);
436 $this->tabs_gui->setSubTabActive(
'search_lom');
438 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.advanced_search.html',
'Services/Search');
441 $this->tpl->setVariable(
'SEARCH_FORM', $this->form->getHTML());
447 global $ilTabs, $ilHelp;
449 parent::prepareOutput();
451 $ilHelp->setScreenIdComponent(
"src");
455 $this->lng->txt(
"search"),
456 $this->ctrl->getLinkTargetByClass(
'ilsearchgui')
460 $this->lng->txt(
"search_advanced"),
461 $this->ctrl->getLinkTarget($this)
463 $ilTabs->activateTab(
"adv_search");
478 include_once
'Services/Search/classes/class.ilSearchResult.php';
487 if (count($result_obj->getResults())) {
488 $this->
addPager($result_obj,
'adv_max_page');
490 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
492 $presentation->setResults($result_obj->getResultsForPresentation());
493 $presentation->setPreviousNext($this->prev_link, $this->next_link);
495 if ($presentation->render()) {
496 $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
509 include_once
'Services/Search/classes/class.ilSearchResult.php';
518 if (count($result_obj->getResults())) {
519 $this->
addPager($result_obj,
'adv_max_page');
521 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
523 $presentation->setResults($result_obj->getResultsForPresentation());
524 $presentation->setPreviousNext($this->prev_link, $this->next_link);
526 if ($presentation->render()) {
527 $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
536 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
537 include_once
'Services/Search/classes/class.ilQueryParser.php';
538 include_once
'Services/Search/classes/class.ilSearchResult.php';
540 if (!$this->options[
'lom_content']) {
547 #$query_parser->setCombination($this->options['content_ao']); 549 $query_parser->parse();
551 if ($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'lms') {
554 $res_cont =&$lm_search->performSearch();
555 $res->mergeEntries($res_cont);
557 if ($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'tst') {
559 $res_tes =&$tst_search->performSearch();
560 $res->mergeEntries($res_tes);
562 if ($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'mep') {
564 $res_med =&$med_search->performSearch();
565 $res->mergeEntries($res_med);
567 if ($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'glo') {
569 $res_glo =&$glo_search->performSearch();
570 $res->mergeEntries($res_glo);
572 if ($this->options[
'type'] ==
'all' or $this->options[
'type'] ==
'webr') {
574 $res_web =&$web_search->performSearch();
575 $res->mergeEntries($res_web);
578 $res->mergeEntries($tit_res);
587 if (!$this->options[
'lom_content']) {
591 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
592 include_once
'Services/Search/classes/class.ilQueryParser.php';
595 #$query_parser->setCombination($this->options['title_ao']); 597 $query_parser->parse();
600 $meta_search->setFilter($this->filter);
601 $meta_search->setMode(
'title_description');
602 $meta_search->setOptions($this->options);
603 $res_tit =&$meta_search->performSearch();
605 $meta_search->setMode(
'keyword_all');
606 $res_key =&$meta_search->performSearch();
609 $res_tit->mergeEntries($res_key);
619 if (!$this->options[
'lom_coverage'] and !$this->options[
'lom_structure']) {
623 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
624 include_once
'Services/Search/classes/class.ilQueryParser.php';
626 if ($this->options[
'lom_coverage']) {
628 #$query_parser->setCombination($this->options['coverage_ao']); 630 $query_parser->parse();
635 $meta_search->setFilter($this->filter);
636 $meta_search->setMode(
'general');
637 $meta_search->setOptions($this->options);
638 $res =&$meta_search->performSearch();
646 if (!$this->options[
'lom_status'] and !$this->options[
'lom_version']) {
649 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
650 include_once
'Services/Search/classes/class.ilQueryParser.php';
653 #$query_parser->setCombination($this->options['version_ao']); 655 $query_parser->parse();
658 $meta_search->setFilter($this->filter);
659 $meta_search->setMode(
'lifecycle');
660 $meta_search->setOptions($this->options);
661 $res =&$meta_search->performSearch();
667 if (!$this->options[
'lom_language']) {
670 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
671 include_once
'Services/Search/classes/class.ilQueryParser.php';
675 $meta_search->setFilter($this->filter);
676 $meta_search->setMode(
'language');
677 $meta_search->setOptions($this->options);
678 $res =&$meta_search->performSearch();
684 if (!strlen($this->options[
'lom_role'])) {
687 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
688 include_once
'Services/Search/classes/class.ilQueryParser.php';
692 $meta_search->setFilter($this->filter);
693 $meta_search->setMode(
'contribute');
694 $meta_search->setOptions($this->options);
695 $res =&$meta_search->performSearch();
702 if (!$this->options[
'lom_role_entry']) {
706 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
707 include_once
'Services/Search/classes/class.ilQueryParser.php';
710 #$query_parser->setCombination($this->options['entity_ao']); 712 $query_parser->parse();
715 $meta_search->setFilter($this->filter);
716 $meta_search->setMode(
'entity');
717 $meta_search->setOptions($this->options);
718 $res =&$meta_search->performSearch();
726 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
727 include_once
'Services/Search/classes/class.ilQueryParser.php';
731 $meta_search->setFilter($this->filter);
732 $meta_search->setMode(
'requirement');
733 $meta_search->setOptions($this->options);
734 $res =&$meta_search->performSearch();
740 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
741 include_once
'Services/Search/classes/class.ilQueryParser.php';
745 $meta_search->setFilter($this->filter);
746 $meta_search->setMode(
'format');
747 $meta_search->setOptions($this->options);
748 $res =&$meta_search->performSearch();
754 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
755 include_once
'Services/Search/classes/class.ilQueryParser.php';
759 $meta_search->setFilter($this->filter);
760 $meta_search->setMode(
'educational');
761 $meta_search->setOptions($this->options);
762 $res =&$meta_search->performSearch();
768 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
769 include_once
'Services/Search/classes/class.ilQueryParser.php';
773 $meta_search->setFilter($this->filter);
774 $meta_search->setMode(
'typical_age_range');
775 $meta_search->setOptions($this->options);
776 $res =&$meta_search->performSearch();
782 if (!$this->options[
'lom_copyright'] and !$this->options[
'lom_costs']) {
785 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
786 include_once
'Services/Search/classes/class.ilQueryParser.php';
790 $meta_search->setFilter($this->filter);
791 $meta_search->setMode(
'rights');
792 $meta_search->setOptions($this->options);
793 $res =&$meta_search->performSearch();
801 if (!$this->options[
'lom_purpose']) {
804 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
805 include_once
'Services/Search/classes/class.ilQueryParser.php';
809 $meta_search->setFilter($this->filter);
810 $meta_search->setMode(
'classification');
811 $meta_search->setOptions($this->options);
812 $res =&$meta_search->performSearch();
820 if (!$this->options[
'lom_taxon']) {
823 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
824 include_once
'Services/Search/classes/class.ilQueryParser.php';
828 $query_parser->parse();
831 $meta_search->setFilter($this->filter);
832 $meta_search->setMode(
'taxon');
833 $meta_search->setOptions($this->options);
834 $res =&$meta_search->performSearch();
850 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
851 foreach (array_keys($this->options) as
$key) {
852 if (substr($key, 0, 3) !=
'adv') {
861 $field_id = substr($key, 4);
864 $field_form =
ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(),
true,
false);
865 $field_form->setElementId(
"query[" . $key .
"]");
866 $field_form->setForm($this->form);
869 $field_form->importFromPost($this->options);
870 $field_form->validate();
872 $parser_value = $field->getSearchQueryParserValue($field_form);
874 include_once
'Services/Search/classes/class.ilQueryParser.php';
875 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
877 $adv_md_search->setFilter($this->filter);
878 $adv_md_search->setDefinition($field);
879 $adv_md_search->setSearchElement($field_form);
880 $res_field = $adv_md_search->performSearch();
890 if (!$this->options[
'lom_keyword']) {
893 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
894 include_once
'Services/Search/classes/class.ilQueryParser.php';
897 #$query_parser->setCombination($this->options['keyword_ao']); 899 $query_parser->parse();
902 $meta_search->setFilter($this->filter);
903 $meta_search->setMode(
'keyword');
904 $meta_search->setOptions($this->options);
905 $res =&$meta_search->performSearch();
912 if (isset(
$_POST[
'cmd'][
'performSearch'])) {
914 } elseif (isset(
$_POST[
'cmd'][
'performAdvMDSearch'])) {
917 $this->options =
$_SESSION[
'search_adv'];
922 $this->filter =
array();
924 $this->options[
'type'] =
'all';
925 switch ($this->options[
'type']) {
927 $this->filter[] =
'cat';
931 $this->filter[] =
'webr';
935 $this->filter[] =
'lm';
936 $this->filter[] =
'dbk';
937 $this->filter[] =
'pg';
938 $this->filter[] =
'st';
939 $this->filter[] =
'sahs';
940 $this->filter[] =
'htlm';
944 $this->filter[] =
'glo';
948 $this->filter[] =
'tst';
949 $this->filter[] =
'svy';
950 $this->filter[] =
'qpl';
951 $this->filter[] =
'spl';
955 $this->filter[] =
'mep';
959 $this->filter[] =
'crs';
963 $this->filter[] =
'file';
967 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
973 $this->filter[] =
'sess';
974 $this->filter[] =
'webr';
975 $this->filter[] =
'crs';
976 $this->filter[] =
'mep';
977 $this->filter[] =
'tst';
978 $this->filter[] =
'svy';
979 $this->filter[] =
'qpl';
980 $this->filter[] =
'spl';
981 $this->filter[] =
'glo';
982 $this->filter[] =
'lm';
983 $this->filter[] =
'dbk';
984 $this->filter[] =
'pg';
985 $this->filter[] =
'st';
986 $this->filter[] =
'sahs';
987 $this->filter[] =
'htlm';
988 $this->filter[] =
'file';
996 'crs' => $this->lng->txt(
'objs_crs'),
997 'lms' => $this->lng->txt(
'learning_resources'),
998 'glo' => $this->lng->txt(
'objs_glo'),
999 'mep' => $this->lng->txt(
'objs_mep'),
1000 'tst' => $this->lng->txt(
'search_tst_svy'),
1001 'file'=> $this->lng->txt(
'objs_file'),
1002 'webr' => $this->lng->txt(
'objs_webr'),
1003 'sess' => $this->lng->txt(
'objs_sess')
1013 if ($this->stored ==
false) {
1014 $res->mergeEntries($new_res);
1015 $this->stored =
true;
1019 $res->intersectEntries($new_res);
1034 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
1037 if (
$_GET[
'page_number']) {
1038 $this->search_cache->setResultPageNumber((
int)
$_GET[
'page_number']);
1040 if (
$_POST[
'cmd'][
'performSearch']) {
1042 $this->search_cache->save();
1056 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1060 $ilTabs->addSubTabTarget(
'search_lom', $this->ctrl->getLinkTarget($this,
'showSavedResults'));
1061 #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults')); 1073 return mktime(
$time[
'h'],
$time[
'm'], 0, $date[
'm'], $date[
'd'], $date[
'y']);
1085 if (
$type == self::TYPE_LOM) {
1086 $_SESSION[
'search_last_sub_section'] = self::TYPE_LOM;
1089 $_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.
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
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 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 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 _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)