25 include_once 
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
 
   57                 $this->lng->loadLanguageModule(
'meta');
 
   68                 if(isset(self::$instance) and self::$instance)
 
   82                 $lng->loadLanguageModule(
'meta');
 
   85                         'lom_content'                           => $lng->txt(
'content'),
 
   87                         'lom_language'                          => $lng->txt(
'language'),
 
   88                         'lom_keyword'                           => $lng->txt(
'meta_keyword'),   
 
   89                         'lom_coverage'                          => $lng->txt(
'meta_coverage'),  
 
   90                         'lom_structure'                         => $lng->txt(
'meta_structure'), 
 
   91                         'lom_status'                            => $lng->txt(
'meta_status'),    
 
   92                         'lom_version'                           => $lng->txt(
'meta_version'),   
 
   93                         'lom_contribute'                        => $lng->txt(
'meta_contribute'),        
 
   94                         'lom_format'                            => $lng->txt(
'meta_format'),    
 
   95                         'lom_operating_system'          => $lng->txt(
'meta_operating_system'),  
 
   96                         'lom_browser'                           => $lng->txt(
'meta_browser'),   
 
   97                         'lom_interactivity'                     => $lng->txt(
'meta_interactivity_type'),        
 
   98                         'lom_resource'                          => $lng->txt(
'meta_learning_resource_type'),    
 
   99                         'lom_level'                                     => $lng->txt(
'meta_interactivity_level'),       
 
  100                         'lom_density'                           => $lng->txt(
'meta_semantic_density'),  
 
  101                         'lom_user_role'                         => $lng->txt(
'meta_intended_end_user_role'),    
 
  102                         'lom_context'                           => $lng->txt(
'meta_context'),   
 
  103                         'lom_difficulty'                        => $lng->txt(
'meta_difficulty'),        
 
  104                         'lom_costs'                                     => $lng->txt(
'meta_cost'),      
 
  105                         'lom_copyright'                         => $lng->txt(
'meta_copyright_and_other_restrictions'),  
 
  106                         'lom_purpose'                           => $lng->txt(
'meta_purpose'),   
 
  107                         'lom_taxon'                                     => $lng->txt(
'meta_taxon')
 
  111                 include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
 
  112                 include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  117                                 if($def->isSearchable())
 
  119                                         $fields[
'adv_'.$def->getFieldId()] = $def->getTitle();
 
  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.
']';
 
  145                 switch($a_field_name)
 
  148                                 $text = 
new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  149                                 $text->setSubmitFormOnEnter(
true);
 
  150                                 $text->setValue($a_query[
'lom_content']);
 
  152                                 $text->setMaxLength(255);
 
  157                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  158                                 $select->setValue($a_query[
'lom_language']);
 
  162                                         array(0 => $this->lng->txt(
'search_any')),
 
  167                                 $text = 
new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  168                                 $text->setSubmitFormOnEnter(
true);
 
  169                                 $text->setValue($a_query[
'lom_keyword']);
 
  171                                 $text->setMaxLength(255);
 
  175                                 $text = 
new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  176                                 $text->setSubmitFormOnEnter(
true);
 
  177                                 $text->setValue($a_query[
'lom_coverage']);
 
  179                                 $text->setMaxLength(255);
 
  182                         case 'lom_structure':
 
  183                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  184                                 $select->setValue($a_query[
'lom_structure']);
 
  188                                         array(0 => $this->lng->txt(
'search_any')),
 
  194                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  195                                 $select->setValue($a_query[
'lom_status']);
 
  199                                         array(0 => $this->lng->txt(
'search_any')),
 
  204                                 $text = 
new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  205                                 $text->setSubmitFormOnEnter(
true);
 
  206                                 $text->setValue($a_query[
'lom_version']);
 
  208                                 $text->setMaxLength(255);
 
  211                         case 'lom_contribute':
 
  212                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],
'query['.
'lom_role'.
']');
 
  213                                 $select->setValue($a_query[
'lom_role']);
 
  217                                         array(0 => $this->lng->txt(
'search_any')),
 
  220                                         $text = 
new ilTextInputGUI($this->lng->txt(
'meta_entry'),
'query['.
'lom_role_entry'.
']');
 
  221                                         $text->
setValue($a_query[
'lom_role_entry']);
 
  223                                         $text->setMaxLength(255);
 
  225                                 $select->addSubItem($text);
 
  230                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  231                                 $select->setValue($a_query[
'lom_format']);
 
  235                                         array(0 => $this->lng->txt(
'search_any')),
 
  239                         case 'lom_operating_system':
 
  240                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  241                                 $select->setValue($a_query[
'lom_operating_system']);
 
  245                                         array(0 => $this->lng->txt(
'search_any')),
 
  250                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  251                                 $select->setValue($a_query[
'lom_browser']);
 
  255                                         array(0 => $this->lng->txt(
'search_any')),
 
  260                         case 'lom_interactivity':
 
  261                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  262                                 $select->setValue($a_query[
'lom_interactivity']);
 
  266                                         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_resource']);
 
  276                                         array(0 => $this->lng->txt(
'search_any')),
 
  283                                         $this->lng->txt(
'from'),
 
  285                                                 $a_query[
'lom_level_start'],
 
  286                                                 'query['.
'lom_level_start'.
']',
 
  287                                                 array(0 => $this->lng->txt(
'search_any'))),
 
  288                                         $this->lng->txt(
'until'),
 
  290                                                 $a_query[
'lom_level_end'],
 
  291                                                 'query['.
'lom_level_end'.
']',
 
  292                                                 array(0 => $this->lng->txt(
'search_any')))
 
  294                                 $range->setHTML($html);
 
  300                                         $this->lng->txt(
'from'),
 
  302                                                 $a_query[
'lom_density_start'],
 
  303                                                 'query['.
'lom_density_start'.
']',
 
  304                                                 array(0 => $this->lng->txt(
'search_any'))),
 
  305                                         $this->lng->txt(
'until'),
 
  307                                                 $a_query[
'lom_density_end'],
 
  308                                                 'query['.
'lom_density_end'.
']',
 
  309                                                 array(0 => $this->lng->txt(
'search_any')))
 
  311                                 $range->setHTML($html);
 
  315                         case 'lom_user_role':
 
  316                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  317                                 $select->setValue($a_query[
'lom_user_role']);
 
  321                                         array(0 => $this->lng->txt(
'search_any')),
 
  326                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  327                                 $select->setValue($a_query[
'lom_context']);
 
  331                                         array(0 => $this->lng->txt(
'search_any')),
 
  335                         case 'lom_difficulty':
 
  338                                         $this->lng->txt(
'from'),
 
  340                                                 $a_query[
'lom_difficulty_start'],
 
  341                                                 'query['.
'lom_difficulty_start'.
']',
 
  342                                                 array(0 => $this->lng->txt(
'search_any'))),
 
  343                                         $this->lng->txt(
'until'),
 
  345                                                 $a_query[
'lom_difficulty_end'],
 
  346                                                 'query['.
'lom_difficulty_end'.
']',
 
  347                                                 array(0 => $this->lng->txt(
'search_any')))
 
  349                                 $range->setHTML($html);
 
  354                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  355                                 $select->setValue($a_query[
'lom_costs']);
 
  359                                         array(0 => $this->lng->txt(
'search_any')),
 
  363                         case 'lom_copyright':
 
  364                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  365                                 $select->setValue($a_query[
'lom_copyright']);
 
  369                                         array(0 => $this->lng->txt(
'search_any')),
 
  377                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  378                                 $select->setValue($a_query[
'lom_purpose']);
 
  382                                         array(0 => $this->lng->txt(
'search_any')),
 
  387                                 $text = 
new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  388                                 $text->setSubmitFormOnEnter(
true);
 
  389                                 $text->setValue($a_query[
'lom_taxon']);
 
  391                                 $text->setMaxLength(255);
 
  395                                 if(substr($a_field_name,0,3) != 
'adv')
 
  399                                 $field_id = substr($a_field_name,4);
 
  400                                 include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  403                                 switch($field->getFieldType())
 
  406                                                 $text = 
