ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAdvancedSearchGUI Class Reference
+ Inheritance diagram for ilAdvancedSearchGUI:
+ Collaboration diagram for ilAdvancedSearchGUI:

Public Member Functions

 ilAdvancedSearchGUI ()
 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
 ilSearchBaseGUI ()
 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...
 
 performDelete ()
 Delete objects. More...
 
 cut ()
 Interface ilAdministrationCommandHandler. More...
 
 link ()
 Interface ilAdministrationCommandHandler. More...
 
 paste ()
 Paste. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection link. More...
 
 showMoveIntoObjectTree ()
 Target selection cut. More...
 
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects. More...
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 Enable administration panel. More...
 
 disableAdministrationPanel ()
 Disable administration panel. More...
 
 addLocator ()
 Add Locator. More...
 
 autoComplete ()
 Data resource for autoComplete. More...
 

Data Fields

const TYPE_LOM = 1
 
const TYPE_ADV_MD = 2
 
- Data Fields inherited from ilSearchBaseGUI
const SEARCH_FAST = 1
 
const SEARCH_DETAILS = 2
 
const SEARCH_AND = 'and'
 
const SEARCH_OR = 'or'
 
const SEARCH_FORM_LUCENE = 1
 
const SEARCH_FORM_STANDARD = 2
 
const SEARCH_FORM_USER = 3
 
 $settings = null
 
 $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...
 

Protected Attributes

 $last_section = 'adv_search'
 
 $fields = array()
 
 $tabs_gui
 
- Protected Attributes inherited from ilSearchBaseGUI
 $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.

Member Function Documentation

◆ __getFilterSelect()

ilAdvancedSearchGUI::__getFilterSelect ( )

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

References $options, and ilUtil\formSelect().

1070  {
1071  $options = array('all' => $this->lng->txt('search_any'),
1072  'crs' => $this->lng->txt('objs_crs'),
1073  'lms' => $this->lng->txt('learning_resources'),
1074  'glo' => $this->lng->txt('objs_glo'),
1075  'mep' => $this->lng->txt('objs_mep'),
1076  'tst' => $this->lng->txt('search_tst_svy'),
1077  'file'=> $this->lng->txt('objs_file'),
1078  'webr' => $this->lng->txt('objs_webr'));
1079 
1080 
1081  return ilUtil::formSelect($this->options['type'],'search_adv[type]',$options,false,true);
1082  }
$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 845 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __performContentSearch()

& ilAdvancedSearchGUI::__performContentSearch ( )

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

565  {
566  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
567  include_once 'Services/Search/classes/class.ilQueryParser.php';
568  include_once 'Services/Search/classes/class.ilSearchResult.php';
569 
570  if(!$this->options['lom_content'])
571  {
572  return false;
573  }
574 
575  $res =& new ilSearchResult();
576 
577  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
578  #$query_parser->setCombination($this->options['content_ao']);
579  $query_parser->setCombination(QP_COMBINATION_OR);
580  $query_parser->parse();
581 
582  if($this->options['type'] == 'all' or $this->options['type'] == 'lms')
583  {
584  // LM content search
585  $lm_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
586  $res_cont =& $lm_search->performSearch();
587  $res->mergeEntries($res_cont);
588  }
589  if($this->options['type'] == 'all' or $this->options['type'] == 'tst')
590  {
591  $tst_search =& ilObjectSearchFactory::_getTestSearchInstance($query_parser);
592  $res_tes =& $tst_search->performSearch();
593  $res->mergeEntries($res_tes);
594  }
595  if($this->options['type'] == 'all' or $this->options['type'] == 'mep')
596  {
597  $med_search =& ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
598  $res_med =& $med_search->performSearch();
599  $res->mergeEntries($res_med);
600  }
601  if($this->options['type'] == 'all' or $this->options['type'] == 'glo')
602  {
604  $res_glo =& $glo_search->performSearch();
605  $res->mergeEntries($res_glo);
606  }
607  if($this->options['type'] == 'all' or $this->options['type'] == 'webr')
608  {
609  $web_search =& ilObjectSearchFactory::_getWebresourceSearchInstance($query_parser);
610  $res_web =& $web_search->performSearch();
611  $res->mergeEntries($res_web);
612  }
613  if($tit_res = $this->__performTitleSearch())
614  {
615  $res->mergeEntries($tit_res);
616  }
617 
618  return $res;
619  }
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
const QP_COMBINATION_OR
_getWebresourceSearchInstance($query_parser)
get reference of ilFulltextWebresourceSearch
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 726 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __performEducationalSearch()

