ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 showPasteTree ()
 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...
 
 keepObjectsInClipboardObject ()
 cancel action but keep objects in clipboard
Returns
void
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, $DIC, __setSearchOptions(), fields, and ilLuceneAdvancedSearchFields\getInstance().

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

Member Function Documentation

◆ __getFilterSelect()

ilAdvancedSearchGUI::__getFilterSelect ( )

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

References $options, and ilUtil\formSelect().

1013  {
1014  $options = array('all' => $this->lng->txt('search_any'),
1015  'crs' => $this->lng->txt('objs_crs'),
1016  'lms' => $this->lng->txt('obj_lrss'),
1017  'glo' => $this->lng->txt('objs_glo'),
1018  'mep' => $this->lng->txt('objs_mep'),
1019  'tst' => $this->lng->txt('search_tst_svy'),
1020  'file' => $this->lng->txt('objs_file'),
1021  'webr' => $this->lng->txt('objs_webr'),
1022  'sess' => $this->lng->txt('objs_sess')
1023  );
1024 
1025 
1026  return ilUtil::formSelect($this->options['type'], 'search_adv[type]', $options, false, true);
1027  }
$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.
+ Here is the call graph for this function:

◆ __performClassificationSearch()

& ilAdvancedSearchGUI::__performClassificationSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

818  {
819  // Return if 'any'
820  if (!$this->options['lom_purpose']) {
821  return false;
822  }
823  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
824  include_once 'Services/Search/classes/class.ilQueryParser.php';
825 
826 
828  $meta_search->setFilter($this->filter);
829  $meta_search->setMode('classification');
830  $meta_search->setOptions($this->options);
831  $res = &$meta_search->performSearch();
832 
833  return $res;
834  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performContentSearch()

& ilAdvancedSearchGUI::__performContentSearch ( )

Definition at line 553 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().

554  {
555  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
556  include_once 'Services/Search/classes/class.ilQueryParser.php';
557  include_once 'Services/Search/classes/class.ilSearchResult.php';
558 
559  if (!$this->options['lom_content']) {
560  return false;
561  }
562 
563  $res = new ilSearchResult();
564 
565  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
566  #$query_parser->setCombination($this->options['content_ao']);
567  $query_parser->setCombination(QP_COMBINATION_OR);
568  $query_parser->parse();
569 
570  if ($this->options['type'] == 'all' or $this->options['type'] == 'lms') {
571  // LM content search
572  $lm_search = &ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
573  $res_cont = &$lm_search->performSearch();
574  $res->mergeEntries($res_cont);
575  }
576  if ($this->options['type'] == 'all' or $this->options['type'] == 'tst') {
577  $tst_search = &ilObjectSearchFactory::_getTestSearchInstance($query_parser);
578  $res_tes = &$tst_search->performSearch();
579  $res->mergeEntries($res_tes);
580  }
581  if ($this->options['type'] == 'all' or $this->options['type'] == 'mep') {
582  $med_search = &ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
583  $res_med = &$med_search->performSearch();
584  $res->mergeEntries($res_med);
585  }
586  if ($this->options['type'] == 'all' or $this->options['type'] == 'glo') {
588  $res_glo = &$glo_search->performSearch();
589  $res->mergeEntries($res_glo);
590  }
591  if ($this->options['type'] == 'all' or $this->options['type'] == 'webr') {
592  $web_search = &ilObjectSearchFactory::_getWebresourceSearchInstance($query_parser);
593  $res_web = &$web_search->performSearch();
594  $res->mergeEntries($res_web);
595  }
596  if ($tit_res = $this->__performTitleSearch()) {
597  $res->mergeEntries($tit_res);
598  }
599 
600  return $res;
601  }
static _getWebresourceSearchInstance($query_parser)
get reference of ilFulltextWebresourceSearch
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
const QP_COMBINATION_OR
foreach($_POST as $key=> $value) $res
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 701 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

702  {
703  if (!strlen($this->options['lom_role'])) {
704  return false;
705  }
706  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
707  include_once 'Services/Search/classes/class.ilQueryParser.php';
708 
709 
711  $meta_search->setFilter($this->filter);
712  $meta_search->setMode('contribute');
713  $meta_search->setOptions($this->options);
714  $res = &$meta_search->performSearch();
715 
716  return $res;
717  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performEducationalSearch()

& ilAdvancedSearchGUI::__performEducationalSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __performEntitySearch()

& ilAdvancedSearchGUI::__performEntitySearch ( )

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

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

Referenced by performSearch().

719  {
720  // Return if 'any'
721  if (!$this->options['lom_role_entry']) {
722  return false;
723  }
724 
725  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
726  include_once 'Services/Search/classes/class.ilQueryParser.php';
727 
728  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_role_entry']));
729  #$query_parser->setCombination($this->options['entity_ao']);
730  $query_parser->setCombination(QP_COMBINATION_OR);
731  $query_parser->parse();
732 
733  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
734  $meta_search->setFilter($this->filter);
735  $meta_search->setMode('entity');
736  $meta_search->setOptions($this->options);
737  $res = &$meta_search->performSearch();
738 
739  return $res;
740  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
foreach($_POST as $key=> $value) $res
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 757 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

758  {
759  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
760  include_once 'Services/Search/classes/class.ilQueryParser.php';
761 
762 
764  $meta_search->setFilter($this->filter);
765  $meta_search->setMode('format');
766  $meta_search->setOptions($this->options);
767  $res = &$meta_search->performSearch();
768 
769  return $res;
770  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performGeneralSearch()

& ilAdvancedSearchGUI::__performGeneralSearch ( )

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

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

Referenced by performSearch().

637  {
638  if (!$this->options['lom_coverage'] and !$this->options['lom_structure']) {
639  return false;
640  }
641 
642  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
643  include_once 'Services/Search/classes/class.ilQueryParser.php';
644 
645  if ($this->options['lom_coverage']) {
646  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_coverage']));
647  #$query_parser->setCombination($this->options['coverage_ao']);
648  $query_parser->setCombination(QP_COMBINATION_OR);
649  $query_parser->parse();
650  } else {
651  $query_parser = new ilQueryParser('');
652  }
653  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
654  $meta_search->setFilter($this->filter);
655  $meta_search->setMode('general');
656  $meta_search->setOptions($this->options);
657  $res = &$meta_search->performSearch();
658 
659  return $res;
660  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
foreach($_POST as $key=> $value) $res
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 906 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

907  {
908  // Return if 'any'
909  if (!$this->options['lom_keyword']) {
910  return false;
911  }
912  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
913  include_once 'Services/Search/classes/class.ilQueryParser.php';
914 
915  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_keyword']));
916  #$query_parser->setCombination($this->options['keyword_ao']);
917  $query_parser->setCombination(QP_COMBINATION_OR);
918  $query_parser->parse();
919 
920  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
921  $meta_search->setFilter($this->filter);
922  $meta_search->setMode('keyword');
923  $meta_search->setOptions($this->options);
924  $res = &$meta_search->performSearch();
925 
926  return $res;
927  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
foreach($_POST as $key=> $value) $res
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 684 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

685  {
686  if (!$this->options['lom_language']) {
687  return false;
688  }
689  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
690  include_once 'Services/Search/classes/class.ilQueryParser.php';
691 
692 
694  $meta_search->setFilter($this->filter);
695  $meta_search->setMode('language');
696  $meta_search->setOptions($this->options);
697  $res = &$meta_search->performSearch();
698 
699  return $res;
700  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performLifecycleSearch()

& ilAdvancedSearchGUI::__performLifecycleSearch ( )

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

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

Referenced by performSearch().

663  {
664  // Return if 'any'
665  if (!$this->options['lom_status'] and !$this->options['lom_version']) {
666  return false;
667  }
668  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
669  include_once 'Services/Search/classes/class.ilQueryParser.php';
670 
671  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_version']));
672  #$query_parser->setCombination($this->options['version_ao']);
673  $query_parser->setCombination(QP_COMBINATION_OR);
674  $query_parser->parse();
675 
676  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
677  $meta_search->setFilter($this->filter);
678  $meta_search->setMode('lifecycle');
679  $meta_search->setOptions($this->options);
680  $res = &$meta_search->performSearch();
681 
682  return $res;
683  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
foreach($_POST as $key=> $value) $res
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 743 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

744  {
745  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
746  include_once 'Services/Search/classes/class.ilQueryParser.php';
747 
748 
750  $meta_search->setFilter($this->filter);
751  $meta_search->setMode('requirement');
752  $meta_search->setOptions($this->options);
753  $res = &$meta_search->performSearch();
754 
755  return $res;
756  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRightsSearch()

& ilAdvancedSearchGUI::__performRightsSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

800  {
801  if (!$this->options['lom_copyright'] and !$this->options['lom_costs']) {
802  return false;
803  }
804  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
805  include_once 'Services/Search/classes/class.ilQueryParser.php';
806 
807 
809  $meta_search->setFilter($this->filter);
810  $meta_search->setMode('rights');
811  $meta_search->setOptions($this->options);
812  $res = &$meta_search->performSearch();
813 
814  return $res;
815  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performTaxonSearch()

& ilAdvancedSearchGUI::__performTaxonSearch ( )

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

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

Referenced by performSearch().

837  {
838  // Return if 'any'
839  if (!$this->options['lom_taxon']) {
840  return false;
841  }
842  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
843  include_once 'Services/Search/classes/class.ilQueryParser.php';
844 
845  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_taxon']));
846  $query_parser->setCombination(QP_COMBINATION_OR);
847  $query_parser->parse();
848 
849  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
850  $meta_search->setFilter($this->filter);
851  $meta_search->setMode('taxon');
852  $meta_search->setOptions($this->options);
853  $res = &$meta_search->performSearch();
854 
855  return $res;
856  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
foreach($_POST as $key=> $value) $res
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 604 of file class.ilAdvancedSearchGUI.php.

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

Referenced by __performContentSearch(), and performAdvMDSearch().

605  {
606  if (!$this->options['lom_content']) {
607  return false;
608  }
609 
610  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
611  include_once 'Services/Search/classes/class.ilQueryParser.php';
612 
613  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
614  #$query_parser->setCombination($this->options['title_ao']);
615  $query_parser->setCombination(QP_COMBINATION_OR);
616  $query_parser->parse();
617  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
618 
619  $meta_search->setFilter($this->filter);
620  $meta_search->setMode('title_description');
621  $meta_search->setOptions($this->options);
622  $res_tit = &$meta_search->performSearch();
623 
624  $meta_search->setMode('keyword_all');
625  $res_key = &$meta_search->performSearch();
626 
627  // merge them
628  $res_tit->mergeEntries($res_key);
629 
630 
631  return $res_tit;
632  }
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 785 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __setSearchOptions()

ilAdvancedSearchGUI::__setSearchOptions ( $post_vars)

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

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

Referenced by __construct().

930  {
931  if (isset($_POST['cmd']['performSearch'])) {
932  $this->options = $_SESSION['search_adv'] = $_POST['query'];
933  } elseif (isset($_POST['cmd']['performAdvMDSearch'])) {
934  $this->options = $_SESSION['search_adv_md'] = $_POST;
935  } else {
936  $this->options = $_SESSION['search_adv'];
937  }
938 
939  $_POST['result'] = $_POST['id'];
940 
941  $this->filter = array();
942 
943  $this->options['type'] = 'all';
944  switch ($this->options['type']) {
945  case 'cat':
946  $this->filter[] = 'cat';
947  break;
948 
949  case 'webr':
950  $this->filter[] = 'webr';
951  break;
952 
953  case 'lms':
954  $this->filter[] = 'lm';
955  $this->filter[] = 'dbk';
956  $this->filter[] = 'pg';
957  $this->filter[] = 'st';
958  $this->filter[] = 'sahs';
959  $this->filter[] = 'htlm';
960  break;
961 
962  case 'glo':
963  $this->filter[] = 'glo';
964  break;
965 
966  case 'tst':
967  $this->filter[] = 'tst';
968  $this->filter[] = 'svy';
969  $this->filter[] = 'qpl';
970  $this->filter[] = 'spl';
971  break;
972 
973  case 'mep':
974  $this->filter[] = 'mep';
975  break;
976 
977  case 'crs':
978  $this->filter[] = 'crs';
979  break;
980 
981  case 'file':
982  $this->filter[] = 'file';
983  break;
984 
985  case 'adv_all':
986  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
988  break;
989 
990  case 'all':
991  default:
992  $this->filter[] = 'sess';
993  $this->filter[] = 'webr';
994  $this->filter[] = 'crs';
995  $this->filter[] = 'mep';
996  $this->filter[] = 'tst';
997  $this->filter[] = 'svy';
998  $this->filter[] = 'qpl';
999  $this->filter[] = 'spl';
1000  $this->filter[] = 'glo';
1001  $this->filter[] = 'lm';
1002  $this->filter[] = 'dbk';
1003  $this->filter[] = 'pg';
1004  $this->filter[] = 'st';
1005  $this->filter[] = 'sahs';
1006  $this->filter[] = 'htlm';
1007  $this->filter[] = 'file';
1008  }
1009  return true;
1010  }
$_SESSION["AccountId"]
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 1030 of file class.ilAdvancedSearchGUI.php.

References $res.

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

1031  {
1032  if ($this->stored == false) {
1033  $res->mergeEntries($new_res);
1034  $this->stored = true;
1035 
1036  return true;
1037  } else {
1038  $res->intersectEntries($new_res);
1039  return true;
1040  }
1041  }
foreach($_POST as $key=> $value) $res
+ Here is the caller graph for this function:

◆ executeCommand()

ilAdvancedSearchGUI::executeCommand ( )

Control public.

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

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

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

◆ getRootNode()

ilAdvancedSearchGUI::getRootNode ( )

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

Referenced by performAdvMDSearch(), and performSearch().

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

◆ initAdvancedMetaDataForm()

ilAdvancedSearchGUI::initAdvancedMetaDataForm ( )
protected

protected

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

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

Referenced by showAdvMDSearch().

279  {
280  if (is_object($this->form)) {
281  return $this->form;
282  }
283 
284  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
285  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
286  $this->form = new ilPropertyFormGUI();
287  $this->form->setFormAction($this->ctrl->getFormAction($this, 'performAdvMDSearch'));
288  $this->form->setTitle($this->lng->txt('adv_md_search_title'));
289  $this->form->addCommandButton('performAdvMDSearch', $this->lng->txt('search'));
290  #$this->form->setSubformMode('right');
291 
292  $content = new ilTextInputGUI($this->lng->txt('meta_title') . '/' .
293  $this->lng->txt('meta_keyword') . '/' .
294  $this->lng->txt('meta_description'), 'title');
295  $content->setValue($this->options['title']);
296  $content->setSize(30);
297  $content->setMaxLength(255);
298  // $content->setSubformMode('right');
299  $group = new ilRadioGroupInputGUI('', 'title_ao');
300  $group->setValue($this->options['title_ao']);
301  $radio_option = new ilRadioOption($this->lng->txt("search_any_word"), 0);
302  $group->addOption($radio_option);
303  $radio_option = new ilRadioOption($this->lng->txt("search_all_words"), 1);
304  $group->addOption($radio_option);
305  $content->addSubItem($group);
306  $this->form->addItem($content);
307 
308  $type = new ilSelectInputGUI($this->lng->txt('type'), 'type');
309  $options['adv_all'] = $this->lng->txt('search_any');
310  foreach (ilAdvancedMDRecord::_getActivatedObjTypes() as $obj_type) {
311  $options[$obj_type] = $this->lng->txt('objs_' . $obj_type);
312  }
313  $type->setOptions($options);
314  $type->setValue($this->options['type']);
315  $this->form->addItem($type);
316 
317  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
319  $record_gui->setPropertyForm($this->form);
320  $record_gui->setSearchValues($this->options);
321  $record_gui->parse();
322  }
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.
$type
This class represents a property in a property form.
$options
array of all options select boxes,'and' 'or' and query strings public
if(isset($_POST['submit'])) $form
addSubItem($a_item)
Add Subitem.
This class represents a text property in a property form.
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 409 of file class.ilAdvancedSearchGUI.php.

References $DIC, $form, $section, $tree, and fields.

Referenced by searchAdvancedMD(), and showSearch().

410  {
411  global $DIC;
412 
413  $tree = $DIC['tree'];
414 
415  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
416 
417  $this->form = new ilPropertyFormGUI();
418  $this->form->setFormAction($this->ctrl->getFormAction($this, 'performSearch'));
419  $this->form->setTitle($this->lng->txt('search_advanced'));
420  $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
421  $this->form->addCommandButton('reset', $this->lng->txt('reset'));
422 
423  foreach ($this->fields->getActiveSections() as $definition) {
424  if ($definition['name'] != 'default') {
426  $section->setTitle($definition['name']);
427  $this->form->addItem($section);
428  }
429 
430  foreach ($definition['fields'] as $field_name) {
431  if (is_object($element = $this->fields->getFormElement($this->search_cache->getQuery(), $field_name, $this->form))) {
432  $this->form->addItem($element);
433  }
434  }
435  }
436  return true;
437  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
This class represents a section header in a property form.
$errors fields
Definition: imgupload.php:51
$section
Definition: Utf8Test.php:83
if(isset($_POST['submit'])) $form
+ 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 1106 of file class.ilAdvancedSearchGUI.php.

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

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

1107  {
1108  if ($type == self::TYPE_LOM) {
1109  $_SESSION['search_last_sub_section'] = self::TYPE_LOM;
1110  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1111  } else {
1112  $_SESSION['search_last_sub_section'] = self::TYPE_ADV_MD;
1113  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_MD_SEARCH);
1114  }
1115  }
$_SESSION["AccountId"]
$type
+ Here is the caller graph for this function:

◆ initUserSearchCache()

ilAdvancedSearchGUI::initUserSearchCache ( )
private

Init user search cache.

private

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

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

Referenced by executeCommand().

1050  {
1051  global $DIC;
1052 
1053  $ilUser = $DIC['ilUser'];
1054 
1055  include_once('Services/Search/classes/class.ilUserSearchCache.php');
1056  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
1057  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1058  if ($_GET['page_number']) {
1059  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
1060  }
1061  if ($_POST['cmd']['performSearch']) {
1062  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['query']['lomContent']));
1063  $this->search_cache->save();
1064  }
1065  }
global $DIC
Definition: saml.php:7
$_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 329 of file class.ilAdvancedSearchGUI.php.

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

330  {
331  global $DIC;
332 
333  $ilUser = $DIC['ilUser'];
334 
335  $this->initSearchType(self::TYPE_ADV_MD);
336  if (!isset($_GET['page_number']) and $this->search_mode != 'in_results') {
337  unset($_SESSION['adv_max_page']);
338  $this->search_cache->delete();
339  }
340 
341  include_once 'Services/Search/classes/class.ilSearchResult.php';
342  $res = new ilSearchResult();
343 
344  if ($res_tit = &$this->__performTitleSearch()) {
345  $this->__storeEntries($res, $res_tit);
346  }
347  $this->searchAdvancedMD($res);
348 
349  if ($this->search_mode == 'in_results') {
350  include_once 'Services/Search/classes/class.ilSearchResult.php';
351 
352  $old_result_obj = new ilSearchResult($ilUser->getId());
353  $old_result_obj->read(ADVANCED_MD_SEARCH);
354 
355  $res->diffEntriesFromResult($old_result_obj);
356  }
357 
358 
359  $res->filter($this->getRootNode(), true);
360  $res->save();
361  $this->showAdvMDSearch();
362 
363  if (!count($res->getResults())) {
364  ilUtil::sendInfo($this->lng->txt('search_no_match'));
365  }
366 
367  if ($res->isLimitReached()) {
368  #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
369  #ilUtil::sendInfo($message);
370  }
371 
372  $this->addPager($res, 'adv_max_page');
373 
374  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
376  $presentation->setResults($res->getResultsForPresentation());
377  $presentation->setPreviousNext($this->prev_link, $this->next_link);
378 
379  if ($presentation->render()) {
380  $this->tpl->setVariable('RESULTS', $presentation->getHTML(true));
381  }
382  return true;
383  }
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"]
global $DIC
Definition: saml.php:7
$_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.
foreach($_POST as $key=> $value) $res
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 172 of file class.ilAdvancedSearchGUI.php.

References $_GET, $_POST, $_SESSION, $DIC, $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().

173  {
174  global $DIC;
175 
176  $ilUser = $DIC['ilUser'];
177 
178  $this->initSearchType(self::TYPE_LOM);
179 
180  if (!isset($_GET['page_number']) and $this->search_mode != 'in_results') {
181  unset($_SESSION['adv_max_page']);
182  $this->search_cache->deleteCachedEntries();
183  }
184 
185  if (isset($_POST['query'])) {
186  $this->search_cache->setQuery($_POST['query']);
187  }
188 
189 
190  include_once 'Services/Search/classes/class.ilSearchResult.php';
191  $res = new ilSearchResult();
192 
193  if ($res_con = &$this->__performContentSearch()) {
194  $this->__storeEntries($res, $res_con);
195  }
196  if ($res_lan = &$this->__performLanguageSearch()) {
197  $this->__storeEntries($res, $res_lan);
198  }
199  if ($res_gen = &$this->__performGeneralSearch()) {
200  $this->__storeEntries($res, $res_gen);
201  }
202  if ($res_lif = &$this->__performLifecycleSearch()) {
203  $this->__storeEntries($res, $res_lif);
204  }
205  if ($res_con = &$this->__performContributeSearch()) {
206  $this->__storeEntries($res, $res_con);
207  }
208  if ($res_ent = &$this->__performEntitySearch()) {
209  $this->__storeEntries($res, $res_ent);
210  }
211  if ($res_req = &$this->__performRequirementSearch()) {
212  $this->__storeEntries($res, $res_req);
213  }
214  if ($res_for = &$this->__performFormatSearch()) {
215  $this->__storeEntries($res, $res_for);
216  }
217  if ($res_edu = &$this->__performEducationalSearch()) {
218  $this->__storeEntries($res, $res_edu);
219  }
220  if ($res_typ = &$this->__performTypicalAgeRangeSearch()) {
221  $this->__storeEntries($res, $res_typ);
222  }
223  if ($res_rig = &$this->__performRightsSearch()) {
224  $this->__storeEntries($res, $res_rig);
225  }
226  if ($res_cla = &$this->__performClassificationSearch()) {
227  $this->__storeEntries($res, $res_cla);
228  }
229  if ($res_tax = &$this->__performTaxonSearch()) {
230  $this->__storeEntries($res, $res_tax);
231  }
232  if ($res_key = &$this->__performKeywordSearch()) {
233  $this->__storeEntries($res, $res_key);
234  }
235 
236  $this->searchAdvancedMD($res);
237 
238  if ($this->search_mode == 'in_results') {
239  include_once 'Services/Search/classes/class.ilSearchResult.php';
240 
241  $old_result_obj = new ilSearchResult($ilUser->getId());
242  $old_result_obj->read(ADVANCED_MD_SEARCH);
243 
244  $res->diffEntriesFromResult($old_result_obj);
245  }
246 
247  $res->filter($this->getRootNode(), (ilSearchSettings::getInstance()->getDefaultOperator() == ilSearchSettings::OPERATOR_AND));
248  $res->save();
249  $this->showSearch();
250 
251  if (!count($res->getResults())) {
252  ilUtil::sendInfo($this->lng->txt('search_no_match'));
253  }
254 
255  if ($res->isLimitReached()) {
256  #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
257  #ilUtil::sendInfo($message);
258  }
259 
260  $this->addPager($res, 'adv_max_page');
261 
262  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
264  $presentation->setResults($res->getResultsForPresentation());
265  $presentation->setPreviousNext($this->prev_link, $this->next_link);
266 
267  if ($presentation->render()) {
268  $this->tpl->setVariable('RESULTS', $presentation->getHTML(true));
269  }
270  return true;
271  }
read($a_type=DEFAULT_SEARCH)
read search results
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_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.
foreach($_POST as $key=> $value) $res
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 457 of file class.ilAdvancedSearchGUI.php.

References $DIC.

Referenced by executeCommand().

458  {
459  global $DIC;
460 
461  $ilTabs = $DIC['ilTabs'];
462  $ilHelp = $DIC['ilHelp'];
463 
464  parent::prepareOutput();
465 
466  $ilHelp->setScreenIdComponent("src");
467 
468  $ilTabs->addTab(
469  "search",
470  $this->lng->txt("search"),
471  $this->ctrl->getLinkTargetByClass('ilsearchgui')
472  );
473  $ilTabs->addTab(
474  "adv_search",
475  $this->lng->txt("search_advanced"),
476  $this->ctrl->getLinkTarget($this)
477  );
478  $ilTabs->activateTab("adv_search");
479  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ remoteSearch()

ilAdvancedSearchGUI::remoteSearch ( )
protected

Search from main menu.

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

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

158  {
159  $this->search_cache->setRoot((int) $_POST['root_id']);
160  $this->search_cache->setResultPageNumber(1);
161  $this->search_cache->setQuery(array('lom_content' => ilUtil::stripSlashes($_POST['queryString'])));
162  $this->search_cache->save();
163 
164  $this->options = $this->search_cache->getQuery();
165  $this->options['type'] = 'all';
166 
167  $this->performSearch();
168  }
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:

◆ reset()

ilAdvancedSearchGUI::reset ( )

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

References initSearchType(), and showSearch().

135  {
136  $this->initSearchType(self::TYPE_LOM);
137  $this->options = array();
138  $this->search_cache->setQuery(array());
139  $this->search_cache->save();
140  $this->showSearch();
141  }
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
+ 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 865 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performAdvMDSearch(), and performSearch().

866  {
867  $this->initFormSearch();
868 
869  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
870  foreach (array_keys($this->options) as $key) {
871  if (substr($key, 0, 3) != 'adv') {
872  continue;
873  }
874 
875  // :TODO: ?
876  if (!$key) {
877  continue;
878  }
879 
880  $field_id = substr($key, 4);
881  $field = ilAdvancedMDFieldDefinition::getInstance($field_id);
882 
883  $field_form = ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), true, false);
884  $field_form->setElementId("query[" . $key . "]");
885  $field_form->setForm($this->form);
886 
887  // reload search values
888  $field_form->importFromPost($this->options);
889  $field_form->validate();
890 
891  $parser_value = $field->getSearchQueryParserValue($field_form);
892 
893  include_once 'Services/Search/classes/class.ilQueryParser.php';
894  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
895  $adv_md_search = ilObjectSearchFactory::_getAdvancedMDSearchInstance(new ilQueryParser($parser_value));
896  $adv_md_search->setFilter($this->filter);
897  $adv_md_search->setDefinition($field);
898  $adv_md_search->setSearchElement($field_form);
899  $res_field = $adv_md_search->performSearch();
900  if ($res_field instanceof ilSearchResult) {
901  $this->__storeEntries($res, $res_field);
902  }
903  }
904  }
initFormSearch()
Show search form.
static getInstance()
Get singleton.
static _getAdvancedMDSearchInstance($query_parser)
get advanced meta data search instance
foreach($_POST as $key=> $value) $res
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchInResults()

ilAdvancedSearchGUI::searchInResults ( )

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

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

144  {
145  $this->initSearchType(self::TYPE_LOM);
146  $this->search_mode = 'in_results';
147  $this->search_cache->setResultPageNumber(1);
148  unset($_SESSION['adv_max_page']);
149  $this->performSearch();
150 
151  return true;
152  }
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 1073 of file class.ilAdvancedSearchGUI.php.

References $DIC, and ilAdvancedMDFieldDefinition\getSearchableDefinitionIds().

Referenced by showAdvMDSearch(), and showSearch().

1074  {
1075  global $DIC;
1076 
1077  $ilTabs = $DIC['ilTabs'];
1078 
1079  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1081  return true;
1082  }
1083  $ilTabs->addSubTabTarget('search_lom', $this->ctrl->getLinkTarget($this, 'showSavedResults'));
1084  #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults'));
1085  }
global $DIC
Definition: saml.php:7
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 391 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performAdvMDSearch(), and showSavedAdvMDResults().

392  {
393  if (isset($_SESSION['search_adv_md'])) {
394  $this->options = $_SESSION['search_adv_md'];
395  }
396  $this->setSubTabs();
397  $this->tabs_gui->setSubTabActive('search_adv_md');
398 
399  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.advanced_adv_search.html', 'Services/Search');
400 
401  $this->initAdvancedMetaDataForm();
402  $this->tpl->setVariable('SEARCH_FORM', $this->form->getHTML());
403  return true;
404  }
$_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 488 of file class.ilAdvancedSearchGUI.php.

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

489  {
490  global $DIC;
491 
492  $ilUser = $DIC['ilUser'];
493 
494  // Read old result sets
495  include_once 'Services/Search/classes/class.ilSearchResult.php';
496 
497  $this->initSearchType(self::TYPE_ADV_MD);
498  $result_obj = new ilSearchResult($ilUser->getId());
499  $result_obj->read(ADVANCED_MD_SEARCH);
500 
501  $this->showAdvMDSearch();
502 
503  // Show them
504  if (count($result_obj->getResults())) {
505  $this->addPager($result_obj, 'adv_max_page');
506 
507  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
509  $presentation->setResults($result_obj->getResultsForPresentation());
510  $presentation->setPreviousNext($this->prev_link, $this->next_link);
511 
512  if ($presentation->render()) {
513  $this->tpl->setVariable('RESULTS', $presentation->getHTML(true));
514  }
515  }
516 
517  return true;
518  }
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.
global $DIC
Definition: saml.php:7
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 521 of file class.ilAdvancedSearchGUI.php.

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

522  {
523  global $DIC;
524 
525  $ilUser = $DIC['ilUser'];
526 
527  // Read old result sets
528  include_once 'Services/Search/classes/class.ilSearchResult.php';
529 
530  $this->initSearchType(self::TYPE_LOM);
531  $result_obj = new ilSearchResult($ilUser->getId());
532  $result_obj->read(ADVANCED_SEARCH);
533 
534  $this->showSearch();
535 
536  // Show them
537  if (count($result_obj->getResults())) {
538  $this->addPager($result_obj, 'adv_max_page');
539 
540  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
542  $presentation->setResults($result_obj->getResultsForPresentation());
543  $presentation->setPreviousNext($this->prev_link, $this->next_link);
544 
545  if ($presentation->render()) {
546  $this->tpl->setVariable('RESULTS', $presentation->getHTML(true));
547  }
548  }
549 
550  return true;
551  }
read($a_type=DEFAULT_SEARCH)
read search results
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
global $DIC
Definition: saml.php:7
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 441 of file class.ilAdvancedSearchGUI.php.

References $DIC, initFormSearch(), and setSubTabs().

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

442  {
443  global $DIC;
444 
445  $ilLocator = $DIC['ilLocator'];
446 
447  $this->setSubTabs();
448  $this->tabs_gui->setSubTabActive('search_lom');
449 
450  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.advanced_search.html', 'Services/Search');
451 
452  $this->initFormSearch();
453  $this->tpl->setVariable('SEARCH_FORM', $this->form->getHTML());
454  return true;
455  }
global $DIC
Definition: saml.php:7
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 1094 of file class.ilAdvancedSearchGUI.php.

References $time.

1095  {
1096  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1097  }
$time
Definition: cron.php:21

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: