ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ilAdvancedSearchGUI Class Reference
+ Inheritance diagram for ilAdvancedSearchGUI:
+ Collaboration diagram for ilAdvancedSearchGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 getRootNode ()
 
 executeCommand ()
 Control public. More...
 
 reset ()
 
 searchInResults ()
 
 performSearch ()
 
 showAdvMDSearch ()
 Show advanced meta data search. More...
 
 showSearch ()
 
 prepareOutput ()
 
 showSavedResults ()
 
__performContentSearch ()
 
__performTitleSearch ()
 
__performGeneralSearch ()
 
__performLifecycleSearch ()
 
__performLanguageSearch ()
 
__performContributeSearch ()
 
__performEntitySearch ()
 
__performRequirementSearch ()
 
__performFormatSearch ()
 
__performEducationalSearch ()
 
__performTypicalAgeRangeSearch ()
 
__performRightsSearch ()
 
__performClassificationSearch ()
 
__performTaxonSearch ()
 
__performKeywordSearch ()
 
 __setSearchOptions (&$post_vars)
 
 __getFilterSelect ()
 
 __storeEntries ($res, $new_res)
 
 setSubTabs ()
 set sub tabs More...
 
- Public Member Functions inherited from ilSearchBaseGUI
 __construct ()
 Constructor public. More...
 
 prepareOutput ()
 
 initStandardSearchForm ($a_mode)
 Init standard search form. More...
 
 getSearchAreaForm ()
 Init standard search form. More...
 
 handleCommand ($a_cmd)
 Handle command. More...
 
 addToDeskObject ()
 Interface methods. More...
 
 removeFromDeskObject ()
 Remove from dektop. More...
 
 delete ()
 Show deletion screen. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 cancelMoveLinkObject ()
 Cancel move/link. More...
 
 performDelete ()
 Delete objects. More...
 
 cut ()
 Interface ilAdministrationCommandHandler. More...
 
 link ()
 Interface ilAdministrationCommandHandler. More...
 
 paste ()
 Paste. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection link. More...
 
 showMoveIntoObjectTree ()
 Target selection cut. More...
 
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects. More...
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 Enable administration panel. More...
 
 disableAdministrationPanel ()
 Disable administration panel. More...
 
 addLocator ()
 Add Locator. More...
 
 autoComplete ()
 Data resource for autoComplete. More...
 

Data Fields

const TYPE_LOM = 1
 
const TYPE_ADV_MD = 2
 
- Data Fields inherited from ilSearchBaseGUI
const SEARCH_FAST = 1
 
const SEARCH_DETAILS = 2
 
const SEARCH_AND = 'and'
 
const SEARCH_OR = 'or'
 
const SEARCH_FORM_LUCENE = 1
 
const SEARCH_FORM_STANDARD = 2
 
const SEARCH_FORM_USER = 3
 
 $ilias = null
 
 $lng = null
 
 $tpl = null
 

Protected Member Functions

 remoteSearch ()
 Search from main menu. More...
 
 initAdvancedMetaDataForm ()
 protected More...
 
 performAdvMDSearch ()
 perform advanced meta data search More...
 
 initFormSearch ()
 Show search form. More...
 
- Protected Member Functions inherited from ilSearchBaseGUI
 addPager ($result, $a_session_key)
 Add Pager. More...
 
 buildSearchAreaPath ($a_root_node)
 Build path for search area. More...
 
 getCreationDateForm ()
 
 getSearchCache ()
 Get user search cache. More...
 
 loadCreationFilter ()
 Load creation date filter. More...
 

Protected Attributes

 $last_section = 'adv_search'
 
 $fields = array()
 
 $tabs_gui
 
- Protected Attributes inherited from ilSearchBaseGUI
 $settings = null
 
 $ctrl = null
 

Private Member Functions

 showSavedAdvMDResults ()
 show advanced meta data results More...
 
 searchAdvancedMD ($res)
 Perform advanced meta data search. More...
 
 initUserSearchCache ()
 Init user search cache. More...
 
 toUnixTime ($date, $time=array())
 convert input array to unix time More...
 
 initSearchType ($type)
 init search type (LOM Search or Advanced meta data search) More...
 

Private Attributes

 $options = array()
 array of all options select boxes,'and' 'or' and query strings public More...
 

Detailed Description

Definition at line 43 of file class.ilAdvancedSearchGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAdvancedSearchGUI::__construct ( )

Constructor public.

Definition at line 66 of file class.ilAdvancedSearchGUI.php.

References $_POST, __setSearchOptions(), fields, and ilLuceneAdvancedSearchFields\getInstance().

67  {
68  global $ilTabs;
69 
70  $this->tabs_gui = $ilTabs;
71 
72  parent::__construct();
73 
74  $this->lng->loadLanguageModule('meta');
76 
77  $this->__setSearchOptions($_POST);
78  }
$errors fields
Definition: imgupload.php:52
static getInstance()
Get singleton instance.
$_POST["username"]
+ Here is the call graph for this function:

Member Function Documentation

◆ __getFilterSelect()

ilAdvancedSearchGUI::__getFilterSelect ( )

Definition at line 1055 of file class.ilAdvancedSearchGUI.php.

References $options, array, and ilUtil\formSelect().

