25include_once 
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
 
   60        $this->lng->loadLanguageModule(
'meta');
 
   71        if (isset(self::$instance) and self::$instance) {
 
   84        $lng->loadLanguageModule(
'meta');
 
   88        include_once 
'./Services/Search/classes/class.ilSearchSettings.php';
 
   90            $fields[
'general_offline']          = 
$lng->txt(
'lucene_offline_filter');
 
   95        $fields[
'lom_coverage']                         = 
$lng->txt(
'meta_coverage');
 
   96        $fields[
'lom_structure']                        = 
$lng->txt(
'meta_structure');
 
   99        $fields[
'lom_contribute']                       = 
$lng->txt(
'meta_contribute');
 
  101        $fields[
'lom_operating_system']         = 
$lng->txt(
'meta_operating_system');
 
  102        $fields[
'lom_browser']                          = 
$lng->txt(
'meta_browser');
 
  103        $fields[
'lom_interactivity']            = 
$lng->txt(
'meta_interactivity_type');
 
  104        $fields[
'lom_resource']                         = 
$lng->txt(
'meta_learning_resource_type');
 
  105        $fields[
'lom_level']                            = 
$lng->txt(
'meta_interactivity_level');
 
  106        $fields[
'lom_density']                          = 
$lng->txt(
'meta_semantic_density');
 
  107        $fields[
'lom_user_role']                        = 
$lng->txt(
'meta_intended_end_user_role');
 
  108        $fields[
'lom_context']                          = 
$lng->txt(
'meta_context');
 
  109        $fields[
'lom_difficulty']                       = 
$lng->txt(
'meta_difficulty');
 
  111        $fields[
'lom_copyright']                        = 
$lng->txt(
'meta_copyright_and_other_restrictions');
 
  112        $fields[
'lom_purpose']                          = 
$lng->txt(
'meta_purpose');
 
  116        include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
 
  117        include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  131        return $this->active_fields ? $this->active_fields : array();
 
  136        return $this->active_sections ? $this->active_sections : array();
 
  141        include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  143        $a_post_name = 
'query[' . $a_field_name . 
']';
 
  146        if (!is_array($a_query)) {
 
  150        switch ($a_field_name) {
 
  151            case 'general_offline':
 
  152                $offline_options = array(
 
  153                    '0' => $this->lng->txt(
'search_any'),
 
  154                    self::ONLINE_QUERY => $this->lng->txt(
'search_option_online'),
 
  155                    self::OFFLINE_QUERY => $this->lng->txt(
'search_option_offline')
 
  157                $offline = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  158                $offline->setOptions($offline_options);
 
  159                $offline->setValue($a_query[
'general_offline']);
 
  164                $text->setSubmitFormOnEnter(
true);
 
  165                $text->setValue($a_query[
'lom_content']);
 
  167                $text->setMaxLength(255);
 
  172                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  173                $select->setValue($a_query[
'lom_language']);
 
  177                    array(0 => $this->lng->txt(
'search_any')),
 
  184                $text->setSubmitFormOnEnter(
true);
 
  185                $text->setValue($a_query[
'lom_keyword']);
 
  187                $text->setMaxLength(255);
 
  192                $text->setSubmitFormOnEnter(
true);
 
  193                $text->setValue($a_query[
'lom_coverage']);
 
  195                $text->setMaxLength(255);
 
  198            case 'lom_structure':
 
  199                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  200                $select->setValue($a_query[
'lom_structure']);
 
  204                    array(0 => $this->lng->txt(
'search_any')),
 
  211                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  212                $select->setValue($a_query[
'lom_status']);
 
  216                    array(0 => $this->lng->txt(
'search_any')),
 
  223                $text->setSubmitFormOnEnter(
true);
 
  224                $text->setValue($a_query[
'lom_version']);
 
  226                $text->setMaxLength(255);
 
  229            case 'lom_contribute':
 
  230                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], 
'query[' . 
'lom_role' . 
']');
 
  231                $select->setValue($a_query[
'lom_role']);
 
  235                    array(0 => $this->lng->txt(
'search_any')),
 
  239                    $text = 
new ilTextInputGUI($this->lng->txt(
'meta_entry'), 
'query[' . 
'lom_role_entry' . 
']');
 
  240                    $text->setValue($a_query[
'lom_role_entry']);
 
  242                    $text->setMaxLength(255);
 
  244                $select->addSubItem(
$text);
 
  249                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  250                $select->setValue($a_query[
'lom_format']);
 
  254                    array(0 => $this->lng->txt(
'search_any')),
 
  259            case 'lom_operating_system':
 
  260                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  261                $select->setValue($a_query[
'lom_operating_system']);
 
  265                    array(0 => $this->lng->txt(
'search_any')),
 
  271                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  272                $select->setValue($a_query[
'lom_browser']);
 
  276                    array(0 => $this->lng->txt(
'search_any')),
 
  282            case 'lom_interactivity':
 
  283                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  284                $select->setValue($a_query[
'lom_interactivity']);
 
  288                    array(0 => $this->lng->txt(
'search_any')),
 
  294                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  295                $select->setValue($a_query[
'lom_resource']);
 
  299                    array(0 => $this->lng->txt(
'search_any')),
 
  307                    $this->lng->txt(
'from'),
 
  309                        $a_query[
'lom_level_start'],
 
  310                        'query[' . 
'lom_level_start' . 
']',
 
  311                        array(0 => $this->lng->txt(
'search_any'))
 
  313                    $this->lng->txt(
'until'),
 
  315                        $a_query[
'lom_level_end'],
 
  316                        'query[' . 
'lom_level_end' . 
']',
 
  317                        array(0 => $this->lng->txt(
'search_any'))
 
  320                $range->setHTML(
$html);
 
  326                    $this->lng->txt(
'from'),
 
  328                        $a_query[
'lom_density_start'],
 
  329                        'query[' . 
'lom_density_start' . 
']',
 
  330                        array(0 => $this->lng->txt(
'search_any'))
 
  332                    $this->lng->txt(
'until'),
 
  334                        $a_query[
'lom_density_end'],
 
  335                        'query[' . 
'lom_density_end' . 
']',
 
  336                        array(0 => $this->lng->txt(
'search_any'))
 
  339                $range->setHTML(
$html);
 
  343            case 'lom_user_role':
 
  344                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  345                $select->setValue($a_query[
'lom_user_role']);
 
  349                    array(0 => $this->lng->txt(
'search_any')),
 
  355                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  356                $select->setValue($a_query[
'lom_context']);
 
  360                    array(0 => $this->lng->txt(
'search_any')),
 
  365            case 'lom_difficulty':
 
  368                    $this->lng->txt(
'from'),
 
  370                        $a_query[
'lom_difficulty_start'],
 
  371                        'query[' . 
'lom_difficulty_start' . 
']',
 
  372                        array(0 => $this->lng->txt(
'search_any'))
 
  374                    $this->lng->txt(
'until'),
 
  376                        $a_query[
'lom_difficulty_end'],
 
  377                        'query[' . 
'lom_difficulty_end' . 
']',
 
  378                        array(0 => $this->lng->txt(
'search_any'))
 
  381                $range->setHTML(
$html);
 
  386                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  387                $select->setValue($a_query[
'lom_costs']);
 
  391                    array(0 => $this->lng->txt(
'search_any')),
 
  396            case 'lom_copyright':
 
  397                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  398                $select->setValue($a_query[
'lom_copyright']);
 
  402                    array(0 => $this->lng->txt(
'search_any')),
 
  411                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  412                $select->setValue($a_query[
'lom_purpose']);
 
  416                    array(0 => $this->lng->txt(
'search_any')),
 
  423                $text->setSubmitFormOnEnter(
true);
 
  424                $text->setValue($a_query[
'lom_taxon']);
 
  426                $text->setMaxLength(255);
 
  430                if (substr($a_field_name, 0, 3) != 
'adv') {
 
  435                $field_id = substr($a_field_name, 4);
 
  436                include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  439                $field_form = 
ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), 
true, 
false);
 
  440                $field_form->setForm($a_form);
 
  441                $field_form->setElementId($a_post_name);
 
  442                $field_form->setTitle($this->active_fields[$a_field_name]);
 
  443                $field_form->addToForm();
 
  446                if (is_array($a_query) &&
 
  447                    array_key_exists($a_field_name, $a_query)) {
 
  448                    $field_form->importFromPost($a_query);
 
  449                    $field_form->validate();
 
  468            case 'general_offline':
 
  482                return 'lomLanguage:' . $a_query;
 
  485                return 'lomKeyword:' . $a_query;
 
  488                return 'lomCoverage:' . $a_query;
 
  490            case 'lom_structure':
 
  491                return 'lomStructure:' . $a_query;
 
  495                return 'lomStatus:' . $a_query;
 
  498                return 'lomVersion:' . $a_query;
 
  502                return 'lomRole:' . $a_query;
 
  504            case 'lom_role_entry':
 
  505                return 'lomRoleEntity:' . $a_query;
 
  510                return 'lomFormat:' . $a_query;
 
  512            case 'lom_operating_system':
 
  513                return 'lomOS:' . $a_query;
 
  516                return 'lomBrowser:' . $a_query;
 
  519            case 'lom_interactivity':
 
  520                return 'lomInteractivity:' . $a_query;
 
  523                return 'lomResource:' . $a_query;
 
  525            case 'lom_level_start':
 
  527                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  530                    if (strlen($q_string)) {
 
  533                    $q_string .= (
'lomLevel:"' . 
$options[
$i] . 
'" ');
 
  537            case 'lom_level_end':
 
  539                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  541                for (
$i = 1; 
$i <= $a_query; 
$i++) {
 
  542                    if (strlen($q_string)) {
 
  545                    $q_string .= (
'lomLevel:"' . 
$options[
$i] . 
'" ');
 
  549            case 'lom_density_start':
 
  551                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  554                    if (strlen($q_string)) {
 
  557                    $q_string .= (
'lomDensity:"' . 
$options[
$i] . 
'" ');
 
  561            case 'lom_density_end':
 
  563                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  565                for (
$i = 1; 
$i <= $a_query; 
$i++) {
 
  566                    if (strlen($q_string)) {
 
  569                    $q_string .= (
'lomDensity:"' . 
$options[
$i] . 
'" ');
 
  573            case 'lom_user_role':
 
  574                return 'lomUserRole:' . $a_query;
 
  577                return 'lomContext:' . $a_query;
 
  579            case 'lom_difficulty_start':
 
  581                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  584                    if (strlen($q_string)) {
 
  587                    $q_string .= (
'lomDifficulty:"' . 
$options[
$i] . 
'" ');
 
  591            case 'lom_difficulty_end':
 
  593                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  595                for (
$i = 1; 
$i <= $a_query; 
$i++) {
 
  596                    if (strlen($q_string)) {
 
  599                    $q_string .= (
'lomDifficulty:"' . 
$options[
$i] . 
'" ');
 
  605                return 'lomCosts:' . $a_query;
 
  607            case 'lom_copyright':
 
  608                return 'lomCopyright:' . $a_query;
 
  612                return 'lomPurpose:' . $a_query;
 
  615                return 'lomTaxon:' . $a_query;
 
  618                if (substr($a_field, 0, 3) != 
'adv') {
 
  623                $field_id = substr($a_field, 4);
 
  624                include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  628                } 
catch (Exception $ex) {
 
  632                $adv_query = $field->getLuceneSearchString($a_query);
 
  635                    if (!is_array($adv_query)) {
 
  636                        return 'advancedMetaData_' . $field_id . 
': ' . $adv_query;
 
  639                        foreach ($adv_query as $adv_query_item) {
 
  640                            $res[] = 
'advancedMetaData_' . $field_id . 
': ' . $adv_query_item;
 
  642                        return '(' . implode(
' OR ', 
$res) . 
')';
 
  654        foreach (self::getFields() as 
$name => $translation) {
 
  656                $this->active_fields[
$name] = $translation;
 
  667            switch ($field_name) {
 
  670                    $this->active_sections[
'default'][
'fields'][] = 
'lom_content';
 
  671                    $this->active_sections[
'default'][
'name'] = 
'';
 
  674                case 'general_offline':
 
  675                    $this->active_sections[
'default'][
'fields'][] = 
'general_offline';
 
  676                    $this->active_sections[
'default'][
'name'] = 
'';
 
  680                    $this->active_sections[
'default'][
'fields'][] = 
'lom_type';
 
  681                    $this->active_sections[
'default'][
'name'] = 
'';
 
  686                    $this->active_sections[
'general'][
'fields'][] = 
'lom_language';
 
  687                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  690                    $this->active_sections[
'general'][
'fields'][] = 
'lom_keyword';
 
  691                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  694                    $this->active_sections[
'general'][
'fields'][] = 
'lom_coverage';
 
  695                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  697                case 'lom_structure':
 
  698                    $this->active_sections[
'general'][
'fields'][] = 
'lom_structure';
 
  699                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  704                    $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_status';
 
  705                    $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  708                    $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_version';
 
  709                    $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  711                case 'lom_contribute':
 
  712                    $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_contribute';
 
  713                    $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  718                    $this->active_sections[
'technical'][
'fields'][] = 
'lom_format';
 
  719                    $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  721                case 'lom_operating_system':
 
  722                    $this->active_sections[
'technical'][
'fields'][] = 
'lom_operating_system';
 
  723                    $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  726                    $this->active_sections[
'technical'][
'fields'][] = 
'lom_browser';
 
  727                    $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  731                case 'lom_interactivity':
 
  732                    $this->active_sections[
'education'][
'fields'][] = 
'lom_interactivity';
 
  733                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  736                    $this->active_sections[
'education'][
'fields'][] = 
'lom_resource';
 
  737                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  740                    $this->active_sections[
'education'][
'fields'][] = 
'lom_level';
 
  741                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  744                    $this->active_sections[
'education'][
'fields'][] = 
'lom_density';
 
  745                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  747                case 'lom_user_role':
 
  748                    $this->active_sections[
'education'][
'fields'][] = 
'lom_user_role';
 
  749                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  752                    $this->active_sections[
'education'][
'fields'][] = 
'lom_context';
 
  753                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  755                case 'lom_difficulty':
 
  756                    $this->active_sections[
'education'][
'fields'][] = 
'lom_difficulty';
 
  757                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  762                    $this->active_sections[
'rights'][
'fields'][] = 
'lom_costs';
 
  763                    $this->active_sections[
'rights'][
'name'] = $this->lng->txt(
'meta_rights');
 
  765                case 'lom_copyright':
 
  766                    $this->active_sections[
'rights'][
'fields'][] = 
'lom_copyright';
 
  767                    $this->active_sections[
'rights'][
'name'] = $this->lng->txt(
'meta_rights');
 
  772                    $this->active_sections[
'classification'][
'fields'][] = 
'lom_purpose';
 
  773                    $this->active_sections[
'classification'][
'name'] = $this->lng->txt(
'meta_classification');
 
  776                    $this->active_sections[
'classification'][
'fields'][] = 
'lom_taxon';
 
  777                    $this->active_sections[
'classification'][
'name'] = $this->lng->txt(
'meta_classification');
 
  781                    if (substr($field_name, 0, 3) != 
'adv') {
 
  786                    $field_id = substr($field_name, 4);
 
  787                    include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  788                    include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
 
  790                    $record_id = $field->getRecordId();
 
  792                    $this->active_sections[
'adv_record_' . $record_id][
'fields'][] = $field_name;
 
  802    protected function getRangeSelect($txt_from, $select_from, $txt_until, $select_until)
 
  804        $tpl = 
new ilTemplate(
'tpl.range_search.html', 
true, 
true, 
'Services/Search');
 
  805        $tpl->setVariable(
'TXT_FROM', $txt_from);
 
  806        $tpl->setVariable(
'FROM', $select_from);
 
  807        $tpl->setVariable(
'TXT_UPTO', $txt_until);
 
  808        $tpl->setVariable(
'UPTO', $select_until);
 
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Get singleton.
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
static _lookupTitle($a_record_id)
Lookup title.
static _getRecords()
Get records.
static getLogger($a_component_id)
Get component logger.
Field definitions of advanced meta data search.
readSections()
Read active sections.
readFields()
Read active fields.
getFormElement($a_query, $a_field_name, ilPropertyFormGUI $a_form)
getActiveFields()
Get all active fields.
static getInstance()
Get singleton instance.
static getFields()
Return an array of all meta data fields.
getRangeSelect($txt_from, $select_from, $txt_until, $select_until)
get a range selection
parseFieldQuery($a_field, $a_query)
Called from ilLuceneAdvancedQueryParser Parse a field specific query.
static _getInteractivityTypeSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational interactivity type All possible entries in meta_format are shown.
static _getInteractivityLevelSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational interactivity level All possible entries in meta_format are shown.
static _getCopyrightAndOtherRestrictionsSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta rights copyright and other restrictions All possible entries in meta_format are shown.
static _getOperatingSystemSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta technical os selector.
static _getStatusSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta lifecycle status selector.
static _getCostsSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta rights costs All possible entries in meta_format are shown.
static _getPurposeSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta rights copyright and other restrictions All possible entries in meta_format are shown.
static _getLearningResourceTypeSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational learning resource type All possible entries in meta_format are shown.
static _getBrowserSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta technical browser selector.
static _getFormatSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta technical format selector All possible entries in meta_format are shown.
static _getLanguageSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta data language selector.
static _getStructureSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta general structure selector.
static _getContextSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta context.
static _getSemanticDensitySelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational semantic density All possible entries in meta_format are shown.
static _getIntendedEndUserRoleSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational intended end user role All possible entries in meta_format are shown.
static _getRoleSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta lifecycle status selector.
static _getDifficultySelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational difficulty All possible entries in meta_format are shown.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
foreach($_POST as $key=> $value) $res