& ilAdvancedSearchGUI::__performEducationalSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __performEntitySearch()

& ilAdvancedSearchGUI::__performEntitySearch ( )

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

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

Referenced by performSearch().

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

◆ __performFormatSearch()

& ilAdvancedSearchGUI::__performFormatSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

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('format');
793  $meta_search->setOptions($this->options);
794  $res =& $meta_search->performSearch();
795 
796  return $res;
797  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performGeneralSearch()

& ilAdvancedSearchGUI::__performGeneralSearch ( )

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

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

Referenced by performSearch().

656  {
657  if(!$this->options['lom_coverage'] and !$this->options['lom_structure'])
658  {
659  return false;
660  }
661 
662  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
663  include_once 'Services/Search/classes/class.ilQueryParser.php';
664 
665  if($this->options['lom_coverage'])
666  {
667  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_coverage']));
668  #$query_parser->setCombination($this->options['coverage_ao']);
669  $query_parser->setCombination(QP_COMBINATION_OR);
670  $query_parser->parse();
671  }
672  else
673  {
674  $query_parser = new ilQueryParser('');
675  }
676  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
677  $meta_search->setFilter($this->filter);
678  $meta_search->setMode('general');
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
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 957 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

958  {
959  // Return if 'any'
960  if(!$this->options['lom_keyword'])
961  {
962  return false;
963  }
964  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
965  include_once 'Services/Search/classes/class.ilQueryParser.php';
966 
967  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_keyword']));
968  #$query_parser->setCombination($this->options['keyword_ao']);
969  $query_parser->setCombination(QP_COMBINATION_OR);
970  $query_parser->parse();
971 
972  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
973  $meta_search->setFilter($this->filter);
974  $meta_search->setMode('keyword');
975  $meta_search->setOptions($this->options);
976  $res =& $meta_search->performSearch();
977 
978  return $res;
979  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performLanguageSearch()

& ilAdvancedSearchGUI::__performLanguageSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __performLifecycleSearch()

& ilAdvancedSearchGUI::__performLifecycleSearch ( )

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

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

Referenced by performSearch().

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

◆ __performRequirementSearch()

& ilAdvancedSearchGUI::__performRequirementSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

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('requirement');
779  $meta_search->setOptions($this->options);
780  $res =& $meta_search->performSearch();
781 
782  return $res;
783  }
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRightsSearch()

& ilAdvancedSearchGUI::__performRightsSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __performTaxonSearch()

& ilAdvancedSearchGUI::__performTaxonSearch ( )

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

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

Referenced by performSearch().

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

◆ __performTitleSearch()

& ilAdvancedSearchGUI::__performTitleSearch ( )

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

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

Referenced by __performContentSearch(), and performAdvMDSearch().

623  {
624  if(!$this->options['lom_content'])
625  {
626  return false;
627  }
628 
629  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
630  include_once 'Services/Search/classes/class.ilQueryParser.php';
631 
632  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
633  #$query_parser->setCombination($this->options['title_ao']);
634  $query_parser->setCombination(QP_COMBINATION_OR);
635  $query_parser->parse();
636  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
637 
638  $meta_search->setFilter($this->filter);
639  $meta_search->setMode('title_description');
640  $meta_search->setOptions($this->options);
641  $res_tit =& $meta_search->performSearch();
642 
643  $meta_search->setMode('keyword_all');
644  $res_key =& $meta_search->performSearch();
645 
646  // merge them
647  $res_tit->mergeEntries($res_key);
648 
649 
650  return $res_tit;
651  }
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 812 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

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

◆ __setSearchOptions()

ilAdvancedSearchGUI::__setSearchOptions ( $post_vars)

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

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

Referenced by ilAdvancedSearchGUI().

982  {
983  if(isset($_POST['cmd']['performSearch']))
984  {
985  $this->options = $_SESSION['search_adv'] = $_POST['query'];
986  }
987  elseif(isset($_POST['cmd']['performAdvMDSearch']))
988  {
989  $this->options = $_SESSION['search_adv_md'] = $_POST;
990  }
991  else
992  {
993  $this->options = $_SESSION['search_adv'];
994  }
995 
996  $_POST['result'] = $_POST['id'];
997 
998  $this->filter = array();
999 
1000  $this->options['type'] = 'all';
1001  switch($this->options['type'])
1002  {
1003  case 'cat':
1004  $this->filter[] = 'cat';
1005  break;
1006 
1007  case 'webr':
1008  $this->filter[] = 'webr';
1009  break;
1010 
1011  case 'lms':
1012  $this->filter[] = 'lm';
1013  $this->filter[] = 'dbk';
1014  $this->filter[] = 'pg';
1015  $this->filter[] = 'st';
1016  $this->filter[] = 'sahs';
1017  $this->filter[] = 'htlm';
1018  break;
1019 
1020  case 'glo':
1021  $this->filter[] = 'glo';
1022  break;
1023 
1024  case 'tst':
1025  $this->filter[] = 'tst';
1026  $this->filter[] = 'svy';
1027  $this->filter[] = 'qpl';
1028  $this->filter[] = 'spl';
1029  break;
1030 
1031  case 'mep':
1032  $this->filter[] = 'mep';
1033  break;
1034 
1035  case 'crs':
1036  $this->filter[] = 'crs';
1037  break;
1038 
1039  case 'file':
1040  $this->filter[] = 'file';
1041  break;
1042 
1043  case 'adv_all':
1044  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1046  break;
1047 
1048  case 'all':
1049  default:
1050  $this->filter[] = 'webr';
1051  $this->filter[] = 'crs';
1052  $this->filter[] = 'mep';
1053  $this->filter[] = 'tst';
1054  $this->filter[] = 'svy';
1055  $this->filter[] = 'qpl';
1056  $this->filter[] = 'spl';
1057  $this->filter[] = 'glo';
1058  $this->filter[] = 'lm';
1059  $this->filter[] = 'dbk';
1060  $this->filter[] = 'pg';
1061  $this->filter[] = 'st';
1062  $this->filter[] = 'sahs';
1063  $this->filter[] = 'htlm';
1064  $this->filter[] = 'file';
1065  }
1066  return true;
1067  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static _getActivatedObjTypes()
get activated obj types
+ 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 1085 of file class.ilAdvancedSearchGUI.php.

References $res.

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

1086  {
1087  if($this->stored == false)
1088  {
1089  $res->mergeEntries($new_res);
1090  $this->stored = true;
1091 
1092  return true;
1093  }
1094  else
1095  {
1096  $res->intersectEntries($new_res);
1097  return true;
1098  }
1099  }
+ Here is the caller graph for this function:

◆ executeCommand()

& ilAdvancedSearchGUI::executeCommand ( )

Control public.

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

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

91  {
92  global $rbacsystem;
93 
94  $next_class = $this->ctrl->getNextClass($this);
95  $cmd = $this->ctrl->getCmd();
96 
97  switch($next_class)
98  {
99 
100  case 'ilobjectcopygui':
101  $this->prepareOutput();
102 
103  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
104  $cp = new ilObjectCopyGUI($this);
105  $this->ctrl->forwardCommand($cp);
106  break;
107 
108  default:
109  $this->initUserSearchCache();
110  if(!$cmd)
111  {
112  switch($_SESSION['search_last_sub_section'])
113  {
114  case self::TYPE_ADV_MD:
115  $cmd = "showSavedAdvMDResults";
116  break;
117 
118  default:
119  $cmd = "showSavedResults";
120  break;
121  }
122  }
123 
124  $this->prepareOutput();
125  $this->handleCommand($cmd);
126  break;
127  }
128  return true;
129  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
GUI class for the workflow of copying objects.
$cmd
Definition: sahs_server.php:35
handleCommand($a_cmd)
Handle command.
initUserSearchCache()
Init user search cache.
+ Here is the call graph for this function:

◆ getRootNode()

ilAdvancedSearchGUI::getRootNode ( )

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

Referenced by performAdvMDSearch(), and performSearch().

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

◆ ilAdvancedSearchGUI()

ilAdvancedSearchGUI::ilAdvancedSearchGUI ( )

Constructor public.

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

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

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

◆ initAdvancedMetaDataForm()

ilAdvancedSearchGUI::initAdvancedMetaDataForm ( )
protected

protected

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

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

Referenced by showAdvMDSearch().

291  {
292  if(is_object($this->form))
293  {
294  return $this->form;
295  }
296 
297  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
298  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
299  $this->form = new ilPropertyFormGUI();
300  $this->form->setFormAction($this->ctrl->getFormAction($this,'performAdvMDSearch'));
301  $this->form->setTitle($this->lng->txt('adv_md_search_title'));
302  $this->form->addCommandButton('performAdvMDSearch',$this->lng->txt('search'));
303  #$this->form->setSubformMode('right');
304 
305  $content = new ilTextInputGUI($this->lng->txt('meta_title').'/'.
306  $this->lng->txt('meta_keyword').'/'.
307  $this->lng->txt('meta_description'),'title');
308  $content->setValue($this->options['title']);
309  $content->setSize(30);
310  $content->setMaxLength(255);
311 // $content->setSubformMode('right');
312  $group = new ilRadioGroupInputGUI('','title_ao');
313  $group->setValue($this->options['title_ao']);
314  $radio_option = new ilRadioOption($this->lng->txt("search_any_word"),0);
315  $group->addOption($radio_option);
316  $radio_option = new ilRadioOption($this->lng->txt("search_all_words"),1);
317  $group->addOption($radio_option);
318  $content->addSubItem($group);
319  $this->form->addItem($content);
320 
321  $type = new ilSelectInputGUI($this->lng->txt('type'),'type');
322  $options['adv_all'] = $this->lng->txt('search_any');
323  foreach(ilAdvancedMDRecord::_getActivatedObjTypes() as $obj_type)
324  {
325  $options[$obj_type] = $this->lng->txt('objs_'.$obj_type);
326  }
327  $type->setOptions($options);
328  $type->setValue($this->options['type']);
329  $this->form->addItem($type);
330 
331  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
333  $record_gui->setPropertyForm($this->form);
334  $record_gui->setSearchValues($this->options);
335  $record_gui->parse();
336  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a property in a property form.
$options
array of all options select boxes,&#39;and&#39; &#39;or&#39; and query strings public
addSubItem($a_item)
Add Subitem.
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
static _getActivatedObjTypes()
get activated obj types
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSearch()

ilAdvancedSearchGUI::initFormSearch ( )
protected

Show search form.

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

References $section, and fields.

Referenced by showSearch().

430  {
431  global $tree;
432 
433  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
434 
435  $this->form = new ilPropertyFormGUI();
436  $this->form->setFormAction($this->ctrl->getFormAction($this,'performSearch'));
437  $this->form->setTitle($this->lng->txt('search_advanced'));
438  $this->form->addCommandButton('performSearch',$this->lng->txt('search'));
439  $this->form->addCommandButton('reset',$this->lng->txt('reset'));
440 
441  foreach($this->fields->getActiveSections() as $definition)
442  {
443  if($definition['name'] != 'default')
444  {
446  $section->setTitle($definition['name']);
447  $this->form->addItem($section);
448  }
449 
450  foreach($definition['fields'] as $field_name)
451  {
452  if(is_object($element = $this->fields->getFormElement($this->search_cache->getQuery(),$field_name)))
453  {
454  $this->form->addItem($element);
455  }
456  }
457  }
458  return true;
459  }
This class represents a property form user interface.
This class represents a section header in a property form.
$section
Definition: Utf8Test.php:84
$errors fields
Definition: imgupload.php:47
+ 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 1164 of file class.ilAdvancedSearchGUI.php.

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

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

1165  {
1166  if($type == self::TYPE_LOM)
1167  {
1168  $_SESSION['search_last_sub_section'] = self::TYPE_LOM;
1169  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1170  }
1171  else
1172  {
1173  $_SESSION['search_last_sub_section'] = self::TYPE_ADV_MD;
1174  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_MD_SEARCH);
1175  }
1176  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ initUserSearchCache()

ilAdvancedSearchGUI::initUserSearchCache ( )
private

Init user search cache.

private

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

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

Referenced by executeCommand().

1108  {
1109  global $ilUser;
1110 
1111  include_once('Services/Search/classes/class.ilUserSearchCache.php');
1112  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
1113  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1114  if($_GET['page_number'])
1115  {
1116  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
1117  }
1118  if($_POST['cmd']['performSearch'])
1119  {
1120  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['query']['lomContent']));
1121  $this->search_cache->save();
1122  }
1123  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _getInstance($a_usr_id)
Get singleton instance.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
+ 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 343 of file class.ilAdvancedSearchGUI.php.

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

344  {
345  global $ilUser;
346 
347  $this->initSearchType(self::TYPE_ADV_MD);
348  if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
349  {
350  unset($_SESSION['adv_max_page']);
351  $this->search_cache->delete();
352  }
353 
354  include_once 'Services/Search/classes/class.ilSearchResult.php';
355  $res =& new ilSearchResult();
356 
357  if($res_tit =& $this->__performTitleSearch())
358  {
359  $this->__storeEntries($res,$res_tit);
360  }
361  $this->searchAdvancedMD($res);
362 
363  if($this->search_mode == 'in_results')
364  {
365  include_once 'Services/Search/classes/class.ilSearchResult.php';
366 
367  $old_result_obj = new ilSearchResult($ilUser->getId());
368  $old_result_obj->read(ADVANCED_MD_SEARCH);
369 
370  $res->diffEntriesFromResult($old_result_obj);
371  }
372 
373 
374  $res->filter($this->getRootNode(),true);
375  $res->save();
376  $this->showAdvMDSearch();
377 
378  if(!count($res->getResults()))
379  {
380  ilUtil::sendInfo($this->lng->txt('search_no_match'));
381  }
382 
383  if($res->isLimitReached())
384  {
385  #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
386  #ilUtil::sendInfo($message);
387  }
388 
389  $this->addPager($res,'adv_max_page');
390 
391  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
393  $presentation->setResults($res->getResultsForPresentation());
394  $presentation->setPreviousNext($this->prev_link, $this->next_link);
395 
396  if($presentation->render())
397  {
398  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
399  }
400  return true;
401 
402  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
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.
$_GET["client_id"]
searchAdvancedMD($res)
Perform advanced meta data search.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
global $ilUser
Definition: imgupload.php:15
const ADVANCED_MD_SEARCH
+ Here is the call graph for this function:

◆ performSearch()

ilAdvancedSearchGUI::performSearch ( )

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

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

Referenced by remoteSearch(), and searchInResults().

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

◆ prepareOutput()

ilAdvancedSearchGUI::prepareOutput ( )

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

Referenced by executeCommand().

478  {
479  global $ilTabs, $ilHelp;
480 
481  parent::prepareOutput();
482 
483  $ilHelp->setScreenIdComponent("src");
484 
485  $ilTabs->addTab("search", $this->lng->txt("search"),
486  $this->ctrl->getLinkTargetByClass('ilsearchgui'));
487  $ilTabs->addTab("adv_search", $this->lng->txt("search_advanced"),
488  $this->ctrl->getLinkTarget($this));
489  $ilTabs->activateTab("adv_search");
490  }
+ Here is the caller graph for this function:

◆ remoteSearch()

ilAdvancedSearchGUI::remoteSearch ( )
protected

Search from main menu.

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

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

154  {
155  $this->search_cache->setRoot((int) $_POST['root_id']);
156  $this->search_cache->setResultPageNumber(1);
157  $this->search_cache->setQuery(array('lom_content' => ilUtil::stripSlashes($_POST['queryString'])));
158  $this->search_cache->save();
159 
160  $this->options = $this->search_cache->getQuery();
161  $this->options['type'] = 'all';
162 
163  $this->performSearch();
164  }
$_POST['username']
Definition: cron.php:12
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:

◆ reset()

ilAdvancedSearchGUI::reset ( )

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

References initSearchType(), and showSearch().

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

References $_POST, $options, $res, __storeEntries(), ilObjectSearchFactory\_getAdvancedMDSearchInstance(), ilAdvancedMDFieldDefinition\_getInstanceByFieldId(), ilUtil\stripSlashes(), toUnixTime(), ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, and ilAdvancedMDFieldDefinition\TYPE_SELECT.

Referenced by performAdvMDSearch().

896  {
897  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
898  foreach($_POST as $key => $value)
899  {
900  if(!is_numeric($key))
901  {
902  continue;
903  }
904  if(!$value)
905  {
906  continue;
907  }
908 
910  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
911  include_once 'Services/Search/classes/class.ilQueryParser.php';
912 
913  if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_SELECT)
914  {
915  $value = (int) $value;
916  $options = $def->getFieldValues();
917  if(!isset($options[$value - 1]))
918  {
919  continue;
920  }
921  $value = $options[$value - 1];
922  }
923  if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE)
924  {
925  $start = $this->toUnixTime($_POST['date_start'][$key]['date']);
926  $end = $this->toUnixTime($_POST['date_end'][$key]['date']);
927 
928  }
929  if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATETIME)
930  {
931  $start = $this->toUnixTime($_POST['date_start'][$key]['date'],$_POST['date_start'][$key]['time']);
932  $end = $this->toUnixTime($_POST['date_end'][$key]['date'],$_POST['date_end'][$key]['time']);
933  }
934 
935  $query_parser = new ilQueryParser(ilUtil::stripSlashes($value));
936  if($_POST['boolean'][$key] == 1)
937  {
938  $query_parser->setCombination('and');
939  }
940  else
941  {
942  $query_parser->setCombination('or');
943  }
944  $query_parser->parse();
945 
946  $adv_md_search = ilObjectSearchFactory::_getAdvancedMDSearchInstance($query_parser);
947  $adv_md_search->setDefinition($def);
948  $adv_md_search->setTimeRange($start,$end);
949  $adv_md_search->setFilter($this->filter);
950  $res_field = $adv_md_search->performSearch();
951  $this->__storeEntries($res,$res_field);
952 
953  }
954  return $res;
955  }
$_POST['username']
Definition: cron.php:12
static _getAdvancedMDSearchInstance($query_parser)
get advanced meta data search instance
static _getInstanceByFieldId($a_field_id)
Get instance by field_id.
$options
array of all options select boxes,&#39;and&#39; &#39;or&#39; and query strings public
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
toUnixTime($date, $time=array())
convert input array to unix time
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchInResults()

ilAdvancedSearchGUI::searchInResults ( )

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

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

140  {
141  $this->initSearchType(self::TYPE_LOM);
142  $this->search_mode = 'in_results';
143  $this->search_cache->setResultPageNumber(1);
144  unset($_SESSION['adv_max_page']);
145  $this->performSearch();
146 
147  return true;
148  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
+ Here is the call graph for this function:

◆ setSubTabs()

ilAdvancedSearchGUI::setSubTabs ( )

set sub tabs

public

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

References ilAdvancedMDFieldDefinition\_getSearchableDefinitionIds().

Referenced by showAdvMDSearch(), and showSearch().

1132  {
1133  global $ilTabs;
1134 
1135  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1137  {
1138  return true;
1139  }
1140  $ilTabs->addSubTabTarget('search_lom',$this->ctrl->getLinkTarget($this,'showSavedResults'));
1141  #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults'));
1142 
1143  }
static _getSearchableDefinitionIds()
Get searchable definition ids.
+ 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 410 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performAdvMDSearch(), and showSavedAdvMDResults().

411  {
412  if(isset($_SESSION['search_adv_md']))
413  {
414  $this->options = $_SESSION['search_adv_md'];
415  }
416  $this->setSubTabs();
417  $this->tabs_gui->setSubTabActive('search_adv_md');
418 
419  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_adv_search.html','Services/Search');
420 
421  $this->initAdvancedMetaDataForm();
422  $this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
423  return true;
424  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ 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 499 of file class.ilAdvancedSearchGUI.php.

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

500  {
501  global $ilUser;
502 
503  // Read old result sets
504  include_once 'Services/Search/classes/class.ilSearchResult.php';
505 
506  $this->initSearchType(self::TYPE_ADV_MD);
507  $result_obj = new ilSearchResult($ilUser->getId());
508  $result_obj->read(ADVANCED_MD_SEARCH);
509 
510  $this->showAdvMDSearch();
511 
512  // Show them
513  if(count($result_obj->getResults()))
514  {
515  $this->addPager($result_obj,'adv_max_page');
516 
517  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
519  $presentation->setResults($result_obj->getResultsForPresentation());
520  $presentation->setPreviousNext($this->prev_link, $this->next_link);
521 
522  if($presentation->render())
523  {
524  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
525  }
526  }
527 
528  return true;
529  }
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 $ilUser
Definition: imgupload.php:15
const ADVANCED_MD_SEARCH
+ Here is the call graph for this function:

◆ showSavedResults()

ilAdvancedSearchGUI::showSavedResults ( )

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

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

533  {
534  global $ilUser;
535 
536  // Read old result sets
537  include_once 'Services/Search/classes/class.ilSearchResult.php';
538 
539  $this->initSearchType(self::TYPE_LOM);
540  $result_obj = new ilSearchResult($ilUser->getId());
541  $result_obj->read(ADVANCED_SEARCH);
542 
543  $this->showSearch();
544 
545  // Show them
546  if(count($result_obj->getResults()))
547  {
548  $this->addPager($result_obj,'adv_max_page');
549 
550  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
552  $presentation->setResults($result_obj->getResultsForPresentation());
553  $presentation->setPreviousNext($this->prev_link, $this->next_link);
554 
555  if($presentation->render())
556  {
557  $this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
558  }
559  }
560 
561  return true;
562  }
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 $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ showSearch()

ilAdvancedSearchGUI::showSearch ( )

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

References initFormSearch(), and setSubTabs().

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

464  {
465  global $ilLocator;
466 
467  $this->setSubTabs();
468  $this->tabs_gui->setSubTabActive('search_lom');
469 
470  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_search.html','Services/Search');
471 
472  $this->initFormSearch();
473  $this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
474  return true;
475  }
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 1152 of file class.ilAdvancedSearchGUI.php.

Referenced by searchAdvancedMD().

1153  {
1154  return mktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1155  }
+ Here is the caller graph for this function:

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(), initAdvancedMetaDataForm(), and searchAdvancedMD().

◆ $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: