ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 cancelObject ()
 
 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...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

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
 
 $favourites
 
 $user
 

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, ILIAS\GlobalScreen\Provider\__construct(), __setSearchOptions(), fields, and ilLuceneAdvancedSearchFields\getInstance().

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

Member Function Documentation

◆ __getFilterSelect()

ilAdvancedSearchGUI::__getFilterSelect ( )

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

References $options, and ilUtil\formSelect().

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __performContentSearch()

& ilAdvancedSearchGUI::__performContentSearch ( )

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

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __performEducationalSearch()

& ilAdvancedSearchGUI::__performEducationalSearch ( )

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __performEntitySearch()

& ilAdvancedSearchGUI::__performEntitySearch ( )

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

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

Referenced by performSearch().

718  {
719  // Return if 'any'
720  if (!$this->options['lom_role_entry']) {
721  return false;
722  }
723 
724  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
725  include_once 'Services/Search/classes/class.ilQueryParser.php';
726 
727  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_role_entry']));
728  #$query_parser->setCombination($this->options['entity_ao']);
729  $query_parser->setCombination(QP_COMBINATION_OR);
730  $query_parser->parse();
731 
732  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
733  $meta_search->setFilter($this->filter);
734  $meta_search->setMode('entity');
735  $meta_search->setOptions($this->options);
736  $res = &$meta_search->performSearch();
737 
738  return $res;
739  }
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
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performFormatSearch()

& ilAdvancedSearchGUI::__performFormatSearch ( )

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __performGeneralSearch()

& ilAdvancedSearchGUI::__performGeneralSearch ( )

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

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

Referenced by performSearch().

636  {
637  if (!$this->options['lom_coverage'] and !$this->options['lom_structure']) {
638  return false;
639  }
640 
641  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
642  include_once 'Services/Search/classes/class.ilQueryParser.php';
643 
644  if ($this->options['lom_coverage']) {
645  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_coverage']));
646  #$query_parser->setCombination($this->options['coverage_ao']);
647  $query_parser->setCombination(QP_COMBINATION_OR);
648  $query_parser->parse();
649  } else {
650  $query_parser = new ilQueryParser('');
651  }
652  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
653  $meta_search->setFilter($this->filter);
654  $meta_search->setMode('general');
655  $meta_search->setOptions($this->options);
656  $res = &$meta_search->performSearch();
657 
658  return $res;
659  }
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
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performKeywordSearch()

& ilAdvancedSearchGUI::__performKeywordSearch ( )

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

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

Referenced by performSearch().

906  {
907  // Return if 'any'
908  if (!$this->options['lom_keyword']) {
909  return false;
910  }
911  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
912  include_once 'Services/Search/classes/class.ilQueryParser.php';
913 
914  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_keyword']));
915  #$query_parser->setCombination($this->options['keyword_ao']);
916  $query_parser->setCombination(QP_COMBINATION_OR);
917  $query_parser->parse();
918 
919  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
920  $meta_search->setFilter($this->filter);
921  $meta_search->setMode('keyword');
922  $meta_search->setOptions($this->options);
923  $res = &$meta_search->performSearch();
924 
925  return $res;
926  }
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
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performLanguageSearch()

& ilAdvancedSearchGUI::__performLanguageSearch ( )

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __performLifecycleSearch()

& ilAdvancedSearchGUI::__performLifecycleSearch ( )

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

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

Referenced by performSearch().

662  {
663  // Return if 'any'
664  if (!$this->options['lom_status'] and !$this->options['lom_version']) {
665  return false;
666  }
667  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
668  include_once 'Services/Search/classes/class.ilQueryParser.php';
669 
670  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_version']));
671  #$query_parser->setCombination($this->options['version_ao']);
672  $query_parser->setCombination(QP_COMBINATION_OR);
673  $query_parser->parse();
674 
675  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
676  $meta_search->setFilter($this->filter);
677  $meta_search->setMode('lifecycle');
678  $meta_search->setOptions($this->options);
679  $res = &$meta_search->performSearch();
680 
681  return $res;
682  }
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
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRequirementSearch()

& ilAdvancedSearchGUI::__performRequirementSearch ( )

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __performRightsSearch()

& ilAdvancedSearchGUI::__performRightsSearch ( )

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

799  {
800  if (!$this->options['lom_copyright'] and !$this->options['lom_costs']) {
801  return false;
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('rights');
810  $meta_search->setOptions($this->options);
811  $res = &$meta_search->performSearch();
812 
813  return $res;
814  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
foreach($_POST as $key=> $value) $res
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performTaxonSearch()

& ilAdvancedSearchGUI::__performTaxonSearch ( )

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

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

Referenced by performSearch().

836  {
837  // Return if 'any'
838  if (!$this->options['lom_taxon']) {
839  return false;
840  }
841  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
842  include_once 'Services/Search/classes/class.ilQueryParser.php';
843 
844  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_taxon']));
845  $query_parser->setCombination(QP_COMBINATION_OR);
846  $query_parser->parse();
847 
848  $meta_search = &ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
849  $meta_search->setFilter($this->filter);
850  $meta_search->setMode('taxon');
851  $meta_search->setOptions($this->options);
852  $res = &$meta_search->performSearch();
853 
854  return $res;
855  }
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
filter()
Definition: filter.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performTitleSearch()

& ilAdvancedSearchGUI::__performTitleSearch ( )

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

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

Referenced by __performContentSearch(), and performAdvMDSearch().

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

◆ __performTypicalAgeRangeSearch()

& ilAdvancedSearchGUI::__performTypicalAgeRangeSearch ( )

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

References $res, ilObjectSearchFactory\_getAdvancedSearchInstance(), and filter().

Referenced by performSearch().

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

◆ __setSearchOptions()

ilAdvancedSearchGUI::__setSearchOptions ( $post_vars)

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

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

Referenced by __construct().

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

References $res.

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

1030  {
1031  if ($this->stored == false) {
1032  $res->mergeEntries($new_res);
1033  $this->stored = true;
1034 
1035  return true;
1036  } else {
1037  $res->intersectEntries($new_res);
1038  return true;
1039  }
1040  }
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  $this->prepareOutput();
128  $this->handleCommand($cmd);
129  break;
130  }
131  return true;
132  }
$_SESSION["AccountId"]
GUI class for the workflow of copying objects.
global $DIC
Definition: goto.php:24
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.

References ROOT_FOLDER_ID.

Referenced by performAdvMDSearch(), and performSearch().

83  {
84  return ROOT_FOLDER_ID;
85  }
const ROOT_FOLDER_ID
Definition: constants.php:30
+ Here is the caller graph for this function:

◆ initAdvancedMetaDataForm()

ilAdvancedSearchGUI::initAdvancedMetaDataForm ( )
protected

protected

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

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

Referenced by showAdvMDSearch().

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

References $DIC, $section, and fields.

Referenced by searchAdvancedMD(), and showSearch().

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

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

◆ initUserSearchCache()

ilAdvancedSearchGUI::initUserSearchCache ( )
private

Init user search cache.

private

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

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

Referenced by executeCommand().

1049  {
1050  global $DIC;
1051 
1052  $ilUser = $DIC['ilUser'];
1053 
1054  include_once('Services/Search/classes/class.ilUserSearchCache.php');
1055  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
1056  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1057  if ($_GET['page_number']) {
1058  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
1059  }
1060  if ($_POST['cmd']['performSearch']) {
1061  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['query']['lomContent']));
1062  $this->search_cache->save();
1063  }
1064  }
$_GET["client_id"]
static _getInstance($a_usr_id)
Get singleton instance.
global $DIC
Definition: goto.php:24
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$ilUser
Definition: imgupload.php:18
$_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 328 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().

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

◆ performSearch()

ilAdvancedSearchGUI::performSearch ( )

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

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

◆ prepareOutput()

ilAdvancedSearchGUI::prepareOutput ( )

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

References $DIC.

Referenced by executeCommand().

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

◆ remoteSearch()

ilAdvancedSearchGUI::remoteSearch ( )
protected

Search from main menu.

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

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

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

References initSearchType(), and showSearch().

134  {
135  $this->initSearchType(self::TYPE_LOM);
136  $this->options = array();
137  $this->search_cache->setQuery(array());
138  $this->search_cache->save();
139  $this->showSearch();
140  }
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 864 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performAdvMDSearch(), and performSearch().

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

◆ searchInResults()

ilAdvancedSearchGUI::searchInResults ( )

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

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

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

References $DIC, and ilAdvancedMDFieldDefinition\getSearchableDefinitionIds().

Referenced by showAdvMDSearch(), and showSearch().

1073  {
1074  global $DIC;
1075 
1076  $ilTabs = $DIC['ilTabs'];
1077 
1078  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1080  return true;
1081  }
1082  $ilTabs->addSubTabTarget('search_lom', $this->ctrl->getLinkTarget($this, 'showSavedResults'));
1083  #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults'));
1084  }
static getSearchableDefinitionIds()
Get searchable definition ids (performance is key)
global $DIC
Definition: goto.php:24
+ 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 390 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performAdvMDSearch(), and showSavedAdvMDResults().

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

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

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

◆ showSavedResults()

ilAdvancedSearchGUI::showSavedResults ( )

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

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

521  {
522  global $DIC;
523 
524  $ilUser = $DIC['ilUser'];
525 
526  // Read old result sets
527  include_once 'Services/Search/classes/class.ilSearchResult.php';
528 
529  $this->initSearchType(self::TYPE_LOM);
530  $result_obj = new ilSearchResult($ilUser->getId());
531  $result_obj->read(ADVANCED_SEARCH);
532 
533  $this->showSearch();
534 
535  // Show them
536  if (count($result_obj->getResults())) {
537  $this->addPager($result_obj, 'adv_max_page');
538 
539  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
541  $presentation->setResults($result_obj->getResultsForPresentation());
542  $presentation->setPreviousNext($this->prev_link, $this->next_link);
543 
544  if ($presentation->render()) {
545  $this->tpl->setVariable('RESULTS', $presentation->getHTML(true));
546  }
547  }
548 
549  return true;
550  }
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.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ showSearch()

ilAdvancedSearchGUI::showSearch ( )

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

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

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

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

1094  {
1095  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1096  }

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: