39include_once 
'Services/Search/classes/class.ilSearchBaseGUI.php';
 
   40include_once 
'Services/MetaData/classes/class.ilMDUtilSelect.php';
 
   41include_once 
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchFields.php';
 
   70        $ilTabs = 
$DIC[
'ilTabs'];
 
   72        $this->tabs_gui = $ilTabs;
 
   76        $this->lng->loadLanguageModule(
'meta');
 
   96        $rbacsystem = 
$DIC[
'rbacsystem'];
 
   98        $next_class = $this->ctrl->getNextClass($this);
 
   99        $cmd = $this->ctrl->getCmd();
 
  101        switch ($next_class) {
 
  102            case "ilpropertyformgui":
 
  105            case 'ilobjectcopygui':
 
  107                $this->ctrl->setReturn($this, 
'');
 
  109                include_once 
'./Services/Object/classes/class.ilObjectCopyGUI.php';
 
  111                $this->ctrl->forwardCommand($cp);
 
  117                    switch (
$_SESSION[
'search_last_sub_section']) {
 
  119                            $cmd = 
"showSavedAdvMDResults";
 
  123                            $cmd = 
"showSavedResults";
 
  136        $this->options = array();
 
  137        $this->search_cache->setQuery(array());
 
  138        $this->search_cache->save();
 
  145        $this->search_mode = 
'in_results';
 
  146        $this->search_cache->setResultPageNumber(1);
 
  158        $this->search_cache->setRoot((
int) 
$_POST[
'root_id']);
 
  159        $this->search_cache->setResultPageNumber(1);
 
  161        $this->search_cache->save();
 
  163        $this->options = $this->search_cache->getQuery();
 
  164        $this->options[
'type'] = 
'all';
 
  179        if (!isset(
$_GET[
'page_number']) and $this->search_mode != 
'in_results') {
 
  181            $this->search_cache->deleteCachedEntries();
 
  184        if (isset(
$_POST[
'query'])) {
 
  185            $this->search_cache->setQuery(
$_POST[
'query']);
 
  189        include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  237        if ($this->search_mode == 
'in_results') {
 
  238            include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  243            $res->diffEntriesFromResult($old_result_obj);
 
  250        if (!count(
$res->getResults())) {
 
  254        if (
$res->isLimitReached()) {
 
  255            #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 
  256            #ilUtil::sendInfo($message); 
  261        include_once 
'./Services/Search/classes/class.ilSearchResultPresentation.php';
 
  263        $presentation->setResults(
$res->getResultsForPresentation());
 
  264        $presentation->setPreviousNext($this->prev_link, $this->next_link);
 
  266        if ($presentation->render()) {
 
  267            $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
 
  279        if (is_object($this->form)) {
 
  283        include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
 
  284        include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
 
  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'); 
  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);
 
  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);
 
  308        $options[
'adv_all'] = $this->lng->txt(
'search_any');
 
  310            $options[$obj_type] = $this->lng->txt(
'objs_' . $obj_type);
 
  313        $type->setValue($this->options[
'type']);
 
  314        $this->form->addItem(
$type);
 
  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();
 
  335        if (!isset(
$_GET[
'page_number']) and $this->search_mode != 
'in_results') {
 
  337            $this->search_cache->delete();
 
  340        include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  348        if ($this->search_mode == 
'in_results') {
 
  349            include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  354            $res->diffEntriesFromResult($old_result_obj);
 
  362        if (!count(
$res->getResults())) {
 
  366        if (
$res->isLimitReached()) {
 
  367            #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits()); 
  368            #ilUtil::sendInfo($message); 
  373        include_once 
'./Services/Search/classes/class.ilSearchResultPresentation.php';
 
  375        $presentation->setResults(
$res->getResultsForPresentation());
 
  376        $presentation->setPreviousNext($this->prev_link, $this->next_link);
 
  378        if ($presentation->render()) {
 
  379            $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
 
  393            $this->options = 
$_SESSION[
'search_adv_md'];
 
  396        $this->tabs_gui->setSubTabActive(
'search_adv_md');
 
  398        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.advanced_adv_search.html', 
'Services/Search');
 
  401        $this->tpl->setVariable(
'SEARCH_FORM', $this->form->getHTML());
 
  412        $tree = 
$DIC[
'tree'];
 
  414        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  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'));
 
  422        foreach ($this->
fields->getActiveSections() as $definition) {
 
  423            if ($definition[
'name'] != 
'default') {
 
  425                $section->setTitle($definition[
'name']);
 
  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);
 
  444        $ilLocator = 
$DIC[
'ilLocator'];
 
  447        $this->tabs_gui->setSubTabActive(
'search_lom');
 
  449        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.advanced_search.html', 
'Services/Search');
 
  452        $this->tpl->setVariable(
'SEARCH_FORM', $this->form->getHTML());
 
  460        $ilTabs = 
$DIC[
'ilTabs'];
 
  461        $ilHelp = 
$DIC[
'ilHelp'];
 
  463        parent::prepareOutput();
 
  465        $ilHelp->setScreenIdComponent(
"src");
 
  469            $this->lng->txt(
"search"),
 
  470            $this->ctrl->getLinkTargetByClass(
'ilsearchgui')
 
  474            $this->lng->txt(
"search_advanced"),
 
  475            $this->ctrl->getLinkTarget($this)
 
  477        $ilTabs->activateTab(
"adv_search");
 
  494        include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  503        if (count($result_obj->getResults())) {
 
  504            $this->
addPager($result_obj, 
'adv_max_page');
 
  506            include_once 
'./Services/Search/classes/class.ilSearchResultPresentation.php';
 
  508            $presentation->setResults($result_obj->getResultsForPresentation());
 
  509            $presentation->setPreviousNext($this->prev_link, $this->next_link);
 
  511            if ($presentation->render()) {
 
  512                $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
 
  527        include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  536        if (count($result_obj->getResults())) {
 
  537            $this->
addPager($result_obj, 
'adv_max_page');
 
  539            include_once 
'./Services/Search/classes/class.ilSearchResultPresentation.php';
 
  541            $presentation->setResults($result_obj->getResultsForPresentation());
 
  542            $presentation->setPreviousNext($this->prev_link, $this->next_link);
 
  544            if ($presentation->render()) {
 
  545                $this->tpl->setVariable(
'RESULTS', $presentation->getHTML(
true));
 
  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';
 
  558        if (!$this->options[
'lom_content']) {
 
  565        #$query_parser->setCombination($this->options['content_ao']); 
  567        $query_parser->parse();
 
  569        if ($this->options[
'type'] == 
'all' or $this->options[
'type'] == 
'lms') {
 
  572            $res_cont = &$lm_search->performSearch();
 
  573            $res->mergeEntries($res_cont);
 
  575        if ($this->options[
'type'] == 
'all' or $this->options[
'type'] == 
'tst') {
 
  577            $res_tes = &$tst_search->performSearch();
 
  578            $res->mergeEntries($res_tes);
 
  580        if ($this->options[
'type'] == 
'all' or $this->options[
'type'] == 
'mep') {
 
  582            $res_med = &$med_search->performSearch();
 
  583            $res->mergeEntries($res_med);
 
  585        if ($this->options[
'type'] == 
'all' or $this->options[
'type'] == 
'glo') {
 
  587            $res_glo = &$glo_search->performSearch();
 
  588            $res->mergeEntries($res_glo);
 
  590        if ($this->options[
'type'] == 
'all' or $this->options[
'type'] == 
'webr') {
 
  592            $res_web = &$web_search->performSearch();
 
  593            $res->mergeEntries($res_web);
 
  596            $res->mergeEntries($tit_res);
 
  605        if (!$this->options[
'lom_content']) {
 
  609        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  610        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  613        #$query_parser->setCombination($this->options['title_ao']); 
  615        $query_parser->parse();
 
  618        $meta_search->setFilter($this->
filter);
 
  619        $meta_search->setMode(
'title_description');
 
  620        $meta_search->setOptions($this->options);
 
  621        $res_tit = &$meta_search->performSearch();
 
  623        $meta_search->setMode(
'keyword_all');
 
  624        $res_key = &$meta_search->performSearch();
 
  627        $res_tit->mergeEntries($res_key);
 
  637        if (!$this->options[
'lom_coverage'] and !$this->options[
'lom_structure']) {
 
  641        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  642        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  644        if ($this->options[
'lom_coverage']) {
 
  646            #$query_parser->setCombination($this->options['coverage_ao']); 
  648            $query_parser->parse();
 
  653        $meta_search->setFilter($this->
filter);
 
  654        $meta_search->setMode(
'general');
 
  655        $meta_search->setOptions($this->options);
 
  656        $res = &$meta_search->performSearch();
 
  664        if (!$this->options[
'lom_status'] and !$this->options[
'lom_version']) {
 
  667        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  668        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  671        #$query_parser->setCombination($this->options['version_ao']); 
  673        $query_parser->parse();
 
  676        $meta_search->setFilter($this->
filter);
 
  677        $meta_search->setMode(
'lifecycle');
 
  678        $meta_search->setOptions($this->options);
 
  679        $res = &$meta_search->performSearch();
 
  685        if (!$this->options[
'lom_language']) {
 
  688        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  689        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  693        $meta_search->setFilter($this->
filter);
 
  694        $meta_search->setMode(
'language');
 
  695        $meta_search->setOptions($this->options);
 
  696        $res = &$meta_search->performSearch();
 
  702        if (!strlen($this->options[
'lom_role'])) {
 
  705        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  706        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  710        $meta_search->setFilter($this->
filter);
 
  711        $meta_search->setMode(
'contribute');
 
  712        $meta_search->setOptions($this->options);
 
  713        $res = &$meta_search->performSearch();
 
  720        if (!$this->options[
'lom_role_entry']) {
 
  724        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  725        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  728        #$query_parser->setCombination($this->options['entity_ao']); 
  730        $query_parser->parse();
 
  733        $meta_search->setFilter($this->
filter);
 
  734        $meta_search->setMode(
'entity');
 
  735        $meta_search->setOptions($this->options);
 
  736        $res = &$meta_search->performSearch();
 
  744        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  745        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  749        $meta_search->setFilter($this->
filter);
 
  750        $meta_search->setMode(
'requirement');
 
  751        $meta_search->setOptions($this->options);
 
  752        $res = &$meta_search->performSearch();
 
  758        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  759        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  763        $meta_search->setFilter($this->
filter);
 
  764        $meta_search->setMode(
'format');
 
  765        $meta_search->setOptions($this->options);
 
  766        $res = &$meta_search->performSearch();
 
  772        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  773        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  777        $meta_search->setFilter($this->
filter);
 
  778        $meta_search->setMode(
'educational');
 
  779        $meta_search->setOptions($this->options);
 
  780        $res = &$meta_search->performSearch();
 
  786        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  787        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  791        $meta_search->setFilter($this->
filter);
 
  792        $meta_search->setMode(
'typical_age_range');
 
  793        $meta_search->setOptions($this->options);
 
  794        $res = &$meta_search->performSearch();
 
  800        if (!$this->options[
'lom_copyright'] and !$this->options[
'lom_costs']) {
 
  803        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  804        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  808        $meta_search->setFilter($this->
filter);
 
  809        $meta_search->setMode(
'rights');
 
  810        $meta_search->setOptions($this->options);
 
  811        $res = &$meta_search->performSearch();
 
  819        if (!$this->options[
'lom_purpose']) {
 
  822        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  823        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  827        $meta_search->setFilter($this->
filter);
 
  828        $meta_search->setMode(
'classification');
 
  829        $meta_search->setOptions($this->options);
 
  830        $res = &$meta_search->performSearch();
 
  838        if (!$this->options[
'lom_taxon']) {
 
  841        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  842        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  846        $query_parser->parse();
 
  849        $meta_search->setFilter($this->
filter);
 
  850        $meta_search->setMode(
'taxon');
 
  851        $meta_search->setOptions($this->options);
 
  852        $res = &$meta_search->performSearch();
 
  868        include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
 
  869        foreach (array_keys($this->options) as $key) {
 
  870            if (substr($key, 0, 3) != 
'adv') {
 
  879            $field_id = substr($key, 4);
 
  882            $field_form = 
ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), 
true, 
false);
 
  883            $field_form->setElementId(
"query[" . $key . 
"]");
 
  884            $field_form->setForm($this->form);
 
  887            $field_form->importFromPost($this->options);
 
  888            $field_form->validate();
 
  890            $parser_value = $field->getSearchQueryParserValue($field_form);
 
  892            include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  893            include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  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();
 
  908        if (!$this->options[
'lom_keyword']) {
 
  911        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  912        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  915        #$query_parser->setCombination($this->options['keyword_ao']); 
  917        $query_parser->parse();
 
  920        $meta_search->setFilter($this->
filter);
 
  921        $meta_search->setMode(
'keyword');
 
  922        $meta_search->setOptions($this->options);
 
  923        $res = &$meta_search->performSearch();
 
  930        if (isset(
$_POST[
'cmd'][
'performSearch'])) {
 
  932        } elseif (isset(
$_POST[
'cmd'][
'performAdvMDSearch'])) {
 
  935            $this->options = 
$_SESSION[
'search_adv'];
 
  942        $this->options[
'type'] = 
'all';
 
  943        switch ($this->options[
'type']) {
 
  985                include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
 
 1004                $this->
filter[] = 
'sahs';
 
 1005                $this->
filter[] = 
'htlm';
 
 1006                $this->
filter[] = 
'file';
 
 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')
 
 1031        if ($this->stored == 
false) {
 
 1032            $res->mergeEntries($new_res);
 
 1033            $this->stored = 
true;
 
 1037            $res->intersectEntries($new_res);
 
 1054        include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
 
 1057        if (
$_GET[
'page_number']) {
 
 1058            $this->search_cache->setResultPageNumber((
int) 
$_GET[
'page_number']);
 
 1060        if (
$_POST[
'cmd'][
'performSearch']) {
 
 1062            $this->search_cache->save();
 
 1076        $ilTabs = 
$DIC[
'ilTabs'];
 
 1078        include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
 
 1082        $ilTabs->addSubTabTarget(
'search_lom', $this->ctrl->getLinkTarget($this, 
'showSavedResults'));
 
 1083        #$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults')); 
 1095        return mktime($time[
'h'], $time[
'm'], 0, $date[
'm'], $date[
'd'], $date[
'y']);
 
 1107        if (
$type == self::TYPE_LOM) {
 
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Get singleton.
static getInstance($a_field_id, $a_type=null, string $language='')
Get definition instance by type.
static getSearchableDefinitionIds()
Get searchable definition ids (performance is key)
static _getActivatedObjTypes()
get activated obj types
showSavedAdvMDResults()
show advanced meta data results
initUserSearchCache()
Init user search cache.
initSearchType($type)
init search type (LOM Search or Advanced meta data search)
& __performContentSearch()
__setSearchOptions(&$post_vars)
& __performKeywordSearch()
& __performLifecycleSearch()
searchAdvancedMD($res)
Perform advanced meta data search.
& __performClassificationSearch()
initAdvancedMetaDataForm()
@access protected
__construct()
Constructor @access public.
performAdvMDSearch()
perform advanced meta data search
executeCommand()
Control @access public.
showAdvMDSearch()
Show advanced meta data search.
& __performRightsSearch()
& __performRequirementSearch()
& __performEntitySearch()
& __performContributeSearch()
initFormSearch()
Show search form.
& __performTypicalAgeRangeSearch()
__storeEntries($res, $new_res)
& __performFormatSearch()
toUnixTime($date, $time=array())
convert input array to unix time
& __performEducationalSearch()
& __performLanguageSearch()
remoteSearch()
Search from main menu.
$options
array of all options select boxes,'and' 'or' and query strings @access public
& __performGeneralSearch()
static getInstance()
Get singleton instance.
GUI class for the workflow of copying objects.
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
static _getLMContentSearchInstance($query_parser)
get reference of ilFulltextLMContentSearch
static _getWebresourceSearchInstance($query_parser)
get reference of ilFulltextWebresourceSearch
static _getTestSearchInstance($query_parser)
get reference of ilFulltextTestSearch
static _getAdvancedMDSearchInstance($query_parser)
get advanced meta data search instance
static _getGlossaryDefinitionSearchInstance($query_parser)
get reference of ilFulltextGlossaryDefinitionSearch
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
This class represents an option in a radio group.
addPager($result, $a_session_key)
Add Pager.
handleCommand($a_cmd)
Handle command.
Presentation of search results using object list gui.
This class represents a text property in a property form.
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
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res