ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedSearchGUI Class Reference
+ Inheritance diagram for ilAdvancedSearchGUI:
+ Collaboration diagram for ilAdvancedSearchGUI:

Public Member Functions

 ilAdvancedSearchGUI ()
 Constructor public.
 getRootNode ()
executeCommand ()
 Control public.
 reset ()
 searchInResults ()
 performSearch ()
 showAdvMDSearch ()
 Show advanced meta data search.
 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
- Public Member Functions inherited from ilSearchBaseGUI
 ilSearchBaseGUI ()
 Constructor public.
 handleCommand ($a_cmd)
 addToDeskObject ()
 Interface methods.
 removeFromDeskObject ()
 Remove from dektop.
 delete ()
 Show deletion screen.
 cancelDelete ()
 Cancel delete.
 performDelete ()
 Delete objects.
 cut ()
 Interface ilAdministrationCommandHandler.
 link ()
 Interface ilAdministrationCommandHandler.
 paste ()
 Paste.
 showLinkIntoMultipleObjectsTree ()
 Target selection link.
 showMoveIntoObjectTree ()
 Target selection cut.
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects.
 clear ()
 clear clipboard
 enableAdministrationPanel ()
 Enable administration panel.
 disableAdministrationPanel ()
 Disable administration panel.
 addLocator ()
 Add Locator.
 autoComplete ()
 Data resource for autoComplete.

Data Fields

const TYPE_LOM = 1
const TYPE_ADV_MD = 2
- Data Fields inherited from ilSearchBaseGUI
 $settings = null
 $ilias = null
 $lng = null
 $tpl = null

Protected Member Functions

 initAdvancedMetaDataForm ()
 protected
 performAdvMDSearch ()
 perform advanced meta data search
 initFormSearch ()
 Show search form.
- Protected Member Functions inherited from ilSearchBaseGUI
 addPager ($result, $a_session_key)
 Add Pager.
 buildSearchAreaPath ($a_root_node)
 Build path for search area.

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
 searchAdvancedMD ($res)
 Perform advanced meta data search.
 initUserSearchCache ()
 Init user search cache.
 toUnixTime ($date, $time=array())
 convert input array to unix time
 initSearchType ($type)
 init search type (LOM Search or Advanced meta data search)

Private Attributes

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

Detailed Description

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

Member Function Documentation

ilAdvancedSearchGUI::__getFilterSelect ( )

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

References $options, and formSelect().

{
$options = array('all' => $this->lng->txt('search_any'),
'crs' => $this->lng->txt('objs_crs'),
'lms' => $this->lng->txt('learning_resources'),
'glo' => $this->lng->txt('objs_glo'),
'mep' => $this->lng->txt('objs_mep'),
'tst' => $this->lng->txt('search_tst_svy'),
'file'=> $this->lng->txt('objs_file'),
'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:

& ilAdvancedSearchGUI::__performClassificationSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

{
// Return if 'any'
if(!$this->options['lom_purpose'])
{
return false;
}
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
$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 559 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().

{
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
include_once 'Services/Search/classes/class.ilSearchResult.php';
if(!$this->options['lom_content'])
{
return false;
}
$res =& new ilSearchResult();
$query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_content']));
#$query_parser->setCombination($this->options['content_ao']);
$query_parser->setCombination(QP_COMBINATION_OR);
$query_parser->parse();
if($this->options['type'] == 'all' or $this->options['type'] == 'lms')
{
// LM content search
$res_cont =& $lm_search->performSearch();
$res->mergeEntries($res_cont);
}
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')
{
$res_med =& $med_search->performSearch();
$res->mergeEntries($res_med);
}
if($this->options['type'] == 'all' or $this->options['type'] == 'glo')
{
$res_glo =& $glo_search->performSearch();
$res->mergeEntries($res_glo);
}
if($this->options['type'] == 'all' or $this->options['type'] == 'webr')
{
$res_web =& $web_search->performSearch();
$res->mergeEntries($res_web);
}
if($tit_res = $this->__performTitleSearch())
{
$res->mergeEntries($tit_res);
}
return $res;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilAdvancedSearchGUI::__performContributeSearch ( )

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

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

{
if(!strlen($this->options['lom_role']))
{
return false;
}
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
$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 793 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->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 739 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

{
// Return if 'any'
if(!$this->options['lom_role_entry'])
{
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['lom_role_entry']));
#$query_parser->setCombination($this->options['entity_ao']);
$query_parser->setCombination(QP_COMBINATION_OR);
$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 779 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->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 650 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

{
if(!$this->options['lom_coverage'] and !$this->options['lom_structure'])
{
return false;
}
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
if($this->options['lom_coverage'])
{
$query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['lom_coverage']));
#$query_parser->setCombination($this->options['coverage_ao']);
$query_parser->setCombination(QP_COMBINATION_OR);
$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 952 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

{
// Return if 'any'
if(!$this->options['lom_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['lom_keyword']));
#$query_parser->setCombination($this->options['keyword_ao']);
$query_parser->setCombination(QP_COMBINATION_OR);
$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 703 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

{
if(!$this->options['lom_language'])
{
return false;
}
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
$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 680 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

{
// Return if 'any'
if(!$this->options['lom_status'] and !$this->options['lom_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['lom_version']));
#$query_parser->setCombination($this->options['version_ao']);
$query_parser->setCombination(QP_COMBINATION_OR);
$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 765 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->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 821 of file class.ilAdvancedSearchGUI.php.

References $res, and ilObjectSearchFactory\_getAdvancedSearchInstance().

Referenced by performSearch().

{
if(!$this->options['lom_copyright'] and !$this->options['lom_costs'])
{
return false;
}
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
$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 860 of file class.ilAdvancedSearchGUI.php.

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

Referenced by performSearch().

{
// Return if 'any'
if(!$this->options['lom_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['lom_taxon']));
$query_parser->setCombination(QP_COMBINATION_OR);
$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 617 of file class.ilAdvancedSearchGUI.php.

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

Referenced by __performContentSearch(), and performAdvMDSearch().

{
if(!$this->options['lom_content'])
{
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['lom_content']));
#$query_parser->setCombination($this->options['title_ao']);
$query_parser->setCombination(QP_COMBINATION_OR);
$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 807 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->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 976 of file class.ilAdvancedSearchGUI.php.

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

Referenced by ilAdvancedSearchGUI().

{
if(isset($_POST['cmd']['performSearch']))
{
$this->options = $_SESSION['search_adv'] = $_POST['query'];
}
elseif(isset($_POST['cmd']['performAdvMDSearch']))
{
$this->options = $_SESSION['search_adv_md'] = $_POST;
}
else
{
$this->options = $_SESSION['search_adv'];
}
$_POST['result'] = $_POST['id'];
$this->filter = array();
$this->options['type'] = 'all';
switch($this->options['type'])
{
case 'cat':
$this->filter[] = 'cat';
break;
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 'file':
$this->filter[] = 'file';
break;
case 'adv_all':
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
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';
$this->filter[] = 'file';
}
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 1080 of file class.ilAdvancedSearchGUI.php.

References $res.

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

{
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 90 of file class.ilAdvancedSearchGUI.php.

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

{
global $rbacsystem;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case 'ilobjectcopygui':
$this->prepareOutput();
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$this->ctrl->forwardCommand($cp);
break;
default:
if(!$cmd)
{
switch($_SESSION['search_last_sub_section'])
{
case self::TYPE_ADV_MD:
$cmd = "showSavedAdvMDResults";
break;
default:
$cmd = "showSavedResults";
break;
}
}
$this->prepareOutput();
break;
}
return true;
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::getRootNode ( )

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

Referenced by performAdvMDSearch(), and performSearch().

{
return ROOT_FOLDER_ID;
}

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::ilAdvancedSearchGUI ( )

Constructor public.

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

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

{
global $ilTabs;
$this->tabs_gui = $ilTabs;
$this->lng->loadLanguageModule('meta');
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::initAdvancedMetaDataForm ( )
protected

protected

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

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

Referenced by showAdvMDSearch().

{
if(is_object($this->form))
{
return $this->form;
}
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'performAdvMDSearch'));
$this->form->setTitle($this->lng->txt('adv_md_search_title'));
$this->form->addCommandButton('performAdvMDSearch',$this->lng->txt('search'));
#$this->form->setSubformMode('right');
$content = new ilTextInputGUI($this->lng->txt('meta_title').'/'.
$this->lng->txt('meta_keyword').'/'.
$this->lng->txt('meta_description'),'title');
$content->setValue($this->options['title']);
$content->setSize(30);
$content->setMaxLength(255);
// $content->setSubformMode('right');
$group = new ilRadioGroupInputGUI('','title_ao');
$group->setValue($this->options['title_ao']);
$radio_option = new ilRadioOption($this->lng->txt("search_any_word"),0);
$group->addOption($radio_option);
$radio_option = new ilRadioOption($this->lng->txt("search_all_words"),1);
$group->addOption($radio_option);
$content->addSubItem($group);
$this->form->addItem($content);
$type = new ilSelectInputGUI($this->lng->txt('type'),'type');
$options['adv_all'] = $this->lng->txt('search_any');
{
$options[$obj_type] = $this->lng->txt('objs_'.$obj_type);
}
$type->setOptions($options);
$type->setValue($this->options['type']);
$this->form->addItem($type);
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
$record_gui->setPropertyForm($this->form);
$record_gui->setSearchValues($this->options);
$record_gui->parse();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::initFormSearch ( )
protected

Show search form.

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

References $section.

Referenced by showSearch().

{
global $tree;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'performSearch'));
$this->form->setTitle($this->lng->txt('search_advanced'));
$this->form->addCommandButton('performSearch',$this->lng->txt('search'));
$this->form->addCommandButton('reset',$this->lng->txt('reset'));
foreach($this->fields->getActiveSections() as $definition)
{
if($definition['name'] != 'default')
{
$section->setTitle($definition['name']);
$this->form->addItem($section);
}
foreach($definition['fields'] as $field_name)
{
if(is_object($element = $this->fields->getFormElement($this->search_cache->getQuery(),$field_name)))
{
$this->form->addItem($element);
}
}
}
return true;
}

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::initSearchType (   $type)
private

init search type (LOM Search or Advanced meta data search)

private

Parameters

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

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

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

{
if($type == self::TYPE_LOM)
{
$_SESSION['search_last_sub_section'] = self::TYPE_LOM;
$this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
}
else
{
$_SESSION['search_last_sub_section'] = self::TYPE_ADV_MD;
$this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_MD_SEARCH);
}
}

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::initUserSearchCache ( )
private

Init user search cache.

private

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

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

Referenced by executeCommand().

{
global $ilUser;
include_once('Services/Search/classes/class.ilUserSearchCache.php');
$this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
$this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
if($_GET['page_number'])
{
$this->search_cache->setResultPageNumber((int) $_GET['page_number']);
}
if($_POST['cmd']['performSearch'])
{
$this->search_cache->setQuery(ilUtil::stripSlashes($_POST['query']['lomContent']));
$this->search_cache->save();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::performAdvMDSearch ( )
protected

perform advanced meta data search

protected

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

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

{
global $ilUser;
$this->initSearchType(self::TYPE_ADV_MD);
if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
{
unset($_SESSION['adv_max_page']);
$this->search_cache->delete();
}
include_once 'Services/Search/classes/class.ilSearchResult.php';
$res =& new ilSearchResult();
if($res_tit =& $this->__performTitleSearch())
{
$this->__storeEntries($res,$res_tit);
}
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_MD_SEARCH);
$res->diffEntriesFromResult($old_result_obj);
}
$res->filter($this->getRootNode(),true);
$res->save();
$this->showAdvMDSearch();
if(!count($res->getResults()))
{
ilUtil::sendInfo($this->lng->txt('search_no_match'));
}
if($res->isLimitReached())
{
#$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
#ilUtil::sendInfo($message);
}
$this->addPager($res,'adv_max_page');
include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
$presentation->setResults($res->getResultsForPresentation());
$presentation->setPreviousNext($this->prev_link, $this->next_link);
if($presentation->render())
{
$this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
}
return true;
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::performSearch ( )

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

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

{
global $ilUser;
$this->initSearchType(self::TYPE_LOM);
if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
{
unset($_SESSION['adv_max_page']);
$this->search_cache->deleteCachedEntries();
}
if(isset($_POST['query']))
{
$this->search_cache->setQuery($_POST['query']);
}
include_once 'Services/Search/classes/class.ilSearchResult.php';
$res =& new ilSearchResult();
if($res_con =& $this->__performContentSearch())
{
$this->__storeEntries($res,$res_con);
}
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_MD_SEARCH);
$res->diffEntriesFromResult($old_result_obj);
}
$res->filter($this->getRootNode(),true);
$res->save();
$this->showSearch();
if(!count($res->getResults()))
{
ilUtil::sendInfo($this->lng->txt('search_no_match'));
}
if($res->isLimitReached())
{
#$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
#ilUtil::sendInfo($message);
}
$this->addPager($res,'adv_max_page');
include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
$presentation->setResults($res->getResultsForPresentation());
$presentation->setPreviousNext($this->prev_link, $this->next_link);
if($presentation->render())
{
$this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
}
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 460 of file class.ilAdvancedSearchGUI.php.

Referenced by executeCommand().

{
global $ilTabs;
// $this->tpl->addBlockFile("TABS","tabs","tpl.tabs.html");
$ilTabs->addTab("search", $this->lng->txt("search"),
$this->ctrl->getLinkTargetByClass('ilsearchgui'));
$ilTabs->addTab("adv_search", $this->lng->txt("search_advanced"),
$this->ctrl->getLinkTarget($this));
$ilTabs->activateTab("adv_search");
/*$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();*/
}

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::reset ( )

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

References initSearchType(), and showSearch().

{
$this->initSearchType(self::TYPE_LOM);
$this->options = array();
$this->search_cache->setQuery(array());
$this->search_cache->save();
$this->showSearch();
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::searchAdvancedMD (   $res)
private

Perform advanced meta data search.

private

Parameters
objresult object

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

{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
foreach($_POST as $key => $value)
{
if(!is_numeric($key))
{
continue;
}
if(!$value)
{
continue;
}
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
include_once 'Services/Search/classes/class.ilQueryParser.php';
if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_SELECT)
{
$value = (int) $value;
$options = $def->getFieldValues();
if(!isset($options[$value - 1]))
{
continue;
}
$value = $options[$value - 1];
}
if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE)
{
$start = $this->toUnixTime($_POST['date_start'][$key]['date']);
$end = $this->toUnixTime($_POST['date_end'][$key]['date']);
}
if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATETIME)
{
$start = $this->toUnixTime($_POST['date_start'][$key]['date'],$_POST['date_start'][$key]['time']);
$end = $this->toUnixTime($_POST['date_end'][$key]['date'],$_POST['date_end'][$key]['time']);
}
$query_parser = new ilQueryParser(ilUtil::stripSlashes($value));
if($_POST['boolean'][$key] == 1)
{
$query_parser->setCombination('and');
}
else
{
$query_parser->setCombination('or');
}
$query_parser->parse();
$adv_md_search = ilObjectSearchFactory::_getAdvancedMDSearchInstance($query_parser);
$adv_md_search->setDefinition($def);
$adv_md_search->setTimeRange($start,$end);
$adv_md_search->setFilter($this->filter);
$res_field = $adv_md_search->performSearch();
$this->__storeEntries($res,$res_field);
}
return $res;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::searchInResults ( )

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

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

{
$this->initSearchType(self::TYPE_LOM);
$this->search_mode = 'in_results';
$this->search_cache->setResultPageNumber(1);
unset($_SESSION['adv_max_page']);
$this->performSearch();
return true;
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::setSubTabs ( )

set sub tabs

public

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

References ilAdvancedMDFieldDefinition\_getSearchableDefinitionIds().

Referenced by showAdvMDSearch(), and showSearch().

{
global $ilTabs;
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
{
return true;
}
$ilTabs->addSubTabTarget('search_lom',$this->ctrl->getLinkTarget($this,'showSavedResults'));
#$ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::showAdvMDSearch ( )

Show advanced meta data search.

public

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

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

Referenced by performAdvMDSearch(), and showSavedAdvMDResults().

{
if(isset($_SESSION['search_adv_md']))
{
$this->options = $_SESSION['search_adv_md'];
}
$this->setSubTabs();
$this->tabs_gui->setSubTabActive('search_adv_md');
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_adv_search.html','Services/Search');
$this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::showSavedAdvMDResults ( )
private

show advanced meta data results

private

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

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

{
global $ilUser;
// Read old result sets
include_once 'Services/Search/classes/class.ilSearchResult.php';
$this->initSearchType(self::TYPE_ADV_MD);
$result_obj = new ilSearchResult($ilUser->getId());
$result_obj->read(ADVANCED_MD_SEARCH);
$this->showAdvMDSearch();
// Show them
if(count($result_obj->getResults()))
{
$this->addPager($result_obj,'adv_max_page');
include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
$presentation->setResults($result_obj->getResultsForPresentation());
$presentation->setPreviousNext($this->prev_link, $this->next_link);
if($presentation->render())
{
$this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
}
}
return true;
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::showSavedResults ( )

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

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

{
global $ilUser;
// Read old result sets
include_once 'Services/Search/classes/class.ilSearchResult.php';
$this->initSearchType(self::TYPE_LOM);
$result_obj = new ilSearchResult($ilUser->getId());
$result_obj->read(ADVANCED_SEARCH);
$this->showSearch();
// Show them
if(count($result_obj->getResults()))
{
$this->addPager($result_obj,'adv_max_page');
include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
$presentation->setResults($result_obj->getResultsForPresentation());
$presentation->setPreviousNext($this->prev_link, $this->next_link);
if($presentation->render())
{
$this->tpl->setVariable('RESULTS',$presentation->getHTML(true));
}
}
return true;
}

+ Here is the call graph for this function:

ilAdvancedSearchGUI::showSearch ( )

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

References initFormSearch(), and setSubTabs().

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

{
global $ilLocator;
$this->setSubTabs();
$this->tabs_gui->setSubTabActive('search_lom');
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_search.html','Services/Search');
$this->initFormSearch();
$this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedSearchGUI::toUnixTime (   $date,
  $time = array() 
)
private

convert input array to unix time

private

Parameters

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

Referenced by searchAdvancedMD().

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

+ Here is the caller graph for this function:

Field Documentation

ilAdvancedSearchGUI::$fields = array()
protected

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

ilAdvancedSearchGUI::$last_section = 'adv_search'
protected

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

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().

ilAdvancedSearchGUI::$tabs_gui
protected

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

const ilAdvancedSearchGUI::TYPE_ADV_MD = 2

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

Referenced by initSearchType().

const ilAdvancedSearchGUI::TYPE_LOM = 1

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

Referenced by initSearchType().


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