Public Member Functions | Data Fields

ilAdvancedSearchGUI Class Reference

Inheritance diagram for ilAdvancedSearchGUI:
Collaboration diagram for ilAdvancedSearchGUI:

Public Member Functions

 ilAdvancedSearchGUI ()
 Constructor public.
 getRootNode ()
executeCommand ()
 Control public.
 reset ()
 searchInResults ()
 performSearch ()
 showSearch ()
 prepareOutput ()
 saveResult ()
 showSavedResults ()
__performContentSearch ()
__performTitleSearch ()
__performGeneralSearch ()
__performLifecycleSearch ()
__performLanguageSearch ()
__performContributeSearch ()
__performEntitySearch ()
__performRequirementSearch ()
__performFormatSearch ()
__performEducationalSearch ()
__performTypicalAgeRangeSearch ()
__performRightsSearch ()
__performClassificationSearch ()
__performTaxonSearch ()
__performKeywordSearch ()
 __setSearchOptions (&$post_vars)
 __getFilterSelect ()
 __storeEntries (&$res, &$new_res)
 __showSearchInResults ()
 Show search in results button.
 __getFolderSelect ()

Data Fields

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

Detailed Description

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


Member Function Documentation

ilAdvancedSearchGUI::__getFilterSelect (  ) 

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

References $options, and formSelect().

Referenced by showSearch().

        {
                $options = array('all' => $this->lng->txt('search_any'),
                                                 'lms' => $this->lng->txt('learning_resources'),
                                                 'crs' => $this->lng->txt('objs_crs'),
                                                 'tst' => $this->lng->txt('search_tst_svy'),
                                                 'mep' => $this->lng->txt('objs_mep'),
                                                 'glo' => $this->lng->txt('objs_glo'),
                                                 'webr' => $this->lng->txt('objs_webr'));


                return ilUtil::formSelect($this->options['type'],'search_adv[type]',$options,false,true);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilAdvancedSearchGUI::__getFolderSelect (  ) 

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

References $options, and formSelect().

Referenced by __showSearchInResults().

        {
                global $ilUser;

                include_once 'Services/Search/classes/class.ilSearchFolder.php';

                // INITIATE SEARCH FOLDER OBJECT
                $folder_obj =& new ilSearchFolder($ilUser->getId());


                $subtree = $folder_obj->getSubtree();

                $options[0] = $this->lng->txt("search_select_one_folder_select");
                $options[$folder_obj->getRootId()] = $this->lng->txt("search_save_as_select")." ".$this->lng->txt("search_search_results");
                
                foreach($subtree as $node)
                {
                        if($node["obj_id"] == $folder_obj->getRootId())
                        {
                                continue;
                        }
                        // CREATE PREFIX
                        $prefix = $this->lng->txt("search_save_as_select");
                        for($i = 1; $i < $node["depth"];++$i)
                        {
                                $prefix .= "&nbsp;&nbsp;";
                        }
                        $options[$node["obj_id"]] = $prefix.$node["title"];
                }
                return ilUtil::formSelect(0,'folder',$options,false,true);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performClassificationSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                // Return if 'any'
                if(!$this->options['purpose'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('classification');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performContentSearch (  ) 

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

References $res, ilObjectSearchFactory::_getGlossaryDefinitionSearchInstance(), ilObjectSearchFactory::_getHTLMSearchInstance(), ilObjectSearchFactory::_getLMContentSearchInstance(), ilObjectSearchFactory::_getMediaPoolSearchInstance(), ilObjectSearchFactory::_getTestSearchInstance(), ilObjectSearchFactory::_getWebresourceSearchInstance(), and ilUtil::stripSlashes().

Referenced by performSearch().

        {
                if(!$this->options['content'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';
                include_once 'Services/Search/classes/class.ilSearchResult.php';

                $res =& new ilSearchResult();


                $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['content']));
                $query_parser->setCombination($this->options['content_ao']);
                $query_parser->parse();

                if($this->options['type'] == 'all' or $this->options['type'] == 'lms')
                {
                        // LM content search
                        $lm_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
                        $res_cont =& $lm_search->performSearch();
                        $res->mergeEntries($res_cont);
                        
                        if($this->settings->enabledLucene())
                        {

                                // HTLM content search
                                $htlm_search =& ilObjectSearchFactory::_getHTLMSearchInstance($query_parser);
                                $res_htlm =& $htlm_search->performSearch();
                                $res->mergeEntries($res_htlm);
                        }
                }
                if($this->options['type'] == 'all' or $this->options['type'] == 'tst')
                {
                        $tst_search =& ilObjectSearchFactory::_getTestSearchInstance($query_parser);
                        $res_tes =& $tst_search->performSearch();
                        $res->mergeEntries($res_tes);
                }
                if($this->options['type'] == 'all' or $this->options['type'] == 'mep')
                {
                        $med_search =& ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
                        $res_med =& $med_search->performSearch();
                        $res->mergeEntries($res_med);
                }
                if($this->options['type'] == 'all' or $this->options['type'] == 'glo')
                {
                        $glo_search =& ilObjectSearchFactory::_getGlossaryDefinitionSearchInstance($query_parser);
                        $res_glo =& $glo_search->performSearch();
                        $res->mergeEntries($res_glo);
                }
                if($this->options['type'] == 'all' or $this->options['type'] == 'webr')
                {
                        $web_search =& ilObjectSearchFactory::_getWebresourceSearchInstance($query_parser);
                        $res_web =& $web_search->performSearch();
                        $res->mergeEntries($res_web);
                }

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performContributeSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                if(!strlen($this->options['role']))
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('contribute');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performEducationalSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('educational');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performEntitySearch (  ) 

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

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

Referenced by performSearch().

        {
                // Return if 'any'
                if(!$this->options['entity'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';

                $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['entity']));
                $query_parser->setCombination($this->options['entity_ao']);
                $query_parser->parse();

                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('entity');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }               

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performFormatSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('format');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performGeneralSearch (  ) 

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

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

Referenced by performSearch().

        {
                if(!$this->options['coverage'] and !$this->options['structure'])
                {
                        return false;
                }

                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';

                if($this->options['coverage'])
                {
                        $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['coverage']));
                        $query_parser->setCombination($this->options['coverage_ao']);
                        $query_parser->parse();
                }
                else
                {
                        $query_parser = new ilQueryParser('');
                }

                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('general');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performKeywordSearch (  ) 

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

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

Referenced by performSearch().

        {
                // Return if 'any'
                if(!$this->options['keyword'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';

                $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['keyword']));
                $query_parser->setCombination($this->options['keyword_ao']);
                $query_parser->parse();

                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('keyword');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performLanguageSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                if(!$this->options['language'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('language');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performLifecycleSearch (  ) 

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

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

Referenced by performSearch().

        {
                // Return if 'any'
                if(!$this->options['status'] and !$this->options['version'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';

                $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['version']));
                $query_parser->setCombination($this->options['version_ao']);
                $query_parser->parse();

                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('lifecycle');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }               

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performRequirementSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('requirement');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performRightsSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                if(!$this->options['copyright'] and !$this->options['costs'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('rights');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performTaxonSearch (  ) 

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

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

Referenced by performSearch().

        {
                // Return if 'any'
                if(!$this->options['taxon'])
                {
                        return false;
                }
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';

                $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['taxon']));
                $query_parser->setCombination($this->options['taxon_ao']);
                $query_parser->parse();

                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('taxon');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performTitleSearch (  ) 

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

References ilObjectSearchFactory::_getAdvancedSearchInstance(), and ilUtil::stripSlashes().

Referenced by performSearch().

        {
                if(!$this->options['title'])
                {
                        return false;
                }

                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';

                $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['title']));
                $query_parser->setCombination($this->options['title_ao']);
                $query_parser->parse();

                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('title_description');
                $meta_search->setOptions($this->options);
                $res_tit =& $meta_search->performSearch();

                $meta_search->setMode('keyword_all');
                $res_key =& $meta_search->performSearch();
                
                // merge them
                $res_tit->mergeEntries($res_key);
                
                return $res_tit;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performTypicalAgeRangeSearch (  ) 

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

References $res, and ilObjectSearchFactory::_getAdvancedSearchInstance().

Referenced by performSearch().

        {
                include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
                include_once 'Services/Search/classes/class.ilQueryParser.php';


                $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance(new ilQueryParser(''));
                $meta_search->setFilter($this->filter);
                $meta_search->setMode('typical_age_range');
                $meta_search->setOptions($this->options);
                $res =& $meta_search->performSearch();

                return $res;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilAdvancedSearchGUI::__setSearchOptions ( &$  post_vars  ) 

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

References $_POST, and $_SESSION.

Referenced by ilAdvancedSearchGUI().

        {
                if(isset($_POST['cmd']['performSearch']))
                {
                        $this->options = $_SESSION['search_adv'] = $_POST['search_adv'];
                }
                else
                {
                        $this->options = $_SESSION['search_adv'];
                }
                
                $_POST['result'] = $_POST['id'];

                $this->filter = array();

                switch($this->options['type'])
                {
                        case 'webr':
                                $this->filter[] = 'webr';
                                break;

                        case 'lms':
                                $this->filter[] = 'lm';
                                $this->filter[] = 'dbk';
                                $this->filter[] = 'pg';
                                $this->filter[] = 'st';
                                $this->filter[] = 'sahs';
                                $this->filter[] = 'htlm';
                                break;

                        case 'glo':
                                $this->filter[] = 'glo';
                                break;

                        case 'tst':
                                $this->filter[] = 'tst';
                                $this->filter[] = 'svy';
                                $this->filter[] = 'qpl';
                                $this->filter[] = 'spl';
                                break;

                        case 'mep':
                                $this->filter[] = 'mep';
                                break;
                                        
                        case 'crs':
                                $this->filter[] = 'crs';
                                break;

                        case 'all':
                        default:
                                $this->filter[] = 'webr';
                                $this->filter[] = 'crs';
                                $this->filter[] = 'mep';
                                $this->filter[] = 'tst';
                                $this->filter[] = 'svy';
                                $this->filter[] = 'qpl';
                                $this->filter[] = 'spl';
                                $this->filter[] = 'glo';
                                $this->filter[] = 'lm';
                                $this->filter[] = 'dbk';
                                $this->filter[] = 'pg';
                                $this->filter[] = 'st';
                                $this->filter[] = 'sahs';
                                $this->filter[] = 'htlm';
                }
                return true;
        }

Here is the caller graph for this function:

ilAdvancedSearchGUI::__showSearchInResults (  ) 

Show search in results button.

If search was successful

Returns:
void public

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

References __getFolderSelect(), and ilUtil::getImagePath().

Referenced by performSearch(), and showSavedResults().

        {
                $this->tpl->setCurrentBlock("search_results");
                $this->tpl->setVariable("BTN_SEARCHRESULTS",$this->lng->txt('search_in_result'));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("save_result");
                $this->tpl->setVariable("DOWNRIGHT",ilUtil::getImagePath('arrow_downright.gif'));
                $this->tpl->setVariable("BTN_SAVE_RESULT",$this->lng->txt('save'));
                $this->tpl->setVariable("SELECT_FOLDER",$this->__getFolderSelect());
                $this->tpl->parseCurrentBlock();

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilAdvancedSearchGUI::__storeEntries ( &$  res,
&$  new_res 
)

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

References $res.

Referenced by performSearch().

        {

                if($this->stored == false)
                {
                        

                        $res->mergeEntries($new_res);
                        $this->stored = true;

                        return true;
                }
                else
                {
                        $res->intersectEntries($new_res);
                        
                        return true;
                }
        }

Here is the caller graph for this function:

& ilAdvancedSearchGUI::executeCommand (  ) 

Control public.

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

References $cmd, $rbacsystem, and prepareOutput().

        {
                global $rbacsystem;

                $next_class = $this->ctrl->getNextClass($this);
                $cmd = $this->ctrl->getCmd();

                switch($next_class)
                {
                        default:
                                if(!$cmd)
                                {
                                        $cmd = "showSavedResults";
                                }

                                $this->prepareOutput();
                                $this->$cmd();
                                break;
                }
                return true;
        }

Here is the call graph for this function:

ilAdvancedSearchGUI::getRootNode (  ) 

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

Referenced by performSearch().

        {
                return ROOT_FOLDER_ID;
        }

Here is the caller graph for this function:

ilAdvancedSearchGUI::ilAdvancedSearchGUI (  ) 

Constructor public.

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

References $_POST, __setSearchOptions(), and ilSearchBaseGUI::ilSearchBaseGUI().

        {
                parent::ilSearchBaseGUI();

                $this->lng->loadLanguageModule('meta');

                $this->__setSearchOptions($_POST);
        }

Here is the call graph for this function:

ilAdvancedSearchGUI::performSearch (  ) 

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

References $res, __performClassificationSearch(), __performContentSearch(), __performContributeSearch(), __performEducationalSearch(), __performEntitySearch(), __performFormatSearch(), __performGeneralSearch(), __performKeywordSearch(), __performLanguageSearch(), __performLifecycleSearch(), __performRequirementSearch(), __performRightsSearch(), __performTaxonSearch(), __performTitleSearch(), __performTypicalAgeRangeSearch(), __showSearchInResults(), __storeEntries(), getRootNode(), sendInfo(), and showSearch().

Referenced by searchInResults().

        {
                global $ilUser;

                include_once 'Services/Search/classes/class.ilSearchResult.php';

                $res =& new ilSearchResult();

                if($res_con =& $this->__performContentSearch())
                {
                        $this->__storeEntries($res,$res_con);
                }
                if($res_tit =& $this->__performTitleSearch())
                {
                        $this->__storeEntries($res,$res_tit);
                }
                if($res_lan =& $this->__performLanguageSearch())
                {
                        $this->__storeEntries($res,$res_lan);
                }
                if($res_gen =& $this->__performGeneralSearch())
                {
                        $this->__storeEntries($res,$res_gen);
                }
                if($res_lif =& $this->__performLifecycleSearch())
                {
                        $this->__storeEntries($res,$res_lif);
                }
                if($res_con =& $this->__performContributeSearch())
                {
                        $this->__storeEntries($res,$res_con);
                }
                if($res_ent =& $this->__performEntitySearch())
                {
                        $this->__storeEntries($res,$res_ent);
                }
                if($res_req =& $this->__performRequirementSearch())
                {
                        $this->__storeEntries($res,$res_req);
                }
                if($res_for =& $this->__performFormatSearch())
                {
                        $this->__storeEntries($res,$res_for);
                }
                if($res_edu =& $this->__performEducationalSearch())
                {
                        $this->__storeEntries($res,$res_edu);
                }
                if($res_typ =& $this->__performTypicalAgeRangeSearch())
                {
                        $this->__storeEntries($res,$res_typ);
                }
                if($res_rig =& $this->__performRightsSearch())
                {
                        $this->__storeEntries($res,$res_rig);
                }
                if($res_cla =& $this->__performClassificationSearch())
                {
                        $this->__storeEntries($res,$res_cla);
                }
                if($res_tax =& $this->__performTaxonSearch())
                {
                        $this->__storeEntries($res,$res_tax);
                }
                if($res_key =& $this->__performKeywordSearch())
                {
                        $this->__storeEntries($res,$res_key);
                }

                if($this->search_mode == 'in_results')
                {
                        include_once 'Services/Search/classes/class.ilSearchResult.php';

                        $old_result_obj = new ilSearchResult($ilUser->getId());
                        $old_result_obj->read(ADVANCED_SEARCH);

                        $res->diffEntriesFromResult($old_result_obj);
                }

                
                $res->filter($this->getRootNode(),true);

                if(!count($res->getResults()))
                {
                        sendInfo($this->lng->txt('search_no_match'));
                }
                else
                {
                        $this->__showSearchInResults();
                }                       

                if($res->isLimitReached())
                {
                        $message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
                        sendInfo($message);
                }

                $this->showSearch();

                include_once 'Services/Search/classes/class.ilSearchResultPresentationGUI.php';

                $search_result_presentation = new ilSearchResultPresentationGUI($res);
                $this->tpl->setVariable("RESULTS",$search_result_presentation->showResults());

                $res->setUserId($ilUser->getId());
                $res->save(ADVANCED_SEARCH);


                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilAdvancedSearchGUI::prepareOutput (  ) 

Reimplemented from ilSearchBaseGUI.

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

References ilUtil::getImagePath().

Referenced by executeCommand().

        {
                parent::prepareOutput();

                $this->tpl->setCurrentBlock("header_image");
                $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_src_b.gif"));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setVariable("TXT_HEADER",$this->lng->txt('search'));

                $this->tpl->addBlockFile("TABS","tabs","tpl.tabs.html");

                $this->tpl->setCurrentBlock("tab");
                $this->tpl->setVariable("TAB_TYPE","tabinactive");
                $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilsearchgui'));
                $this->tpl->setVariable("TAB_TEXT",$this->lng->txt("search"));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("tab");
                $this->tpl->setVariable("TAB_TYPE","tabactive");
                $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTarget($this));
                $this->tpl->setVariable("TAB_TEXT",$this->lng->txt("search_advanced"));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("tab");
                $this->tpl->setVariable("TAB_TYPE","tabinactive");
                $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilsearchresultgui'));
                $this->tpl->setVariable("TAB_TEXT",$this->lng->txt("search_search_results"));
                $this->tpl->parseCurrentBlock();
                
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilAdvancedSearchGUI::reset (  ) 

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

References showSearch().

        {
                $this->options = array();
                $this->showSearch();
        }

Here is the call graph for this function:

ilAdvancedSearchGUI::saveResult (  ) 

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

References $_POST, $ref_id, $title, ilObject::_lookupObjId(), ilObject::_lookupTitle(), ilObject::_lookupType(), sendInfo(), and showSavedResults().

        {
                include_once 'Services/Search/classes/class.ilUserResult.php';
                include_once 'Services/Search/classes/class.ilSearchFolder.php';

                global $ilUser;

                if(!$_POST['folder'])
                {
                        sendInfo($this->lng->txt('search_select_one'));
                        $this->showSavedResults();

                        return false;
                }
                if(!count($_POST['result']))
                {
                        sendInfo($this->lng->txt('search_select_one_result'));
                        $this->showSavedResults();

                        return false;
                }

                $folder_obj =& new ilSearchFolder($ilUser->getId(),(int) $_POST['folder']);

                foreach($_POST['result'] as $ref_id)
                {

                        $title = ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id));
                        $target = addslashes(serialize(array('type' => ilObject::_lookupType(ilObject::_lookupObjId($ref_id)),
                                                                                                 'id'   => $ref_id)));

                        $search_res_obj =& new ilUserResult($ilUser->getId());
                        $search_res_obj->setTitle($title);
                        $search_res_obj->setTarget($target);

                        $folder_obj->assignResult($search_res_obj);
                        unset($search_res_obj);
                }
                sendInfo($this->lng->txt('search_results_saved'));
                $this->showSavedResults();

        }

Here is the call graph for this function:

ilAdvancedSearchGUI::searchInResults (  ) 

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

References performSearch().

        {
                $this->search_mode = 'in_results';
                $this->performSearch();

                return true;
        }

Here is the call graph for this function:

ilAdvancedSearchGUI::showSavedResults (  ) 

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

References __showSearchInResults(), and showSearch().

Referenced by saveResult().

        {
                global $ilUser;

                // Read old result sets
                include_once 'Services/Search/classes/class.ilSearchResult.php';
        
                $result_obj = new ilSearchResult($ilUser->getId());
                $result_obj->read(ADVANCED_SEARCH);

                $this->showSearch();

                // Show them
                if(count($result_obj->getResults()))
                {
                        $this->__showSearchInResults();

                        include_once 'Services/Search/classes/class.ilSearchResultPresentationGUI.php';
                        
                        $search_result_presentation = new ilSearchResultPresentationGUI($result_obj);
                        $this->tpl->setVariable("RESULTS",$search_result_presentation->showResults());
                }

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilAdvancedSearchGUI::showSearch (  ) 

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

References __getFilterSelect(), ilMDUtilSelect::_getBrowserSelect(), ilMDUtilSelect::_getContextSelect(), ilMDUtilSelect::_getCopyrightAndOtherRestrictionsSelect(), ilMDUtilSelect::_getCostsSelect(), ilMDUtilSelect::_getDifficultySelect(), ilMDUtilSelect::_getDurationSelect(), ilMDUtilSelect::_getFormatSelect(), ilMDUtilSelect::_getIntendedEndUserRoleSelect(), ilMDUtilSelect::_getInteractivityLevelSelect(), ilMDUtilSelect::_getInteractivityTypeSelect(), ilMDUtilSelect::_getLanguageSelect(), ilMDUtilSelect::_getLearningResourceTypeSelect(), ilMDUtilSelect::_getOperatingSystemSelect(), ilMDUtilSelect::_getPurposeSelect(), ilMDUtilSelect::_getRoleSelect(), ilMDUtilSelect::_getSemanticDensitySelect(), ilMDUtilSelect::_getStatusSelect(), ilMDUtilSelect::_getStructureSelect(), ilMDUtilSelect::_getTypicalAgeRangeSelect(), ilMDUtilSelect::_getTypicalLearningTimeSelect(), and ilUtil::prepareFormOutput().

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

        {
                global $ilLocator;
/*
                $ilLocator->addItem($this->lng->txt('search_advanced'),
                        $this->ctrl->getLinkTarget($this));
                $this->tpl->setLocator();
*/

                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_search.html','Services/Search');

                // Header
                $this->tpl->setVariable("SEARCH_ACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TBL_TITLE",$this->lng->txt('search_advanced'));

                // Content
                $this->tpl->setVariable("TXT_CONTENT",$this->lng->txt('content'));
                $this->tpl->setVariable("TXT_OR",$this->lng->txt('search_any_word'));
                $this->tpl->setVariable("TXT_AND",$this->lng->txt('search_all_words'));

                if($this->options['content_ao'] == 'and')
                {
                        $this->tpl->setVariable("CONTENT_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("CONTENT_OR_CHECKED",'checked=checked');
                }
                $this->tpl->setVariable("FRM_CONTENT",ilUtil::prepareFormOutput($this->options['content']));

                // Type
                $this->tpl->setVariable("TXT_TYPE",$this->lng->txt('type'));
                $this->tpl->setVariable("SEL_TYPE",$this->__getFilterSelect());

                // General
                $this->tpl->setVariable("TXT_GEN",$this->lng->txt('meta_general'));
                $this->tpl->setVariable("TXT_LAN",$this->lng->txt('language'));
                $this->tpl->setVariable("SEL_LAN",ilMDUtilSelect::_getLanguageSelect($this->options['language'],
                                                                                                                                                         'search_adv[language]'
                                                                                                                                                         ,array(0 => $this->lng->txt('meta_please_select'))));

                $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('meta_title').'/'.
                                                                $this->lng->txt('meta_keyword').'/'.
                                                                $this->lng->txt('meta_description'));
                $this->tpl->setVariable("TXT_COV",$this->lng->txt('meta_coverage'));
                $this->tpl->setVariable("TXT_STRUCT",$this->lng->txt('meta_structure'));
                $this->tpl->setVariable("SEL_STRUCT",ilMDUtilSelect::_getStructureSelect($this->options['structure'],
                                                                                                                                                                 'search_adv[structure]',
                                                                                                                                                                 array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("FRM_TITLE",ilUtil::prepareFormOutput($this->options['title'],true));
                $this->tpl->setVariable("FRM_COVERAGE",ilUtil::prepareFormOutput($this->options['coverage'],true));

                if($this->options['title_ao'] == 'and')
                {
                        $this->tpl->setVariable("TITLE_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("TITLE_OR_CHECKED",'checked=checked');
                }
                if($this->options['coverage_ao'] == 'and')
                {
                        $this->tpl->setVariable("COVERAGE_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("COVERAGE_OR_CHECKED",'checked=checked');
                }

                

                // Lifecycle
                $this->tpl->setVariable("TXT_LIFECYCLE",$this->lng->txt('meta_lifecycle'));
                $this->tpl->setVariable("TXT_STATUS",$this->lng->txt('meta_status'));
                $this->tpl->setVariable("SEL_STATUS",
                                                                ilMDUtilSelect::_getStatusSelect($this->options['status'],
                                                                                                                                 'search_adv[status]',
                                                                                                                                 array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("TXT_VERSION",$this->lng->txt('meta_version'));
                $this->tpl->setVariable("FRM_VERSION",ilUtil::prepareFormOutput($this->options['version'],true));

                $this->tpl->setVariable("TXT_CONTRIBUTOR",$this->lng->txt('meta_contribute'));
                $this->tpl->setVariable("SEL_CONTRIBUTOR",
                                                                ilMDUtilSelect::_getRoleSelect($this->options['role'],
                                                                                                                           'search_adv[role]',
                                                                                                                           array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("FRM_ENTITY",ilUtil::prepareFormOutput($this->options['entity'],true));

                if($this->options['entity_ao'] == 'and')
                {
                        $this->tpl->setVariable("ENTITY_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("ENTITY_OR_CHECKED",'checked=checked');
                }
                if($this->options['version_ao'] == 'and')
                {
                        $this->tpl->setVariable("VERSION_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("VERSION_OR_CHECKED",'checked=checked');
                }

                // Technical
                $this->tpl->setVariable("TXT_TECHNICAL",$this->lng->txt('meta_technical'));
                $this->tpl->setVariable("TXT_FORMAT",$this->lng->txt('meta_format'));
                $this->tpl->setVariable("TXT_OS",$this->lng->txt('meta_operating_system'));
                $this->tpl->setVariable("TXT_BROWSER",$this->lng->txt('meta_browser'));
                $this->tpl->setVariable("TXT_DURATION",$this->lng->txt('meta_duration'));
                $this->tpl->setVariable("FROM",$this->lng->txt('from'));
                $this->tpl->setVariable("TIL",$this->lng->txt('until'));
                
                $this->tpl->setVariable("SEL_FORMAT",
                                                                ilMDUtilSelect::_getFormatSelect($this->options['format'],
                                                                                                                                 'search_adv[format]',
                                                                                                                                 array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_OS",
                                                                ilMDUtilSelect::_getOperatingSystemSelect($this->options['os'],
                                                                                                                                                  'search_adv[os]',
                                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_BROWSER",
                                                                ilMDUtilSelect::_getBrowserSelect($this->options['browser'],
                                                                                                                                  'search_adv[browser]',
                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_DURATION_1",
                                                                ilMDUtilSelect::_getDurationSelect('','md_lan',array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_DURATION_2",
                                                                ilMDUtilSelect::_getDurationSelect('','md_lan',array(0 => $this->lng->txt('meta_please_select'))));

                // Educational
                $this->tpl->setVariable("TXT_EDUCATIONAL",$this->lng->txt('meta_education'));
                $this->tpl->setVariable("TXT_INTERACTIVITY",$this->lng->txt('meta_interactivity_type'));
                $this->tpl->setVariable("TXT_RESOURCE",$this->lng->txt('meta_learning_resource_type'));
                $this->tpl->setVariable("TXT_LEVEL",$this->lng->txt('meta_interactivity_level'));
                $this->tpl->setVariable("TXT_DENSITY",$this->lng->txt('meta_semantic_density'));
                $this->tpl->setVariable("TXT_END_USER",$this->lng->txt('meta_intended_end_user_role'));
                $this->tpl->setVariable("TXT_CONTEXT",$this->lng->txt('meta_context'));
                $this->tpl->setVariable("TXT_DIFFICULTY",$this->lng->txt('meta_difficulty'));
                $this->tpl->setVariable("TXT_AGE_RANGE",$this->lng->txt('meta_typical_age_range'));
                $this->tpl->setVariable("TXT_LEARNING_TIME",$this->lng->txt('meta_typical_learning_time'));


                $this->tpl->setVariable("SEL_INTERACTIVITY",
                                                                ilMDUtilSelect::_getInteractivityTypeSelect($this->options['int_type'],
                                                                                                                                                        'search_adv[int_type]',
                                                                                                                                                        array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_RESOURCE",
                                                                ilMDUtilSelect::_getLearningResourceTypeSelect($this->options['lea_type'],
                                                                                                                                                           'search_adv[lea_type]',
                                                                                                                                                           array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_LEVEL_1",
                                                                ilMDUtilSelect::_getInteractivityLevelSelect($this->options['int_level_1'],
                                                                                                                                                         'search_adv[int_level_1]',
                                                                                                                                                         array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_LEVEL_2",
                                                                ilMDUtilSelect::_getInteractivityLevelSelect($this->options['int_level_2'],
                                                                                                                                                         'search_adv[int_level_2]',
                                                                                                                                                         array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_DENSITY_1",
                                                                ilMDUtilSelect::_getSemanticDensitySelect($this->options['sem_1'],
                                                                                                                                                  'search_adv[sem_1]',
                                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_DENSITY_2",
                                                                ilMDUtilSelect::_getSemanticDensitySelect($this->options['sem_2'],
                                                                                                                                                  'search_adv[sem_2]',
                                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_END_USER",
                                                                ilMDUtilSelect::_getIntendedEndUserRoleSelect($this->options['int_role'],
                                                                                                                                                          'search_adv[int_role]',
                                                                                                                                                          array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_CONTEXT",
                                                                ilMDUtilSelect::_getContextSelect($this->options['con'],
                                                                                                                                  'search_adv[con]',
                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_DIFFICULTY_1",
                                                                ilMDUtilSelect::_getDifficultySelect($this->options['dif_1'],
                                                                                                                                         'search_adv[dif_1]',
                                                                                                                                         array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_DIFFICULTY_2",
                                                                ilMDUtilSelect::_getDifficultySelect($this->options['dif_2'],
                                                                                                                                         'search_adv[dif_2]',
                                                                                                                                         array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_AGE_RANGE_1",
                                                                ilMDUtilSelect::_getTypicalAgeRangeSelect($this->options['typ_age_1'],
                                                                                                                                                  'search_adv[typ_age_1]',
                                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_AGE_RANGE_2",
                                                                ilMDUtilSelect::_getTypicalAgeRangeSelect($this->options['typ_age_2'],
                                                                                                                                                  'search_adv[typ_age_2]',
                                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_LEARNING_TIME_1",
                                                                ilMDUtilSelect::_getTypicalLearningTimeSelect($this->options['typ_lea_1'],
                                                                                                                                                          'search_adv[typ_lea_1]',
                                                                                                                                                          array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_LEARNING_TIME_2",
                                                                ilMDUtilSelect::_getTypicalLearningTimeSelect($this->options['typ_lea_2'],
                                                                                                                                                          'search_adv[typ_lea_2]',
                                                                                                                                                          array(0 => $this->lng->txt('meta_please_select'))));

                // RIGHTS
                $this->tpl->setVariable("TXT_RIGHTS",$this->lng->txt('meta_rights'));
                $this->tpl->setVariable("TXT_COSTS",$this->lng->txt('meta_cost'));
                $this->tpl->setVariable("TXT_COPYRIGHT",$this->lng->txt('meta_copyright_and_other_restrictions'));
                
                $this->tpl->setVariable("SEL_COSTS",
                                                                ilMDUtilSelect::_getCostsSelect($this->options['costs'],
                                                                                                                                'search_adv[costs]',array(0 => $this->lng->txt('meta_please_select'))));
                $this->tpl->setVariable("SEL_COPYRIGHT",
                                                                ilMDUtilSelect::_getCopyrightAndOtherRestrictionsSelect($this->options['copyright'],
                                                                                                                                                                                'search_adv[copyright]',
                                                                                                                                                                                array(0 => $this->lng->txt('meta_please_select'))));

                // CLASSIFICATION
                $this->tpl->setVariable("TXT_CLASSIFICATION",$this->lng->txt('meta_classification'));
                $this->tpl->setVariable("TXT_PURPOSE",$this->lng->txt('meta_purpose'));
                $this->tpl->setVariable("TXT_TAXON",$this->lng->txt('meta_taxon'));
                $this->tpl->setVariable("TXT_KEYWORD",$this->lng->txt('meta_keyword'));
                
                $this->tpl->setVariable("SEL_PURPOSE",
                                                                ilMDUtilSelect::_getPurposeSelect($this->options['purpose'],
                                                                                                                                  'search_adv[purpose]',
                                                                                                                                  array(0 => $this->lng->txt('meta_please_select'))));

                if($this->options['taxon_ao'] == 'and')
                {
                        $this->tpl->setVariable("TAXON_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("TAXON_OR_CHECKED",'checked=checked');
                }
                $this->tpl->setVariable("FRM_TAXON",ilUtil::prepareFormOutput($this->options['taxon'],true));

                if($this->options['keyword_ao'] == 'and')
                {
                        $this->tpl->setVariable("KEYWORD_AND_CHECKED",'checked=checked');
                }
                else
                {
                        $this->tpl->setVariable("KEYWORD_OR_CHECKED",'checked=checked');
                }
                $this->tpl->setVariable("FRM_KEYWORD",ilUtil::prepareFormOutput($this->options['keyword'],true));

                $this->tpl->setVariable("BTN_SEARCH",$this->lng->txt('search'));
                $this->tpl->setVariable("BTN_RESET",$this->lng->txt('reset'));

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

ilAdvancedSearchGUI::$options = array()

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

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

Referenced by __getFilterSelect(), and __getFolderSelect().


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