1056  {
1057  $options = array('all' => $this->lng->txt('search_any'),
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'));
1065 
1066 
1067  return ilUtil::formSelect($this->options['type'],'search_adv[type]',$options,false,true);
1068  }
$options
array of all options select boxes,'and' 'or' and query strings public
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.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ __performClassificationSearch()

& ilAdvancedSearchGUI::__performClassificationSearch ( )

Definition at line 848 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

849  {
850  // Return if 'any'
851  if(!$this->options['lom_purpose'])
852  {
853  return false;
854  }
855  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
856  include_once 'Services/Search/classes/class.ilQueryParser.php';
857 
858 
860  $meta_search->setFilter($this->filter);
861  $meta_search->setMode('classification');
862  $meta_search->setOptions($this->options);
863  $res =& $meta_search->performSearch();
864 
865  return $res;
866  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performContentSearch()

& ilAdvancedSearchGUI::__performContentSearch ( )

Definition at line 567 of file class.ilAdvancedSearchGUI.php.

References $res, __performTitleSearch(), ilObjectSearchFactory\_getGlossaryDefinitionSearchInstance(), ilObjectSearchFactory\_getLMContentSearchInstance(), ilObjectSearchFactory\_getMediaPoolSearchInstance(), ilObjectSearchFactory\_getTestSearchInstance(), ilObjectSearchFactory\_getWebresourceSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by performSearch().

568  {
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';
572 
573  if(!$this->options['lom_content'])
574  {
575  return false;
576  }
577 
578  $res = new ilSearchResult();
579 
580  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
581  #$query_parser->setCombination($this->options['content_ao']);
582  $query_parser->setCombination(QP_COMBINATION_OR);
583  $query_parser->parse();
584 
585  if($this->options['type'] == 'all' or $this->options['type'] == 'lms')
586  {
587  // LM content search
588  $lm_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
589  $res_cont =& $lm_search->performSearch();
590  $res->mergeEntries($res_cont);
591  }
592  if($this->options['type'] == 'all' or $this->options['type'] == 'tst')
593  {
594  $tst_search =& ilObjectSearchFactory::_getTestSearchInstance($query_parser);
595  $res_tes =& $tst_search->performSearch();
596  $res->mergeEntries($res_tes);
597  }
598  if($this->options['type'] == 'all' or $this->options['type'] == 'mep')
599  {
600  $med_search =& ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
601  $res_med =& $med_search->performSearch();
602  $res->mergeEntries($res_med);
603  }
604  if($this->options['type'] == 'all' or $this->options['type'] == 'glo')
605  {
607  $res_glo =& $glo_search->performSearch();
608  $res->mergeEntries($res_glo);
609  }
610  if($this->options['type'] == 'all' or $this->options['type'] == 'webr')
611  {
612  $web_search =& ilObjectSearchFactory::_getWebresourceSearchInstance($query_parser);
613  $res_web =& $web_search->performSearch();
614  $res->mergeEntries($res_web);
615  }
616  if($tit_res = $this->__performTitleSearch())
617  {
618  $res->mergeEntries($tit_res);
619  }
620 
621  return $res;
622  }
static _getWebresourceSearchInstance($query_parser)
get reference of ilFulltextWebresourceSearch
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _getGlossaryDefinitionSearchInstance($query_parser)
get reference of ilFulltextGlossaryDefinitionSearch
static _getLMContentSearchInstance($query_parser)
get reference of ilFulltextLMContentSearch
static _getTestSearchInstance($query_parser)
get reference of ilFulltextTestSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performContributeSearch()

& ilAdvancedSearchGUI::__performContributeSearch ( )

Definition at line 729 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

730  {
731  if(!strlen($this->options['lom_role']))
732  {
733  return false;
734  }
735  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
736  include_once 'Services/Search/classes/class.ilQueryParser.php';
737 
738 
740  $meta_search->setFilter($this->filter);
741  $meta_search->setMode('contribute');
742  $meta_search->setOptions($this->options);
743  $res =& $meta_search->performSearch();
744 
745  return $res;
746  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performEducationalSearch()

& ilAdvancedSearchGUI::__performEducationalSearch ( )

Definition at line 801 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

802  {
803  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
804  include_once 'Services/Search/classes/class.ilQueryParser.php';
805 
806 
808  $meta_search->setFilter($this->filter);
809  $meta_search->setMode('educational');
810  $meta_search->setOptions($this->options);
811  $res =& $meta_search->performSearch();
812 
813  return $res;
814  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performEntitySearch()

& ilAdvancedSearchGUI::__performEntitySearch ( )

Definition at line 747 of file class.ilAdvancedSearchGUI.php.

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by performSearch().

748  {
749  // Return if 'any'
750  if(!$this->options['lom_role_entry'])
751  {
752  return false;
753  }
754 
755  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
756  include_once 'Services/Search/classes/class.ilQueryParser.php';
757 
758  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_role_entry']));
759  #$query_parser->setCombination($this->options['entity_ao']);
760  $query_parser->setCombination(QP_COMBINATION_OR);
761  $query_parser->parse();
762 
763  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
764  $meta_search->setFilter($this->filter);
765  $meta_search->setMode('entity');
766  $meta_search->setOptions($this->options);
767  $res =& $meta_search->performSearch();
768 
769  return $res;
770  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performFormatSearch()

& ilAdvancedSearchGUI::__performFormatSearch ( )

Definition at line 787 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

788  {
789  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
790  include_once 'Services/Search/classes/class.ilQueryParser.php';
791 
792 
794  $meta_search->setFilter($this->filter);
795  $meta_search->setMode('format');
796  $meta_search->setOptions($this->options);
797  $res =& $meta_search->performSearch();
798 
799  return $res;
800  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performGeneralSearch()

& ilAdvancedSearchGUI::__performGeneralSearch ( )

Definition at line 658 of file class.ilAdvancedSearchGUI.php.

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by performSearch().

659  {
660  if(!$this->options['lom_coverage'] and !$this->options['lom_structure'])
661  {
662  return false;
663  }
664 
665  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
666  include_once 'Services/Search/classes/class.ilQueryParser.php';
667 
668  if($this->options['lom_coverage'])
669  {
670  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_coverage']));
671  #$query_parser->setCombination($this->options['coverage_ao']);
672  $query_parser->setCombination(QP_COMBINATION_OR);
673  $query_parser->parse();
674  }
675  else
676  {
677  $query_parser = new ilQueryParser('');
678  }
679  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
680  $meta_search->setFilter($this->filter);
681  $meta_search->setMode('general');
682  $meta_search->setOptions($this->options);
683  $res =& $meta_search->performSearch();
684 
685  return $res;
686  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performKeywordSearch()

& ilAdvancedSearchGUI::__performKeywordSearch ( )

Definition at line 943 of file class.ilAdvancedSearchGUI.php.

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by performSearch().

944  {
945  // Return if 'any'
946  if(!$this->options['lom_keyword'])
947  {
948  return false;
949  }
950  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
951  include_once 'Services/Search/classes/class.ilQueryParser.php';
952 
953  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_keyword']));
954  #$query_parser->setCombination($this->options['keyword_ao']);
955  $query_parser->setCombination(QP_COMBINATION_OR);
956  $query_parser->parse();
957 
958  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
959  $meta_search->setFilter($this->filter);
960  $meta_search->setMode('keyword');
961  $meta_search->setOptions($this->options);
962  $res =& $meta_search->performSearch();
963 
964  return $res;
965  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performLanguageSearch()

& ilAdvancedSearchGUI::__performLanguageSearch ( )

Definition at line 711 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

712  {
713  if(!$this->options['lom_language'])
714  {
715  return false;
716  }
717  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
718  include_once 'Services/Search/classes/class.ilQueryParser.php';
719 
720 
722  $meta_search->setFilter($this->filter);
723  $meta_search->setMode('language');
724  $meta_search->setOptions($this->options);
725  $res =& $meta_search->performSearch();
726 
727  return $res;
728  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performLifecycleSearch()

& ilAdvancedSearchGUI::__performLifecycleSearch ( )

Definition at line 688 of file class.ilAdvancedSearchGUI.php.

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by performSearch().

689  {
690  // Return if 'any'
691  if(!$this->options['lom_status'] and !$this->options['lom_version'])
692  {
693  return false;
694  }
695  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
696  include_once 'Services/Search/classes/class.ilQueryParser.php';
697 
698  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_version']));
699  #$query_parser->setCombination($this->options['version_ao']);
700  $query_parser->setCombination(QP_COMBINATION_OR);
701  $query_parser->parse();
702 
703  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
704  $meta_search->setFilter($this->filter);
705  $meta_search->setMode('lifecycle');
706  $meta_search->setOptions($this->options);
707  $res =& $meta_search->performSearch();
708 
709  return $res;
710  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRequirementSearch()

& ilAdvancedSearchGUI::__performRequirementSearch ( )

Definition at line 773 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

774  {
775  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
776  include_once 'Services/Search/classes/class.ilQueryParser.php';
777 
778 
780  $meta_search->setFilter($this->filter);
781  $meta_search->setMode('requirement');
782  $meta_search->setOptions($this->options);
783  $res =& $meta_search->performSearch();
784 
785  return $res;
786  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRightsSearch()

& ilAdvancedSearchGUI::__performRightsSearch ( )

Definition at line 829 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

830  {
831  if(!$this->options['lom_copyright'] and !$this->options['lom_costs'])
832  {
833  return false;
834  }
835  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
836  include_once 'Services/Search/classes/class.ilQueryParser.php';
837 
838 
840  $meta_search->setFilter($this->filter);
841  $meta_search->setMode('rights');
842  $meta_search->setOptions($this->options);
843  $res =& $meta_search->performSearch();
844 
845  return $res;
846  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performTaxonSearch()

& ilAdvancedSearchGUI::__performTaxonSearch ( )

Definition at line 868 of file class.ilAdvancedSearchGUI.php.

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by performSearch().

869  {
870  // Return if 'any'
871  if(!$this->options['lom_taxon'])
872  {
873  return false;
874  }
875  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
876  include_once 'Services/Search/classes/class.ilQueryParser.php';
877 
878  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_taxon']));
879  $query_parser->setCombination(QP_COMBINATION_OR);
880  $query_parser->parse();
881 
882  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
883  $meta_search->setFilter($this->filter);
884  $meta_search->setMode('taxon');
885  $meta_search->setOptions($this->options);
886  $res =& $meta_search->performSearch();
887 
888  return $res;
889  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performTitleSearch()

& ilAdvancedSearchGUI::__performTitleSearch ( )

Definition at line 625 of file class.ilAdvancedSearchGUI.php.

References ilObjectSearchFactory\_getAdvancedSearchInstance(), QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by __performContentSearch(), and performAdvMDSearch().

626  {
627  if(!$this->options['lom_content'])
628  {
629  return false;
630  }
631 
632  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
633  include_once 'Services/Search/classes/class.ilQueryParser.php';
634 
635  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
636  #$query_parser->setCombination($this->options['title_ao']);
637  $query_parser->setCombination(QP_COMBINATION_OR);
638  $query_parser->parse();
639  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
640 
641  $meta_search->setFilter($this->filter);
642  $meta_search->setMode('title_description');
643  $meta_search->setOptions($this->options);
644  $res_tit =& $meta_search->performSearch();
645 
646  $meta_search->setMode('keyword_all');
647  $res_key =& $meta_search->performSearch();
648 
649  // merge them
650  $res_tit->mergeEntries($res_key);
651 
652 
653  return $res_tit;
654  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performTypicalAgeRangeSearch()

& ilAdvancedSearchGUI::__performTypicalAgeRangeSearch ( )

Definition at line 815 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

816  {
817  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
818  include_once 'Services/Search/classes/class.ilQueryParser.php';
819 
820 
822  $meta_search->setFilter($this->filter);
823  $meta_search->setMode('typical_age_range');
824  $meta_search->setOptions($this->options);
825  $res =& $meta_search->performSearch();
826 
827  return $res;
828  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSearchOptions()

ilAdvancedSearchGUI::__setSearchOptions ( $post_vars)

Definition at line 967 of file class.ilAdvancedSearchGUI.php.

References $_POST, $_SESSION, ilAdvancedMDRecord\_getActivatedObjTypes(), and array.

Referenced by __construct().

968  {
969  if(isset($_POST['cmd']['performSearch']))
970  {
971  $this->options = $_SESSION['search_adv'] = $_POST['query'];
972  }
973  elseif(isset($_POST['cmd']['performAdvMDSearch']))
974  {
975  $this->options = $_SESSION['search_adv_md'] = $_POST;
976  }
977  else
978  {
979  $this->options = $_SESSION['search_adv'];
980  }
981 
982  $_POST['result'] = $_POST['id'];
983 
984  $this->filter = array();
985 
986  $this->options['type'] = 'all';
987  switch($this->options['type'])
988  {
989  case 'cat':
990  $this->filter[] = 'cat';
991  break;
992 
993  case 'webr':
994  $this->filter[] = 'webr';
995  break;
996 
997  case 'lms':
998  $this->filter[] = 'lm';
999  $this->filter[] = 'dbk';
1000  $this->filter[] = 'pg';
1001  $this->filter[] = 'st';
1002  $this->filter[] = 'sahs';
1003  $this->filter[] = 'htlm';
1004  break;
1005 
1006  case 'glo':
1007  $this->filter[] = 'glo';
1008  break;
1009 
1010  case 'tst':
1011  $this->filter[] = 'tst';
1012  $this->filter[] = 'svy';
1013  $this->filter[] = 'qpl';
1014  $this->filter[] = 'spl';
1015  break;
1016 
1017  case 'mep':
1018  $this->filter[] = 'mep';
1019  break;
1020 
1021  case 'crs':
1022  $this->filter[] = 'crs';
1023  break;
1024 
1025  case 'file':
1026  $this->filter[] = 'file';
1027  break;
1028 
1029  case 'adv_all':
1030  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1032  break;
1033 
1034  case 'all':
1035  default:
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';
1051  }
1052  return true;
1053  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.
static _getActivatedObjTypes()
get activated obj types
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __storeEntries()

ilAdvancedSearchGUI::__storeEntries (   $res,
  $new_res 
)

Definition at line 1071 of file class.ilAdvancedSearchGUI.php.

References $res.

Referenced by performAdvMDSearch(), performSearch(), and searchAdvancedMD().

1072  {
1073  if($this->stored == false)
1074  {
1075  $res->mergeEntries($new_res);
1076  $this->stored = true;
1077 
1078  return true;
1079  }
1080  else
1081  {
1082  $res->intersectEntries($new_res);
1083  return true;
1084  }
1085  }
+ Here is the caller graph for this function:

◆ executeCommand()

ilAdvancedSearchGUI::executeCommand ( )

Control public.

Definition at line 90 of file class.ilAdvancedSearchGUI.php.

References $_SESSION, $cmd, ilSearchBaseGUI\handleCommand(), initUserSearchCache(), and prepareOutput().

91  {
92  global $rbacsystem;
93 
94  $next_class = $this->ctrl->getNextClass($this);
95  $cmd = $this->ctrl->getCmd();
96 
97  switch($next_class)
98  {
99 
100  case 'ilobjectcopygui':
101  $this->prepareOutput();
102  $this->ctrl->setReturn($this,'');
103 
104  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
105  $cp = new ilObjectCopyGUI($this);
106  $this->ctrl->forwardCommand($cp);
107  break;
108 
109  default:
110  $this->initUserSearchCache();
111  if(!$cmd)
112  {
113  switch($_SESSION['search_last_sub_section'])
114  {
115  case self::TYPE_ADV_MD:
116  $cmd = "showSavedAdvMDResults";
117  break;
118 
119  default:
120  $cmd = "showSavedResults";
121  break;
122  }
123  }
124 
125  $this->prepareOutput();
126  $this->handleCommand($cmd);
127  break;
128  }
129  return true;
130  }
$_SESSION["AccountId"]
GUI class for the workflow of copying objects.
$cmd
Definition: sahs_server.php:35
handleCommand($a_cmd)
Handle command.
initUserSearchCache()
Init user search cache.
+ Here is the call graph for this function:

◆ getRootNode()

ilAdvancedSearchGUI::getRootNode ( )

Definition at line 80 of file class.ilAdvancedSearchGUI.php.

Referenced by performAdvMDSearch(), and performSearch().

81  {
82  return ROOT_FOLDER_ID;
83  }
+ Here is the caller graph for this function:

◆ initAdvancedMetaDataForm()

ilAdvancedSearchGUI::initAdvancedMetaDataForm ( )
protected

protected

Definition at line 293 of file class.ilAdvancedSearchGUI.php.

References $options, ilAdvancedMDRecord\_getActivatedObjTypes(), ilRadioOption\addSubItem(), ilAdvancedMDRecordGUI\MODE_SEARCH, ilSelectInputGUI\setOptions(), and ilTextInputGUI\setValue().

Referenced by showAdvMDSearch().

294  {
295  if(is_object($this->form))
296  {
297  return $this->form;
298  }
299 
300  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
301  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
302  $this->form = new ilPropertyFormGUI();
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');
307 
308  $content = new ilTextInputGUI($this->lng->txt('meta_title').'/'.
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);
314 // $content->setSubformMode('right');
315  $group = new ilRadioGroupInputGUI('','title_ao');
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);
321  $content->addSubItem($group);
322  $this->form->addItem($content);
323 
324  $type = new ilSelectInputGUI($this->lng->txt('type'),'type');
325  $options['adv_all'] = $this->lng->txt('search_any');
326  foreach(ilAdvancedMDRecord::_getActivatedObjTypes() as $obj_type)
327  {
328  $options[$obj_type] = $this->lng->txt('objs_'.$obj_type);
329  }
330  $type->setOptions($options);
331  $type->setValue($this->options['type']);
332  $this->form->addItem($type);
333 
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();
339  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a property in a property form.
$options
array of all options select boxes,'and' 'or' and query strings public
addSubItem($a_item)
Add Subitem.
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
static _getActivatedObjTypes()
get activated obj types
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSearch()

ilAdvancedSearchGUI::initFormSearch ( )
protected

Show search form.

Definition at line 432 of file class.ilAdvancedSearchGUI.php.

References $section, and fields.

Referenced by searchAdvancedMD(), and showSearch().

433  {
434  global $tree;
435 
436  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
437 
438  $this->form = new ilPropertyFormGUI();
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'));
443 
444  foreach($this->fields->getActiveSections() as $definition)
445  {
446  if($definition['name'] != 'default')
447  {
449  $section->setTitle($definition['name']);
450  $this->form->addItem($section);
451  }
452 
453  foreach($definition['fields'] as $field_name)
454  {
455  if(is_object($element = $this->fields->getFormElement($this->search_cache->getQuery(),$field_name,$this->form)))
456  {
457  $this->form->addItem($element);
458  }
459  }
460  }
461  return true;
462  }
This class represents a property form user interface.
This class represents a section header in a property form.
$errors fields
Definition: imgupload.php:52
$section
Definition: Utf8Test.php:83
+ Here is the caller graph for this function:

◆ initSearchType()

ilAdvancedSearchGUI::initSearchType (   $type)
private

init search type (LOM Search or Advanced meta data search)

private

Parameters

Definition at line 1150 of file class.ilAdvancedSearchGUI.php.

References $_SESSION, ilUserSearchCache\ADVANCED_MD_SEARCH, and ilUserSearchCache\ADVANCED_SEARCH.

Referenced by performAdvMDSearch(), performSearch(), reset(), searchInResults(), showSavedAdvMDResults(), and showSavedResults().

1151  {
1152  if($type == self::TYPE_LOM)
1153  {
1154  $_SESSION['search_last_sub_section'] = self::TYPE_LOM;
1155  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1156  }
1157  else
1158  {
1159  $_SESSION['search_last_sub_section'] = self::TYPE_ADV_MD;
1160  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_MD_SEARCH);
1161  }
1162  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ initUserSearchCache()

ilAdvancedSearchGUI::initUserSearchCache ( )
private

Init user search cache.

private

Definition at line 1093 of file class.ilAdvancedSearchGUI.php.

References $_GET, $_POST, $ilUser, ilUserSearchCache\_getInstance(), ilUserSearchCache\ADVANCED_SEARCH, and ilUtil\stripSlashes().

Referenced by executeCommand().

1094  {
1095  global $ilUser;
1096 
1097  include_once('Services/Search/classes/class.ilUserSearchCache.php');
1098  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
1099  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1100  if($_GET['page_number'])
1101  {
1102  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
1103  }
1104  if($_POST['cmd']['performSearch'])
1105  {
1106  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['query']['lomContent']));
1107  $this->search_cache->save();
1108  }
1109  }
$_GET["client_id"]
static _getInstance($a_usr_id)
Get singleton instance.
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performAdvMDSearch()

ilAdvancedSearchGUI::performAdvMDSearch ( )
protected

perform advanced meta data search

protected

Definition at line 346 of file class.ilAdvancedSearchGUI.php.

References $_GET, $_SESSION, $ilUser, $res, __performTitleSearch(), __storeEntries(), ilSearchBaseGUI\addPager(), ADVANCED_MD_SEARCH, getRootNode(), initSearchType(), ilSearchResultPresentation\MODE_STANDARD, ilSearchResult\read(), searchAdvancedMD(), ilUtil\sendInfo(), and showAdvMDSearch().

347  {
348  global $ilUser;
349 
350  $this->initSearchType(self::TYPE_ADV_MD);
351  if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
352  {
353  unset($_SESSION['adv_max_page']);
354  $this->search_cache->delete();
355  }
356 
357  include_once 'Services/Search/classes/class.ilSearchResult.php';
358  $res = new ilSearchResult();
359 
360  if($res_tit =& $this->__performTitleSearch())
361  {
362  $this->__storeEntries($res,$res_tit);
363  }
364  $this->searchAdvancedMD($res);
365 
366  if($this->search_mode == 'in_results')
367  {
368  include_once 'Services/Search/classes/class.ilSearchResult.php';
369 
370  $old_result_obj = new ilSearchResult($ilUser->getId());
371  $old_result_obj->read(ADVANCED_MD_SEARCH);
372 
373  $res->diffEntriesFromResult($old_result_obj);
374  }
375 
376 
377  $res->filter($this->getRootNode(),true);
378  $res->save();
379  $this->showAdvMDSearch();
380 
381  if(!count($res->getResults()))
382  {
383  ilUtil::sendInfo($this->lng->txt('search_no_match'));
384  }
385 
386  if($res->isLimitReached())
387  {
388  #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
389  #ilUtil::sendInfo($message);
390  }
391 
392  $this->addPager($res,'adv_max_page');
393 
394  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
396  $presentation->setResults($res->getResultsForPresentation());
397  $presentation->setPreviousNext($this->prev_link, $this->next_link);
398 
399  if($presentation->render())
400  {
401  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
402  }
403  return true;
404 
405  }
read($a_type=DEFAULT_SEARCH)
read search results
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
showAdvMDSearch()
Show advanced meta data search.
$_SESSION["AccountId"]
$_GET["client_id"]
searchAdvancedMD($res)
Perform advanced meta data search.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
$ilUser
Definition: imgupload.php:18
const ADVANCED_MD_SEARCH
+ Here is the call graph for this function:

◆ performSearch()

ilAdvancedSearchGUI::performSearch ( )

Definition at line 169 of file class.ilAdvancedSearchGUI.php.

References $_GET, $_POST, $_SESSION, $ilUser, $res, __performClassificationSearch(), __performContentSearch(), __performContributeSearch(), __performEducationalSearch(), __performEntitySearch(), __performFormatSearch(), __performGeneralSearch(), __performKeywordSearch(), __performLanguageSearch(), __performLifecycleSearch(), __performRequirementSearch(), __performRightsSearch(), __performTaxonSearch(), __performTypicalAgeRangeSearch(), __storeEntries(), ilSearchBaseGUI\addPager(), ADVANCED_MD_SEARCH, ilSearchSettings\getInstance(), getRootNode(), initSearchType(), ilSearchResultPresentation\MODE_STANDARD, ilSearchSettings\OPERATOR_AND, ilSearchResult\read(), searchAdvancedMD(), ilUtil\sendInfo(), and showSearch().

Referenced by remoteSearch(), and searchInResults().

170  {
171  global $ilUser;
172 
173  $this->initSearchType(self::TYPE_LOM);
174 
175  if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
176  {
177  unset($_SESSION['adv_max_page']);
178  $this->search_cache->deleteCachedEntries();
179  }
180 
181  if(isset($_POST['query']))
182  {
183  $this->search_cache->setQuery($_POST['query']);
184  }
185 
186 
187  include_once 'Services/Search/classes/class.ilSearchResult.php';
188  $res = new ilSearchResult();
189 
190  if($res_con =& $this->__performContentSearch())
191  {
192  $this->__storeEntries($res,$res_con);
193  }
194  if($res_lan =& $this->__performLanguageSearch())
195  {
196  $this->__storeEntries($res,$res_lan);
197  }
198  if($res_gen =& $this->__performGeneralSearch())
199  {
200  $this->__storeEntries($res,$res_gen);
201  }
202  if($res_lif =& $this->__performLifecycleSearch())
203  {
204  $this->__storeEntries($res,$res_lif);
205  }
206  if($res_con =& $this->__performContributeSearch())
207  {
208  $this->__storeEntries($res,$res_con);
209  }
210  if($res_ent =& $this->__performEntitySearch())
211  {
212  $this->__storeEntries($res,$res_ent);
213  }
214  if($res_req =& $this->__performRequirementSearch())
215  {
216  $this->__storeEntries($res,$res_req);
217  }
218  if($res_for =& $this->__performFormatSearch())
219  {
220  $this->__storeEntries($res,$res_for);
221  }
222  if($res_edu =& $this->__performEducationalSearch())
223  {
224  $this->__storeEntries($res,$res_edu);
225  }
226  if($res_typ =& $this->__performTypicalAgeRangeSearch())
227  {
228  $this->__storeEntries($res,$res_typ);
229  }
230  if($res_rig =& $this->__performRightsSearch())
231  {
232  $this->__storeEntries($res,$res_rig);
233  }
234  if($res_cla =& $this->__performClassificationSearch())
235  {
236  $this->__storeEntries($res,$res_cla);
237  }
238  if($res_tax =& $this->__performTaxonSearch())
239  {
240  $this->__storeEntries($res,$res_tax);
241  }
242  if($res_key =& $this->__performKeywordSearch())
243  {
244  $this->__storeEntries($res,$res_key);
245  }
246 
247  $this->searchAdvancedMD($res);
248 
249  if($this->search_mode == 'in_results')
250  {
251  include_once 'Services/Search/classes/class.ilSearchResult.php';
252 
253  $old_result_obj = new ilSearchResult($ilUser->getId());
254  $old_result_obj->read(ADVANCED_MD_SEARCH);
255 
256  $res->diffEntriesFromResult($old_result_obj);
257  }
258 
259  $res->filter($this->getRootNode(), (ilSearchSettings::getInstance()->getDefaultOperator() == ilSearchSettings::OPERATOR_AND));
260  $res->save();
261  $this->showSearch();
262 
263  if(!count($res->getResults()))
264  {
265  ilUtil::sendInfo($this->lng->txt('search_no_match'));
266  }
267 
268  if($res->isLimitReached())
269  {
270  #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
271  #ilUtil::sendInfo($message);
272  }
273 
274  $this->addPager($res,'adv_max_page');
275 
276  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
278  $presentation->setResults($res->getResultsForPresentation());
279  $presentation->setPreviousNext($this->prev_link, $this->next_link);
280 
281  if($presentation->render())
282  {
283  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
284  }
285  return true;
286  }
read($a_type=DEFAULT_SEARCH)
read search results
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
$_SESSION["AccountId"]
$_GET["client_id"]
searchAdvancedMD($res)
Perform advanced meta data search.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
$ilUser
Definition: imgupload.php:18
const ADVANCED_MD_SEARCH
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilAdvancedSearchGUI::prepareOutput ( )

Definition at line 480 of file class.ilAdvancedSearchGUI.php.

Referenced by executeCommand().

481  {
482  global $ilTabs, $ilHelp;
483 
484  parent::prepareOutput();
485 
486  $ilHelp->setScreenIdComponent("src");
487 
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");
493  }
+ Here is the caller graph for this function:

◆ remoteSearch()

ilAdvancedSearchGUI::remoteSearch ( )
protected

Search from main menu.

Definition at line 154 of file class.ilAdvancedSearchGUI.php.

References $_POST, array, performSearch(), and ilUtil\stripSlashes().

155  {
156  $this->search_cache->setRoot((int) $_POST['root_id']);
157  $this->search_cache->setResultPageNumber(1);
158  $this->search_cache->setQuery(array('lom_content' => ilUtil::stripSlashes($_POST['queryString'])));
159  $this->search_cache->save();
160 
161  $this->options = $this->search_cache->getQuery();
162  $this->options['type'] = 'all';
163 
164  $this->performSearch();
165  }
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.
$_POST["username"]
+ Here is the call graph for this function:

◆ reset()

ilAdvancedSearchGUI::reset ( )

Definition at line 131 of file class.ilAdvancedSearchGUI.php.

References array, initSearchType(), and showSearch().

132  {
133  $this->initSearchType(self::TYPE_LOM);
134  $this->options = array();
135  $this->search_cache->setQuery(array());
136  $this->search_cache->save();
137  $this->showSearch();
138  }
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ searchAdvancedMD()

ilAdvancedSearchGUI::searchAdvancedMD (   $res)
private

Perform advanced meta data search.

private

Parameters
objresult object

Definition at line 898 of file class.ilAdvancedSearchGUI.php.

References $res, __storeEntries(), ilObjectSearchFactory\_getAdvancedMDSearchInstance(), ilADTFactory\getInstance(), ilAdvancedMDFieldDefinition\getInstance(), and initFormSearch().

Referenced by performAdvMDSearch(), and performSearch().

899  {
900  $this->initFormSearch();
901 
902  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
903  foreach(array_keys($this->options) as $key)
904  {
905  if(substr($key,0,3) != 'adv')
906  {
907  continue;
908  }
909 
910  // :TODO: ?
911  if(!$key)
912  {
913  continue;
914  }
915 
916  $field_id = substr($key,4);
917  $field = ilAdvancedMDFieldDefinition::getInstance($field_id);
918 
919  $field_form = ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), true, false);
920  $field_form->setElementId("query[".$key."]");
921  $field_form->setForm($this->form);
922 
923  // reload search values
924  $field_form->importFromPost($this->options);
925  $field_form->validate();
926 
927  $parser_value = $field->getSearchQueryParserValue($field_form);
928 
929  include_once 'Services/Search/classes/class.ilQueryParser.php';
930  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
931  $adv_md_search = ilObjectSearchFactory::_getAdvancedMDSearchInstance(new ilQueryParser($parser_value));
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();
936  if($res_field instanceof ilSearchResult)
937  {
938  $this->__storeEntries($res,$res_field);
939  }
940  }
941  }
initFormSearch()
Show search form.
static getInstance()
Get singleton.
static _getAdvancedMDSearchInstance($query_parser)
get advanced meta data search instance
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchInResults()

ilAdvancedSearchGUI::searchInResults ( )

Definition at line 140 of file class.ilAdvancedSearchGUI.php.

References $_SESSION, initSearchType(), and performSearch().

141  {
142  $this->initSearchType(self::TYPE_LOM);
143  $this->search_mode = 'in_results';
144  $this->search_cache->setResultPageNumber(1);
145  unset($_SESSION['adv_max_page']);
146  $this->performSearch();
147 
148  return true;
149  }
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ setSubTabs()

ilAdvancedSearchGUI::setSubTabs ( )

set sub tabs

public

Definition at line 1117 of file class.ilAdvancedSearchGUI.php.

References ilAdvancedMDFieldDefinition\getSearchableDefinitionIds().

Referenced by showAdvMDSearch(), and showSearch().

1118  {
1119  global $ilTabs;
1120 
1121  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1123  {
1124  return true;
1125  }
1126  $ilTabs->addSubTabTarget('search_lom',$this->ctrl->getLinkTarget($this,'showSavedResults'));
1127  #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults'));
1128 
1129  }
static getSearchableDefinitionIds()
Get searchable definition ids (performance is key)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAdvMDSearch()

ilAdvancedSearchGUI::showAdvMDSearch ( )

Show advanced meta data search.

public

Definition at line 413 of file class.ilAdvancedSearchGUI.php.

References $_SESSION, initAdvancedMetaDataForm(), and setSubTabs().

Referenced by performAdvMDSearch(), and showSavedAdvMDResults().

414  {
415  if(isset($_SESSION['search_adv_md']))
416  {
417  $this->options = $_SESSION['search_adv_md'];
418  }
419  $this->setSubTabs();
420  $this->tabs_gui->setSubTabActive('search_adv_md');
421 
422  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_adv_search.html','Services/Search');
423 
424  $this->initAdvancedMetaDataForm();
425  $this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
426  return true;
427  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSavedAdvMDResults()

ilAdvancedSearchGUI::showSavedAdvMDResults ( )
private

show advanced meta data results

private

Definition at line 502 of file class.ilAdvancedSearchGUI.php.

References $ilUser, ilSearchBaseGUI\addPager(), ADVANCED_MD_SEARCH, initSearchType(), ilSearchResultPresentation\MODE_STANDARD, ilSearchResult\read(), and showAdvMDSearch().

503  {
504  global $ilUser;
505 
506  // Read old result sets
507  include_once 'Services/Search/classes/class.ilSearchResult.php';
508 
509  $this->initSearchType(self::TYPE_ADV_MD);
510  $result_obj = new ilSearchResult($ilUser->getId());
511  $result_obj->read(ADVANCED_MD_SEARCH);
512 
513  $this->showAdvMDSearch();
514 
515  // Show them
516  if(count($result_obj->getResults()))
517  {
518  $this->addPager($result_obj,'adv_max_page');
519 
520  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
522  $presentation->setResults($result_obj->getResultsForPresentation());
523  $presentation->setPreviousNext($this->prev_link, $this->next_link);
524 
525  if($presentation->render())
526  {
527  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
528  }
529  }
530 
531  return true;
532  }
read($a_type=DEFAULT_SEARCH)
read search results
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
showAdvMDSearch()
Show advanced meta data search.
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
$ilUser
Definition: imgupload.php:18
const ADVANCED_MD_SEARCH
+ Here is the call graph for this function:

◆ showSavedResults()

ilAdvancedSearchGUI::showSavedResults ( )

Definition at line 535 of file class.ilAdvancedSearchGUI.php.

References $ilUser, ilSearchBaseGUI\addPager(), ADVANCED_SEARCH, initSearchType(), ilSearchResultPresentation\MODE_STANDARD, ilSearchResult\read(), and showSearch().

536  {
537  global $ilUser;
538 
539  // Read old result sets
540  include_once 'Services/Search/classes/class.ilSearchResult.php';
541 
542  $this->initSearchType(self::TYPE_LOM);
543  $result_obj = new ilSearchResult($ilUser->getId());
544  $result_obj->read(ADVANCED_SEARCH);
545 
546  $this->showSearch();
547 
548  // Show them
549  if(count($result_obj->getResults()))
550  {
551  $this->addPager($result_obj,'adv_max_page');
552 
553  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
555  $presentation->setResults($result_obj->getResultsForPresentation());
556  $presentation->setPreviousNext($this->prev_link, $this->next_link);
557 
558  if($presentation->render())
559  {
560  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
561  }
562  }
563 
564  return true;
565  }
read($a_type=DEFAULT_SEARCH)
read search results
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
const ADVANCED_SEARCH
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ showSearch()

ilAdvancedSearchGUI::showSearch ( )

Definition at line 466 of file class.ilAdvancedSearchGUI.php.

References initFormSearch(), and setSubTabs().

Referenced by performSearch(), reset(), and showSavedResults().

467  {
468  global $ilLocator;
469 
470  $this->setSubTabs();
471  $this->tabs_gui->setSubTabActive('search_lom');
472 
473  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_search.html','Services/Search');
474 
475  $this->initFormSearch();
476  $this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
477  return true;
478  }
initFormSearch()
Show search form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toUnixTime()

ilAdvancedSearchGUI::toUnixTime (   $date,
  $time = array() 
)
private

convert input array to unix time

private

Parameters

Definition at line 1138 of file class.ilAdvancedSearchGUI.php.

1139  {
1140  return mktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1141  }

Field Documentation

◆ $fields

ilAdvancedSearchGUI::$fields = array()
protected

Definition at line 50 of file class.ilAdvancedSearchGUI.php.

◆ $last_section

ilAdvancedSearchGUI::$last_section = 'adv_search'
protected

Definition at line 48 of file class.ilAdvancedSearchGUI.php.

◆ $options

ilAdvancedSearchGUI::$options = array()
private

array of all options select boxes,'and' 'or' and query strings public

Definition at line 58 of file class.ilAdvancedSearchGUI.php.

Referenced by __getFilterSelect(), and initAdvancedMetaDataForm().

◆ $tabs_gui

ilAdvancedSearchGUI::$tabs_gui
protected

Definition at line 60 of file class.ilAdvancedSearchGUI.php.

◆ TYPE_ADV_MD

const ilAdvancedSearchGUI::TYPE_ADV_MD = 2

Definition at line 46 of file class.ilAdvancedSearchGUI.php.

◆ TYPE_LOM

const ilAdvancedSearchGUI::TYPE_LOM = 1

Definition at line 45 of file class.ilAdvancedSearchGUI.php.


The documentation for this class was generated from the following file: