ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLuceneAdvancedSearchFields.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
25 include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
26 
37 {
38  private static $instance = null;
39  private $settings = null;
40 
41  protected $lng = null;
42 
43  private static $fields = null;
44  private $active_fields = array();
45 
46  private static $sections = null;
47  private $active_sections = array();
48 
49 
50  protected function __construct()
51  {
52  global $lng;
53 
55 
56  $this->lng = $lng;
57  $this->lng->loadLanguageModule('meta');
58 
59  $this->readFields();
60  $this->readSections();
61  }
62 
66  public static function getInstance()
67  {
68  if(isset(self::$instance) and self::$instance)
69  {
70  return self::$instance;
71  }
72  return self::$instance = new ilLuceneAdvancedSearchFields();
73  }
74 
78  public static function getFields()
79  {
80  global $lng;
81 
82  $lng->loadLanguageModule('meta');
83 
84  $fields = array(
85  'lom_content' => $lng->txt('content'),
86  //'lom_type' => $lng->txt('type'),
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')
108  );
109 
110  // Append all advanced meta data fields
111  include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
112  include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
113  foreach(ilAdvancedMDRecord::_getRecords() as $record)
114  {
115  foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $def)
116  {
117  if($def->isSearchable())
118  {
119  $fields['adv_'.$def->getFieldId()] = $def->getTitle();
120  }
121  }
122  }
123  return $fields;
124  }
125 
129  public function getActiveFields()
130  {
131  return $this->active_fields ? $this->active_fields : array();
132  }
133 
134  public function getActiveSections()
135  {
136  return $this->active_sections ? $this->active_sections : array();
137  }
138 
139  public function getFormElement($a_query,$a_field_name)
140  {
141  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
142 
143  $a_post_name = 'query['.$a_field_name.']';
144 
145  switch($a_field_name)
146  {
147  case 'lom_content':
148  $text = new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
149  $text->setSubmitFormOnEnter(true);
150  $text->setValue($a_query['lom_content']);
151  $text->setSize(30);
152  $text->setMaxLength(255);
153  return $text;
154 
155  // General
156  case 'lom_language':
157  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
158  $select->setValue($a_query['lom_language']);
159  $select->setOptions(ilMDUtilSelect::_getLanguageSelect(
160  '',
161  $a_field_name,
162  array(0 => $this->lng->txt('search_any')),
163  true));
164  return $select;
165 
166  case 'lom_keyword':
167  $text = new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
168  $text->setSubmitFormOnEnter(true);
169  $text->setValue($a_query['lom_keyword']);
170  $text->setSize(30);
171  $text->setMaxLength(255);
172  return $text;
173 
174  case 'lom_coverage':
175  $text = new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
176  $text->setSubmitFormOnEnter(true);
177  $text->setValue($a_query['lom_coverage']);
178  $text->setSize(30);
179  $text->setMaxLength(255);
180  return $text;
181 
182  case 'lom_structure':
183  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
184  $select->setValue($a_query['lom_structure']);
185  $select->setOptions(ilMDUtilSelect::_getStructureSelect(
186  '',
187  $a_field_name,
188  array(0 => $this->lng->txt('search_any')),
189  true));
190  return $select;
191 
192  // Lifecycle
193  case 'lom_status':
194  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
195  $select->setValue($a_query['lom_status']);
196  $select->setOptions(ilMDUtilSelect::_getStatusSelect(
197  '',
198  $a_field_name,
199  array(0 => $this->lng->txt('search_any')),
200  true));
201  return $select;
202 
203  case 'lom_version':
204  $text = new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
205  $text->setSubmitFormOnEnter(true);
206  $text->setValue($a_query['lom_version']);
207  $text->setSize(30);
208  $text->setMaxLength(255);
209  return $text;
210 
211  case 'lom_contribute':
212  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],'query['.'lom_role'.']');
213  $select->setValue($a_query['lom_role']);
214  $select->setOptions(ilMDUtilSelect::_getRoleSelect(
215  '',
216  $a_field_name,
217  array(0 => $this->lng->txt('search_any')),
218  true));
219 
220  $text = new ilTextInputGUI($this->lng->txt('meta_entry'),'query['.'lom_role_entry'.']');
221  $text->setValue($a_query['lom_role_entry']);
222  $text->setSize(30);
223  $text->setMaxLength(255);
224 
225  $select->addSubItem($text);
226  return $select;
227 
228  // Technical
229  case 'lom_format':
230  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
231  $select->setValue($a_query['lom_format']);
232  $select->setOptions(ilMDUtilSelect::_getFormatSelect(
233  '',
234  $a_field_name,
235  array(0 => $this->lng->txt('search_any')),
236  true));
237  return $select;
238 
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']);
242  $select->setOptions(ilMDUtilSelect::_getOperatingSystemSelect(
243  '',
244  $a_field_name,
245  array(0 => $this->lng->txt('search_any')),
246  true));
247  return $select;
248 
249  case 'lom_browser':
250  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
251  $select->setValue($a_query['lom_browser']);
252  $select->setOptions(ilMDUtilSelect::_getBrowserSelect(
253  '',
254  $a_field_name,
255  array(0 => $this->lng->txt('search_any')),
256  true));
257  return $select;
258 
259  // Education
260  case 'lom_interactivity':
261  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
262  $select->setValue($a_query['lom_interactivity']);
264  '',
265  $a_field_name,
266  array(0 => $this->lng->txt('search_any')),
267  true));
268  return $select;
269 
270  case 'lom_resource':
271  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
272  $select->setValue($a_query['lom_resource']);
274  '',
275  $a_field_name,
276  array(0 => $this->lng->txt('search_any')),
277  true));
278  return $select;
279 
280  case 'lom_level':
281  $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
282  $html = $this->getRangeSelect(
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')))
293  );
294  $range->setHTML($html);
295  return $range;
296 
297  case 'lom_density':
298  $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
299  $html = $this->getRangeSelect(
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')))
310  );
311  $range->setHTML($html);
312  return $range;
313 
314 
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']);
319  '',
320  $a_field_name,
321  array(0 => $this->lng->txt('search_any')),
322  true));
323  return $select;
324 
325  case 'lom_context':
326  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
327  $select->setValue($a_query['lom_context']);
328  $select->setOptions(ilMDUtilSelect::_getContextSelect(
329  '',
330  $a_field_name,
331  array(0 => $this->lng->txt('search_any')),
332  true));
333  return $select;
334 
335  case 'lom_difficulty':
336  $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
337  $html = $this->getRangeSelect(
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')))
348  );
349  $range->setHTML($html);
350  return $range;
351 
352  // Rights
353  case 'lom_costs':
354  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
355  $select->setValue($a_query['lom_costs']);
356  $select->setOptions(ilMDUtilSelect::_getCostsSelect(
357  '',
358  $a_field_name,
359  array(0 => $this->lng->txt('search_any')),
360  true));
361  return $select;
362 
363  case 'lom_copyright':
364  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
365  $select->setValue($a_query['lom_copyright']);
367  '',
368  $a_field_name,
369  array(0 => $this->lng->txt('search_any')),
370  true));
371  return $select;
372 
373 
374 
375  // Classification
376  case 'lom_purpose':
377  $select = new ilSelectInputGUI($this->active_fields[$a_field_name],$a_post_name);
378  $select->setValue($a_query['lom_purpose']);
379  $select->setOptions(ilMDUtilSelect::_getPurposeSelect(
380  '',
381  $a_field_name,
382  array(0 => $this->lng->txt('search_any')),
383  true));
384  return $select;
385 
386  case 'lom_taxon':
387  $text = new ilTextInputGUI($this->active_fields[$a_field_name],$a_post_name);
388  $text->setSubmitFormOnEnter(true);
389  $text->setValue($a_query['lom_taxon']);
390  $text->setSize(30);
391  $text->setMaxLength(255);
392  return $text;
393 
394  default:
395  if(substr($a_field_name,0,3) != 'adv')
396  break;
397 
398  // Advanced meta data
399  $field_id = substr($a_field_name,4);
400  include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
402 
403  switch($field->getFieldType())
404  {
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]);
409  $text->setSize(30);
410  $text->setMaxLength(255);
411  return $text;
412 
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());
417  return $select;
418 
421 
422  $check = new ilCheckboxInputGUI($this->active_fields[$a_field_name],$a_post_name);
423  $check->setValue(1);
424  $check->setChecked($a_query[$a_field_name]);
425 
426  $time = new ilDateTimeInputGUI($this->lng->txt('from'),$a_field_name.'_start');
427  $time->setShowTime($field->getFieldType() != ilAdvancedMDFieldDefinition::TYPE_DATE);
428  $time->setDate(new ilDateTime(mktime(8,0,0,date('m'),date('d'),date('Y')),IL_CAL_UNIX));
429  $check->addSubItem($time);
430 
431  $time = new ilDateTimeInputGUI($this->lng->txt('until'),$a_field_name.'_end');
432  $time->setShowTime($field->getFieldType() != ilAdvancedMDFieldDefinition::TYPE_DATE);
433  $time->setDate(new ilDateTime(mktime(16,0,0,date('m'),date('d'),date('Y')),IL_CAL_UNIX));
434  $check->addSubItem($time);
435  return $check;
436  }
437  }
438  return null;
439  }
440 
441 
446  public function parseFieldQuery($a_field,$a_query)
447  {
448  switch($a_field)
449  {
450  case 'lom_content':
451  return $a_query;
452 
453  // General
454  case 'lom_language':
455  return 'lomLanguage:'.$a_query;
456 
457  case 'lom_keyword':
458  return 'lomKeyword:'.$a_query;
459 
460  case 'lom_coverage':
461  return 'lomCoverage:'.$a_query;
462 
463  case 'lom_structure':
464  return 'lomStructure:'.$a_query;
465 
466  // Lifecycle
467  case 'lom_status':
468  return 'lomStatus:'.$a_query;
469 
470  case 'lom_version':
471  return 'lomVersion:'.$a_query;
472 
473  // Begin Contribute
474  case 'lom_role':
475  return 'lomRole:'.$a_query;
476 
477  case 'lom_role_entry':
478  return 'lomRoleEntity:'.$a_query;
479  // End contribute
480 
481  // Technical
482  case 'lom_format':
483  return 'lomFormat:'.$a_query;
484 
485  case 'lom_operating_system':
486  return 'lomOS:'.$a_query;
487 
488  case 'lom_browser':
489  return 'lomBrowser:'.$a_query;
490 
491  // Educational
492  case 'lom_interactivity':
493  return 'lomInteractivity:'.$a_query;
494 
495  case 'lom_resource':
496  return 'lomResource:'.$a_query;
497 
498  case 'lom_level_start':
499  $q_string = '';
500  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
501  $options = ilMDUtilSelect::_getInteractivityLevelSelect(0,'lom_level',array(),true);
502  for($i = $a_query; $i <= count($options); $i++)
503  {
504  if(strlen($q_string))
505  {
506  $q_string .= 'OR ';
507  }
508  $q_string .= ('lomLevel:"'.$options[$i].'" ');
509  }
510  return $q_string;
511 
512  case 'lom_level_end':
513  $q_string = '';
514  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
515  $options = ilMDUtilSelect::_getInteractivityLevelSelect(0,'lom_level',array(),true);
516  for($i = 1; $i <= $a_query; $i++)
517  {
518  if(strlen($q_string))
519  {
520  $q_string .= 'OR ';
521  }
522  $q_string .= ('lomLevel:"'.$options[$i].'" ');
523  }
524  return $q_string;
525 
526  case 'lom_density_start':
527  $q_string = '';
528  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
529  $options = ilMDUtilSelect::_getSemanticDensitySelect(0,'lom_density',array(),true);
530  for($i = $a_query; $i <= count($options); $i++)
531  {
532  if(strlen($q_string))
533  {
534  $q_string .= 'OR ';
535  }
536  $q_string .= ('lomDensity:"'.$options[$i].'" ');
537  }
538  return $q_string;
539 
540  case 'lom_density_end':
541  $q_string = '';
542  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
543  $options = ilMDUtilSelect::_getSemanticDensitySelect(0,'lom_density',array(),true);
544  for($i = 1; $i <= $a_query; $i++)
545  {
546  if(strlen($q_string))
547  {
548  $q_string .= 'OR ';
549  }
550  $q_string .= ('lomDensity:"'.$options[$i].'" ');
551  }
552  return $q_string;
553 
554  case 'lom_user_role':
555  return 'lomUserRole:'.$a_query;
556 
557  case 'lom_context':
558  return 'lomContext:'.$a_query;
559 
560  case 'lom_difficulty_start':
561  $q_string = '';
562  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
563  $options = ilMDUtilSelect::_getDifficultySelect(0,'lom_difficulty',array(),true);
564  for($i = $a_query; $i <= count($options); $i++)
565  {
566  if(strlen($q_string))
567  {
568  $q_string .= 'OR ';
569  }
570  $q_string .= ('lomDifficulty:"'.$options[$i].'" ');
571  }
572  return $q_string;
573 
574  case 'lom_difficulty_end':
575  $q_string = '';
576  include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
577  $options = ilMDUtilSelect::_getDifficultySelect(0,'lom_difficulty',array(),true);
578  for($i = 1; $i <= $a_query; $i++)
579  {
580  if(strlen($q_string))
581  {
582  $q_string .= 'OR ';
583  }
584  $q_string .= ('lomDifficulty:"'.$options[$i].'" ');
585  }
586  return $q_string;
587 
588  // Rights
589  case 'lom_costs':
590  return 'lomCosts:'.$a_query;
591 
592  case 'lom_copyright':
593  return 'lomCopyright:'.$a_query;
594 
595  // Classification
596  case 'lom_purpose':
597  return 'lomPurpose:'.$a_query;
598 
599  case 'lom_taxon':
600  return 'lomTaxon:'.$a_query;
601 
602  default:
603  if(substr($a_field,0,3) != 'adv')
604  break;
605 
606  // Advanced meta data
607  $field_id = substr($a_field,4);
608  include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
610 
611  switch($field->getFieldType())
612  {
615  return 'advancedMetaData_'.$field_id.':'.$a_query;
616 
618 
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;
626  $date = new ilDate($dt,IL_CAL_FKT_GETDATE);
627  $ustart = $date->get(IL_CAL_UNIX);
628 
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;
636  $date = new ilDate($dt,IL_CAL_FKT_GETDATE);
637  $uend = $date->get(IL_CAL_UNIX);
638 
639  return 'advancedMetaData_'.$field_id.':{'.$ustart.' TO '.$uend.'}';
640 
642 
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;
650  $date = new ilDateTime($dt,IL_CAL_FKT_GETDATE);
651  $ustart = $date->get(IL_CAL_UNIX);
652 
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;
660  $date = new ilDateTime($dt,IL_CAL_FKT_GETDATE);
661  $uend = $date->get(IL_CAL_UNIX);
662 
663  return 'advancedMetaData_'.$field_id.':{'.$ustart.' TO '.$uend.'}';
664 
665 
666  }
667  break;
668  }
669  }
670 
671 
675  protected function readFields()
676  {
677  foreach(self::getFields() as $name => $translation)
678  {
679  if($this->settings->isActive($name))
680  {
681  $this->active_fields[$name] = $translation;
682  }
683  }
684  }
685 
689  protected function readSections()
690  {
691  foreach($this->getActiveFields() as $field_name => $translation)
692  {
693  switch($field_name)
694  {
695  // Default section
696  case 'lom_content':
697  $this->active_sections['default']['fields'][] = 'lom_content';
698  $this->active_sections['default']['name'] = '';
699  break;
700  case 'lom_type':
701  $this->active_sections['default']['fields'][] = 'lom_type';
702  $this->active_sections['default']['name'] = '';
703  break;
704 
705  // General
706  case 'lom_language':
707  $this->active_sections['general']['fields'][] = 'lom_language';
708  $this->active_sections['general']['name'] = $this->lng->txt('meta_general');
709  break;
710  case 'lom_keyword':
711  $this->active_sections['general']['fields'][] = 'lom_keyword';
712  $this->active_sections['general']['name'] = $this->lng->txt('meta_general');
713  break;
714  case 'lom_coverage':
715  $this->active_sections['general']['fields'][] = 'lom_coverage';
716  $this->active_sections['general']['name'] = $this->lng->txt('meta_general');
717  break;
718  case 'lom_structure':
719  $this->active_sections['general']['fields'][] = 'lom_structure';
720  $this->active_sections['general']['name'] = $this->lng->txt('meta_general');
721  break;
722 
723  // Lifecycle
724  case 'lom_status':
725  $this->active_sections['lifecycle']['fields'][] = 'lom_status';
726  $this->active_sections['lifecycle']['name'] = $this->lng->txt('meta_lifecycle');
727  break;
728  case 'lom_version':
729  $this->active_sections['lifecycle']['fields'][] = 'lom_version';
730  $this->active_sections['lifecycle']['name'] = $this->lng->txt('meta_lifecycle');
731  break;
732  case 'lom_contribute':
733  $this->active_sections['lifecycle']['fields'][] = 'lom_contribute';
734  $this->active_sections['lifecycle']['name'] = $this->lng->txt('meta_lifecycle');
735  break;
736 
737  // Technical
738  case 'lom_format':
739  $this->active_sections['technical']['fields'][] = 'lom_format';
740  $this->active_sections['technical']['name'] = $this->lng->txt('meta_technical');
741  break;
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');
745  break;
746  case 'lom_browser':
747  $this->active_sections['technical']['fields'][] = 'lom_browser';
748  $this->active_sections['technical']['name'] = $this->lng->txt('meta_technical');
749  break;
750 
751  // Education
752  case 'lom_interactivity':
753  $this->active_sections['education']['fields'][] = 'lom_interactivity';
754  $this->active_sections['education']['name'] = $this->lng->txt('meta_education');
755  break;
756  case 'lom_resource':
757  $this->active_sections['education']['fields'][] = 'lom_resource';
758  $this->active_sections['education']['name'] = $this->lng->txt('meta_education');
759  break;
760  case 'lom_level':
761  $this->active_sections['education']['fields'][] = 'lom_level';
762  $this->active_sections['education']['name'] = $this->lng->txt('meta_education');
763  break;
764  case 'lom_density':
765  $this->active_sections['education']['fields'][] = 'lom_density';
766  $this->active_sections['education']['name'] = $this->lng->txt('meta_education');
767  break;
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');
771  break;
772  case 'lom_context':
773  $this->active_sections['education']['fields'][] = 'lom_context';
774  $this->active_sections['education']['name'] = $this->lng->txt('meta_education');
775  break;
776  case 'lom_difficulty':
777  $this->active_sections['education']['fields'][] = 'lom_difficulty';
778  $this->active_sections['education']['name'] = $this->lng->txt('meta_education');
779  break;
780 
781  // Rights
782  case 'lom_costs':
783  $this->active_sections['rights']['fields'][] = 'lom_costs';
784  $this->active_sections['rights']['name'] = $this->lng->txt('meta_rights');
785  break;
786  case 'lom_copyright':
787  $this->active_sections['rights']['fields'][] = 'lom_copyright';
788  $this->active_sections['rights']['name'] = $this->lng->txt('meta_rights');
789  break;
790 
791  // Classification
792  case 'lom_purpose':
793  $this->active_sections['classification']['fields'][] = 'lom_purpose';
794  $this->active_sections['classification']['name'] = $this->lng->txt('meta_classification');
795  break;
796  case 'lom_taxon':
797  $this->active_sections['classification']['fields'][] = 'lom_taxon';
798  $this->active_sections['classification']['name'] = $this->lng->txt('meta_classification');
799  break;
800 
801  default:
802  if(substr($field_name,0,3) != 'adv')
803  break;
804 
805  // Advanced meta data
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();
811 
812  $this->active_sections['adv_record_'.$record_id]['fields'][] = $field_name;
813  $this->active_sections['adv_record_'.$record_id]['name'] = ilAdvancedMDRecord::_lookupTitle($record_id);
814  break;
815  }
816  }
817  }
818 
822  protected function getRangeSelect($txt_from,$select_from,$txt_until,$select_until)
823  {
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);
829  return $tpl->get();
830  }
831 
832 }
833 ?>