new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  407                                                 $text->setSubmitFormOnEnter(
true);
 
  408                                                 $text->setValue($a_query[$a_field_name]);
 
  410                                                 $text->setMaxLength(255);
 
  414                                                 $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
 
  415                                                 $select->setValue($a_query[$a_field_name]);
 
  416                                                 $select->setOptions($field->getFieldValuesForSearch());
 
  424                                                 $check->setChecked($a_query[$a_field_name]);
 
  429                                                 $check->addSubItem($time);
 
  434                                                 $check->addSubItem($time);
 
  455                                 return 'lomLanguage:'.$a_query;
 
  458                                 return 'lomKeyword:'.$a_query;
 
  461                                 return 'lomCoverage:'.$a_query;
 
  463                         case 'lom_structure':
 
  464                                 return 'lomStructure:'.$a_query;
 
  468                                 return 'lomStatus:'.$a_query;
 
  471                                 return 'lomVersion:'.$a_query;
 
  475                                 return 'lomRole:'.$a_query;
 
  477                         case 'lom_role_entry':
 
  478                                 return 'lomRoleEntity:'.$a_query;
 
  483                                 return 'lomFormat:'.$a_query;
 
  485                         case 'lom_operating_system':
 
  486                                 return 'lomOS:'.$a_query;
 
  489                                 return 'lomBrowser:'.$a_query;
 
  492                         case 'lom_interactivity':
 
  493                                 return 'lomInteractivity:'.$a_query;
 
  496                                 return 'lomResource:'.$a_query;
 
  498                         case 'lom_level_start':
 
  500                                 include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  502                                 for($i = $a_query; $i <= count($options); $i++)
 
  504                                         if(strlen($q_string))
 
  508                                         $q_string .= (
'lomLevel:"'.$options[$i].
'" ');                                          
 
  512                         case 'lom_level_end':
 
  514                                 include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  516                                 for($i = 1; $i <= $a_query; $i++)
 
  518                                         if(strlen($q_string))
 
  522                                         $q_string .= (
'lomLevel:"'.$options[$i].
'" ');                                          
 
  526                         case 'lom_density_start':
 
  528                                 include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  530                                 for($i = $a_query; $i <= count($options); $i++)
 
  532                                         if(strlen($q_string))
 
  536                                         $q_string .= (
'lomDensity:"'.$options[$i].
'" ');                                                
 
  540                         case 'lom_density_end':
 
  542                                 include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  544                                 for($i = 1; $i <= $a_query; $i++)
 
  546                                         if(strlen($q_string))
 
  550                                         $q_string .= (
'lomDensity:"'.$options[$i].
'" ');
 
  554                         case 'lom_user_role':
 
  555                                 return 'lomUserRole:'.$a_query;
 
  558                                 return 'lomContext:'.$a_query;
 
  560                         case 'lom_difficulty_start':
 
  562                                 include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  564                                 for($i = $a_query; $i <= count($options); $i++)
 
  566                                         if(strlen($q_string))
 
  570                                         $q_string .= (
'lomDifficulty:"'.$options[$i].
'" ');                                             
 
  574                         case 'lom_difficulty_end':
 
  576                                 include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  578                                 for($i = 1; $i <= $a_query; $i++)
 
  580                                         if(strlen($q_string))
 
  584                                         $q_string .= (
'lomDifficulty:"'.$options[$i].
'" ');
 
  590                                 return 'lomCosts:'.$a_query;
 
  592                         case 'lom_copyright':
 
  593                                 return 'lomCopyright:'.$a_query;
 
  597                                 return 'lomPurpose:'.$a_query;
 
  600                                 return 'lomTaxon:'.$a_query;
 
  603                                 if(substr($a_field,0,3) != 
'adv')
 
  607                                 $field_id = substr($a_field,4);
 
  608                                 include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  611                                 switch($field->getFieldType())
 
  615                                                 return 'advancedMetaData_'.$field_id.
':'.$a_query;
 
  619                                                 $value = 
$_POST[
'adv_'.$field_id.
'_start'];
 
  620                                                 $dt[
'year'] = (int) $value[
'date'][
'y'];
 
  621                                                 $dt[
'mon'] = (int) $value[
'date'][
'm'];
 
  622                                                 $dt[
'mday'] = (int) $value[
'date'][
'd'];
 
  623                                                 $dt[
'hours'] = (int) 0;
 
  624                                                 $dt[
'minutes'] = (int) 0;
 
  625                                                 $dt[
'seconds'] = (int) 0;
 
  629                                                 $value = 
$_POST[
'adv_'.$field_id.
'_end'];
 
  630                                                 $dt[
'year'] = (int) $value[
'date'][
'y'];
 
  631                                                 $dt[
'mon'] = (int) $value[
'date'][
'm'];
 
  632                                                 $dt[
'mday'] = (int) $value[
'date'][
'd'];
 
  633                                                 $dt[
'hours'] = (int) 0;
 
  634                                                 $dt[
'minutes'] = (int) 0;
 
  635                                                 $dt[
'seconds'] = (int) 0;
 
  639                                                 return 'advancedMetaData_'.$field_id.
':{'.$ustart.
' TO '.$uend.
'}';
 
  643                                                 $value = 
$_POST[
'adv_'.$field_id.
'_start'];
 
  644                                                 $dt[
'year'] = (int) $value[
'date'][
'y'];
 
  645                                                 $dt[
'mon'] = (int) $value[
'date'][
'm'];
 
  646                                                 $dt[
'mday'] = (int) $value[
'date'][
'd'];
 
  647                                                 $dt[
'hours'] = (int) $value[
'time'][
'h'];
 
  648                                                 $dt[
'minutes'] = (int) $value[
'time'][
'm'];
 
  649                                                 $dt[
'seconds'] = (int) 0;
 
  653                                                 $value = 
$_POST[
'adv_'.$field_id.
'_end'];
 
  654                                                 $dt[
'year'] = (int) $value[
'date'][
'y'];
 
  655                                                 $dt[
'mon'] = (int) $value[
'date'][
'm'];
 
  656                                                 $dt[
'mday'] = (int) $value[
'date'][
'd'];
 
  657                                                 $dt[
'hours'] = (int) $value[
'time'][
'h'];
 
  658                                                 $dt[
'minutes'] = (int) $value[
'time'][
'm'];
 
  659                                                 $dt[
'seconds'] = (int) 0;
 
  663                                                 return 'advancedMetaData_'.$field_id.
':{'.$ustart.
' TO '.$uend.
'}';
 
  677                 foreach(self::getFields() as $name => $translation)
 
  679                         if($this->settings->isActive($name))
 
  681                                 $this->active_fields[$name] = $translation;
 
  697                                         $this->active_sections[
'default'][
'fields'][] = 
'lom_content';
 
  698                                         $this->active_sections[
'default'][
'name'] = 
'';
 
  701                                         $this->active_sections[
'default'][
'fields'][] = 
'lom_type';
 
  702                                         $this->active_sections[
'default'][
'name'] = 
'';
 
  707                                         $this->active_sections[
'general'][
'fields'][] = 
'lom_language';
 
  708                                         $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  711                                         $this->active_sections[
'general'][
'fields'][] = 
'lom_keyword';
 
  712                                         $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  715                                         $this->active_sections[
'general'][
'fields'][] = 
'lom_coverage';
 
  716                                         $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  718                                 case 'lom_structure':
 
  719                                         $this->active_sections[
'general'][
'fields'][] = 
'lom_structure';
 
  720                                         $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  725                                         $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_status';
 
  726                                         $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  729                                         $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_version';
 
  730                                         $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  732                                 case 'lom_contribute':
 
  733                                         $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_contribute';
 
  734                                         $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  739                                         $this->active_sections[
'technical'][
'fields'][] = 
'lom_format';
 
  740                                         $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  742                                 case 'lom_operating_system':
 
  743                                         $this->active_sections[
'technical'][
'fields'][] = 
'lom_operating_system';
 
  744                                         $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  747                                         $this->active_sections[
'technical'][
'fields'][] = 
'lom_browser';
 
  748                                         $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  752                                 case 'lom_interactivity':
 
  753                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_interactivity';
 
  754                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  757                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_resource';
 
  758                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  761                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_level';
 
  762                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  765                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_density';
 
  766                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  768                                 case 'lom_user_role':
 
  769                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_user_role';
 
  770                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  773                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_context';
 
  774                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  776                                 case 'lom_difficulty':
 
  777                                         $this->active_sections[
'education'][
'fields'][] = 
'lom_difficulty';
 
  778                                         $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  783                                         $this->active_sections[
'rights'][
'fields'][] = 
'lom_costs';
 
  784                                         $this->active_sections[
'rights'][
'name'] = $this->lng->txt(
'meta_rights');
 
  786                                 case 'lom_copyright':
 
  787                                         $this->active_sections[
'rights'][
'fields'][] = 
'lom_copyright';
 
  788                                         $this->active_sections[
'rights'][
'name'] = $this->lng->txt(
'meta_rights');
 
  793                                         $this->active_sections[
'classification'][
'fields'][] = 
'lom_purpose';
 
  794                                         $this->active_sections[
'classification'][
'name'] = $this->lng->txt(
'meta_classification');
 
  797                                         $this->active_sections[
'classification'][
'fields'][] = 
'lom_taxon';
 
  798                                         $this->active_sections[
'classification'][
'name'] = $this->lng->txt(
'meta_classification');
 
  802                                         if(substr($field_name,0,3) != 
'adv')
 
  806                                         $field_id = substr($field_name,4);
 
  807                                         include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  808                                         include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
 
  810                                         $record_id = $field->getRecordId();
 
  812                                         $this->active_sections[
'adv_record_'.$record_id][
'fields'][] = $field_name;
 
  822         protected function getRangeSelect($txt_from,$select_from,$txt_until,$select_until)
 
  824                 $tpl = 
new ilTemplate(
'tpl.range_search.html',
true,
true,
'Services/Search');
 
  825                 $tpl->setVariable(
'TXT_FROM',$txt_from);
 
  826                 $tpl->setVariable(
'FROM',$select_from);
 
  827                 $tpl->setVariable(
'TXT_UPTO',$txt_until);
 
  828                 $tpl->setVariable(
'UPTO',$select_until);