ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilAdvancedSearchGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 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 
35 include_once 'Services/Search/classes/class.ilSearchBaseGUI.php';
36 include_once 'Services/MetaData/classes/class.ilMDUtilSelect.php';
37 
39 {
40  const TYPE_LOM = 1;
41  const TYPE_ADV_MD = 2;
42 
43  protected $last_section = 'adv_search';
44 
45 
46 
51  private $options = array();
52 
53  protected $tabs_gui;
54 
60  {
61  global $ilTabs;
62 
63  $this->tabs_gui = $ilTabs;
64 
66 
67  $this->lng->loadLanguageModule('meta');
68 
69  $this->__setSearchOptions($_POST);
70  }
71 
72  function getRootNode()
73  {
74  return ROOT_FOLDER_ID;
75  }
76 
77 
82  function &executeCommand()
83  {
84  global $rbacsystem;
85 
86  $next_class = $this->ctrl->getNextClass($this);
87  $cmd = $this->ctrl->getCmd();
88 
89  switch($next_class)
90  {
91  default:
92  $this->initUserSearchCache();
93  if(!$cmd)
94  {
95  switch($_SESSION['search_last_sub_section'])
96  {
97  case self::TYPE_ADV_MD:
98  $cmd = "showSavedAdvMDResults";
99  break;
100 
101  default:
102  $cmd = "showSavedResults";
103  break;
104  }
105  }
106 
107  $this->prepareOutput();
108  $this->$cmd();
109  break;
110  }
111  return true;
112  }
113  function reset()
114  {
115  $this->initSearchType(self::TYPE_LOM);
116  $this->options = array();
117  $this->showSearch();
118  }
119 
120  function searchInResults()
121  {
122  $this->initSearchType(self::TYPE_LOM);
123  $this->search_mode = 'in_results';
124  $this->search_cache->setResultPageNumber(1);
125  unset($_SESSION['adv_max_page']);
126  $this->performSearch();
127 
128  return true;
129  }
130 
131 
132  function performSearch()
133  {
134  global $ilUser;
135 
136  $this->initSearchType(self::TYPE_LOM);
137 
138  if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
139  {
140  unset($_SESSION['adv_max_page']);
141  $this->search_cache->delete();
142  }
143 
144  include_once 'Services/Search/classes/class.ilSearchResult.php';
145  $res =& new ilSearchResult();
146 
147  if($res_con =& $this->__performContentSearch())
148  {
149  $this->__storeEntries($res,$res_con);
150  }
151  if($res_tit =& $this->__performTitleSearch())
152  {
153  $this->__storeEntries($res,$res_tit);
154  }
155  if($res_lan =& $this->__performLanguageSearch())
156  {
157  $this->__storeEntries($res,$res_lan);
158  }
159  if($res_gen =& $this->__performGeneralSearch())
160  {
161  $this->__storeEntries($res,$res_gen);
162  }
163  if($res_lif =& $this->__performLifecycleSearch())
164  {
165  $this->__storeEntries($res,$res_lif);
166  }
167  if($res_con =& $this->__performContributeSearch())
168  {
169  $this->__storeEntries($res,$res_con);
170  }
171  if($res_ent =& $this->__performEntitySearch())
172  {
173  $this->__storeEntries($res,$res_ent);
174  }
175  if($res_req =& $this->__performRequirementSearch())
176  {
177  $this->__storeEntries($res,$res_req);
178  }
179  if($res_for =& $this->__performFormatSearch())
180  {
181  $this->__storeEntries($res,$res_for);
182  }
183  if($res_edu =& $this->__performEducationalSearch())
184  {
185  $this->__storeEntries($res,$res_edu);
186  }
187  if($res_typ =& $this->__performTypicalAgeRangeSearch())
188  {
189  $this->__storeEntries($res,$res_typ);
190  }
191  if($res_rig =& $this->__performRightsSearch())
192  {
193  $this->__storeEntries($res,$res_rig);
194  }
195  if($res_cla =& $this->__performClassificationSearch())
196  {
197  $this->__storeEntries($res,$res_cla);
198  }
199  if($res_tax =& $this->__performTaxonSearch())
200  {
201  $this->__storeEntries($res,$res_tax);
202  }
203  if($res_key =& $this->__performKeywordSearch())
204  {
205  $this->__storeEntries($res,$res_key);
206  }
207 
208  if($this->search_mode == 'in_results')
209  {
210  include_once 'Services/Search/classes/class.ilSearchResult.php';
211 
212  $old_result_obj = new ilSearchResult($ilUser->getId());
213  $old_result_obj->read(ADVANCED_MD_SEARCH);
214 
215  $res->diffEntriesFromResult($old_result_obj);
216  }
217 
218 
219  $res->filter($this->getRootNode(),true);
220  $res->save();
221  $this->showSearch();
222 
223  if(!count($res->getResults()))
224  {
225  ilUtil::sendInfo($this->lng->txt('search_no_match'));
226  }
227  else
228  {
229  $this->__showSearchInResults();
230  }
231 
232  if($res->isLimitReached())
233  {
234  $message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
235  ilUtil::sendInfo($message);
236  }
237 
238  $this->addPager($res,'adv_max_page');
239 
240  include_once 'Services/Search/classes/class.ilSearchResultPresentationGUI.php';
241  $search_result_presentation = new ilSearchResultPresentationGUI($res);
242  $this->tpl->setVariable("RESULTS",$search_result_presentation->showResults());
243 
244  return true;
245  }
246 
252  protected function initAdvancedMetaDataForm()
253  {
254  if(is_object($this->form))
255  {
256  return $this->form;
257  }
258 
259  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
260  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
261  $this->form = new ilPropertyFormGUI();
262  $this->form->setFormAction($this->ctrl->getFormAction($this));
263  $this->form->setTitle($this->lng->txt('adv_md_search_title'));
264  $this->form->addCommandButton('performAdvMDSearch',$this->lng->txt('search'));
265  #$this->form->setSubformMode('right');
266 
267  $content = new ilTextInputGUI($this->lng->txt('meta_title').'/'.
268  $this->lng->txt('meta_keyword').'/'.
269  $this->lng->txt('meta_description'),'title');
270  $content->setValue($this->options['title']);
271  $content->setSize(30);
272  $content->setMaxLength(255);
273  $content->setSubformMode('right');
274  $group = new ilRadioGroupInputGUI('','title_ao');
275  $group->setValue($this->options['title_ao']);
276  $radio_option = new ilRadioOption($this->lng->txt("search_any_word"),0);
277  $group->addOption($radio_option);
278  $radio_option = new ilRadioOption($this->lng->txt("search_all_words"),1);
279  $group->addOption($radio_option);
280  $content->addSubItem($group);
281  $this->form->addItem($content);
282 
283  $type = new ilSelectInputGUI($this->lng->txt('type'),'type');
284  $options['adv_all'] = $this->lng->txt('search_any');
285  foreach(ilAdvancedMDRecord::_getActivatedObjTypes() as $obj_type)
286  {
287  $options[$obj_type] = $this->lng->txt('objs_'.$obj_type);
288  }
289  $type->setOptions($options);
290  $type->setValue($this->options['type']);
291  $this->form->addItem($type);
292 
293  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
295  $record_gui->setPropertyForm($this->form);
296  $record_gui->setSearchValues($this->options);
297  $record_gui->parse();
298  }
299 
305  protected function performAdvMDSearch()
306  {
307  global $ilUser;
308 
309  $this->initSearchType(self::TYPE_ADV_MD);
310  if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
311  {
312  unset($_SESSION['adv_max_page']);
313  $this->search_cache->delete();
314  }
315 
316  include_once 'Services/Search/classes/class.ilSearchResult.php';
317  $res =& new ilSearchResult();
318 
319  if($res_tit =& $this->__performTitleSearch())
320  {
321  $this->__storeEntries($res,$res_tit);
322  }
323  $this->searchAdvancedMD($res);
324 
325  if($this->search_mode == 'in_results')
326  {
327  include_once 'Services/Search/classes/class.ilSearchResult.php';
328 
329  $old_result_obj = new ilSearchResult($ilUser->getId());
330  $old_result_obj->read(ADVANCED_MD_SEARCH);
331 
332  $res->diffEntriesFromResult($old_result_obj);
333  }
334 
335 
336  $res->filter($this->getRootNode(),true);
337  $res->save();
338  $this->showAdvMDSearch();
339 
340  if(!count($res->getResults()))
341  {
342  ilUtil::sendInfo($this->lng->txt('search_no_match'));
343  }
344  else
345  {
346  $this->__showSearchInResults();
347  }
348 
349  if($res->isLimitReached())
350  {
351  $message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
352  ilUtil::sendInfo($message);
353  }
354 
355  $this->addPager($res,'adv_max_page');
356 
357  include_once 'Services/Search/classes/class.ilSearchResultPresentationGUI.php';
358  $search_result_presentation = new ilSearchResultPresentationGUI($res);
359  $this->tpl->setVariable("RESULTS",$search_result_presentation->showResults());
360 
361  return true;
362 
363  }
364 
365 
371  public function showAdvMDSearch()
372  {
373  if(isset($_SESSION['search_adv_md']))
374  {
375  $this->options = $_SESSION['search_adv_md'];
376  }
377  $this->setSubTabs();
378  $this->tabs_gui->setSubTabActive('search_adv_md');
379 
380  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_adv_search.html','Services/Search');
381 
382  $this->initAdvancedMetaDataForm();
383  $this->tpl->setVariable('SEARCH_FORM',$this->form->getHTML());
384  return true;
385  }
386 
387 
388  function showSearch()
389  {
390  global $ilLocator;
391 
392  $this->setSubTabs();
393  $this->tabs_gui->setSubTabActive('search_lom');
394 
395  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.advanced_search.html','Services/Search');
396 
397  // Header
398  $this->tpl->setVariable("SEARCH_ACTION",$this->ctrl->getFormAction($this));
399  $this->tpl->setVariable("TBL_TITLE",$this->lng->txt('search_advanced'));
400 
401  // Content
402  $this->tpl->setVariable("TXT_CONTENT",$this->lng->txt('content'));
403  $this->tpl->setVariable("TXT_OR",$this->lng->txt('search_any_word'));
404  $this->tpl->setVariable("TXT_AND",$this->lng->txt('search_all_words'));
405 
406  if($this->options['content_ao'] == 'and')
407  {
408  $this->tpl->setVariable("CONTENT_AND_CHECKED",'checked=checked');
409  }
410  else
411  {
412  $this->tpl->setVariable("CONTENT_OR_CHECKED",'checked=checked');
413  }
414  $this->tpl->setVariable("FRM_CONTENT",ilUtil::prepareFormOutput($this->options['content']));
415 
416  // Type
417  $this->tpl->setVariable("TXT_TYPE",$this->lng->txt('type'));
418  $this->tpl->setVariable("SEL_TYPE",$this->__getFilterSelect());
419 
420  // General
421  $this->tpl->setVariable("TXT_GEN",$this->lng->txt('meta_general'));
422  $this->tpl->setVariable("TXT_LAN",$this->lng->txt('language'));
423  $this->tpl->setVariable("SEL_LAN",ilMDUtilSelect::_getLanguageSelect($this->options['language'],
424  'search_adv[language]'
425  ,array(0 => $this->lng->txt('meta_please_select'))));
426 
427  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('meta_title').'/'.
428  $this->lng->txt('meta_keyword').'/'.
429  $this->lng->txt('meta_description'));
430  $this->tpl->setVariable("TXT_COV",$this->lng->txt('meta_coverage'));
431  $this->tpl->setVariable("TXT_STRUCT",$this->lng->txt('meta_structure'));
432  $this->tpl->setVariable("SEL_STRUCT",ilMDUtilSelect::_getStructureSelect($this->options['structure'],
433  'search_adv[structure]',
434  array(0 => $this->lng->txt('meta_please_select'))));
435  $this->tpl->setVariable("FRM_TITLE",ilUtil::prepareFormOutput($this->options['title'],true));
436  $this->tpl->setVariable("FRM_COVERAGE",ilUtil::prepareFormOutput($this->options['coverage'],true));
437 
438  if($this->options['title_ao'] == 'and')
439  {
440  $this->tpl->setVariable("TITLE_AND_CHECKED",'checked=checked');
441  }
442  else
443  {
444  $this->tpl->setVariable("TITLE_OR_CHECKED",'checked=checked');
445  }
446  if($this->options['coverage_ao'] == 'and')
447  {
448  $this->tpl->setVariable("COVERAGE_AND_CHECKED",'checked=checked');
449  }
450  else
451  {
452  $this->tpl->setVariable("COVERAGE_OR_CHECKED",'checked=checked');
453  }
454 
455 
456 
457  // Lifecycle
458  $this->tpl->setVariable("TXT_LIFECYCLE",$this->lng->txt('meta_lifecycle'));
459  $this->tpl->setVariable("TXT_STATUS",$this->lng->txt('meta_status'));
460  $this->tpl->setVariable("SEL_STATUS",
461  ilMDUtilSelect::_getStatusSelect($this->options['status'],
462  'search_adv[status]',
463  array(0 => $this->lng->txt('meta_please_select'))));
464  $this->tpl->setVariable("TXT_VERSION",$this->lng->txt('meta_version'));
465  $this->tpl->setVariable("FRM_VERSION",ilUtil::prepareFormOutput($this->options['version'],true));
466 
467  $this->tpl->setVariable("TXT_CONTRIBUTOR",$this->lng->txt('meta_contribute'));
468  $this->tpl->setVariable("SEL_CONTRIBUTOR",
469  ilMDUtilSelect::_getRoleSelect($this->options['role'],
470  'search_adv[role]',
471  array(0 => $this->lng->txt('meta_please_select'))));
472  $this->tpl->setVariable("FRM_ENTITY",ilUtil::prepareFormOutput($this->options['entity'],true));
473 
474  if($this->options['entity_ao'] == 'and')
475  {
476  $this->tpl->setVariable("ENTITY_AND_CHECKED",'checked=checked');
477  }
478  else
479  {
480  $this->tpl->setVariable("ENTITY_OR_CHECKED",'checked=checked');
481  }
482  if($this->options['version_ao'] == 'and')
483  {
484  $this->tpl->setVariable("VERSION_AND_CHECKED",'checked=checked');
485  }
486  else
487  {
488  $this->tpl->setVariable("VERSION_OR_CHECKED",'checked=checked');
489  }
490 
491  // Technical
492  $this->tpl->setVariable("TXT_TECHNICAL",$this->lng->txt('meta_technical'));
493  $this->tpl->setVariable("TXT_FORMAT",$this->lng->txt('meta_format'));
494  $this->tpl->setVariable("TXT_OS",$this->lng->txt('meta_operating_system'));
495  $this->tpl->setVariable("TXT_BROWSER",$this->lng->txt('meta_browser'));
496  $this->tpl->setVariable("TXT_DURATION",$this->lng->txt('meta_duration'));
497  $this->tpl->setVariable("FROM",$this->lng->txt('from'));
498  $this->tpl->setVariable("TIL",$this->lng->txt('until'));
499 
500  $this->tpl->setVariable("SEL_FORMAT",
501  ilMDUtilSelect::_getFormatSelect($this->options['format'],
502  'search_adv[format]',
503  array(0 => $this->lng->txt('meta_please_select'))));
504  $this->tpl->setVariable("SEL_OS",
505  ilMDUtilSelect::_getOperatingSystemSelect($this->options['os'],
506  'search_adv[os]',
507  array(0 => $this->lng->txt('meta_please_select'))));
508  $this->tpl->setVariable("SEL_BROWSER",
509  ilMDUtilSelect::_getBrowserSelect($this->options['browser'],
510  'search_adv[browser]',
511  array(0 => $this->lng->txt('meta_please_select'))));
512  $this->tpl->setVariable("SEL_DURATION_1",
513  ilMDUtilSelect::_getDurationSelect('','md_lan',array(0 => $this->lng->txt('meta_please_select'))));
514  $this->tpl->setVariable("SEL_DURATION_2",
515  ilMDUtilSelect::_getDurationSelect('','md_lan',array(0 => $this->lng->txt('meta_please_select'))));
516 
517  // Educational
518  $this->tpl->setVariable("TXT_EDUCATIONAL",$this->lng->txt('meta_education'));
519  $this->tpl->setVariable("TXT_INTERACTIVITY",$this->lng->txt('meta_interactivity_type'));
520  $this->tpl->setVariable("TXT_RESOURCE",$this->lng->txt('meta_learning_resource_type'));
521  $this->tpl->setVariable("TXT_LEVEL",$this->lng->txt('meta_interactivity_level'));
522  $this->tpl->setVariable("TXT_DENSITY",$this->lng->txt('meta_semantic_density'));
523  $this->tpl->setVariable("TXT_END_USER",$this->lng->txt('meta_intended_end_user_role'));
524  $this->tpl->setVariable("TXT_CONTEXT",$this->lng->txt('meta_context'));
525  $this->tpl->setVariable("TXT_DIFFICULTY",$this->lng->txt('meta_difficulty'));
526  $this->tpl->setVariable("TXT_AGE_RANGE",$this->lng->txt('meta_typical_age_range'));
527  $this->tpl->setVariable("TXT_LEARNING_TIME",$this->lng->txt('meta_typical_learning_time'));
528 
529 
530  $this->tpl->setVariable("SEL_INTERACTIVITY",
531  ilMDUtilSelect::_getInteractivityTypeSelect($this->options['int_type'],
532  'search_adv[int_type]',
533  array(0 => $this->lng->txt('meta_please_select'))));
534  $this->tpl->setVariable("SEL_RESOURCE",
535  ilMDUtilSelect::_getLearningResourceTypeSelect($this->options['lea_type'],
536  'search_adv[lea_type]',
537  array(0 => $this->lng->txt('meta_please_select'))));
538  $this->tpl->setVariable("SEL_LEVEL_1",
539  ilMDUtilSelect::_getInteractivityLevelSelect($this->options['int_level_1'],
540  'search_adv[int_level_1]',
541  array(0 => $this->lng->txt('meta_please_select'))));
542  $this->tpl->setVariable("SEL_LEVEL_2",
543  ilMDUtilSelect::_getInteractivityLevelSelect($this->options['int_level_2'],
544  'search_adv[int_level_2]',
545  array(0 => $this->lng->txt('meta_please_select'))));
546  $this->tpl->setVariable("SEL_DENSITY_1",
547  ilMDUtilSelect::_getSemanticDensitySelect($this->options['sem_1'],
548  'search_adv[sem_1]',
549  array(0 => $this->lng->txt('meta_please_select'))));
550  $this->tpl->setVariable("SEL_DENSITY_2",
551  ilMDUtilSelect::_getSemanticDensitySelect($this->options['sem_2'],
552  'search_adv[sem_2]',
553  array(0 => $this->lng->txt('meta_please_select'))));
554  $this->tpl->setVariable("SEL_END_USER",
555  ilMDUtilSelect::_getIntendedEndUserRoleSelect($this->options['int_role'],
556  'search_adv[int_role]',
557  array(0 => $this->lng->txt('meta_please_select'))));
558  $this->tpl->setVariable("SEL_CONTEXT",
559  ilMDUtilSelect::_getContextSelect($this->options['con'],
560  'search_adv[con]',
561  array(0 => $this->lng->txt('meta_please_select'))));
562  $this->tpl->setVariable("SEL_DIFFICULTY_1",
563  ilMDUtilSelect::_getDifficultySelect($this->options['dif_1'],
564  'search_adv[dif_1]',
565  array(0 => $this->lng->txt('meta_please_select'))));
566  $this->tpl->setVariable("SEL_DIFFICULTY_2",
567  ilMDUtilSelect::_getDifficultySelect($this->options['dif_2'],
568  'search_adv[dif_2]',
569  array(0 => $this->lng->txt('meta_please_select'))));
570  $this->tpl->setVariable("SEL_AGE_RANGE_1",
571  ilMDUtilSelect::_getTypicalAgeRangeSelect($this->options['typ_age_1'],
572  'search_adv[typ_age_1]',
573  array(0 => $this->lng->txt('meta_please_select'))));
574  $this->tpl->setVariable("SEL_AGE_RANGE_2",
575  ilMDUtilSelect::_getTypicalAgeRangeSelect($this->options['typ_age_2'],
576  'search_adv[typ_age_2]',
577  array(0 => $this->lng->txt('meta_please_select'))));
578  $this->tpl->setVariable("SEL_LEARNING_TIME_1",
579  ilMDUtilSelect::_getTypicalLearningTimeSelect($this->options['typ_lea_1'],
580  'search_adv[typ_lea_1]',
581  array(0 => $this->lng->txt('meta_please_select'))));
582  $this->tpl->setVariable("SEL_LEARNING_TIME_2",
583  ilMDUtilSelect::_getTypicalLearningTimeSelect($this->options['typ_lea_2'],
584  'search_adv[typ_lea_2]',
585  array(0 => $this->lng->txt('meta_please_select'))));
586 
587  // RIGHTS
588  $this->tpl->setVariable("TXT_RIGHTS",$this->lng->txt('meta_rights'));
589  $this->tpl->setVariable("TXT_COSTS",$this->lng->txt('meta_cost'));
590  $this->tpl->setVariable("TXT_COPYRIGHT",$this->lng->txt('meta_copyright_and_other_restrictions'));
591 
592  $this->tpl->setVariable("SEL_COSTS",
593  ilMDUtilSelect::_getCostsSelect($this->options['costs'],
594  'search_adv[costs]',array(0 => $this->lng->txt('meta_please_select'))));
595  $this->tpl->setVariable("SEL_COPYRIGHT",
597  'search_adv[copyright]',
598  array(0 => $this->lng->txt('meta_please_select'))));
599 
600  // CLASSIFICATION
601  $this->tpl->setVariable("TXT_CLASSIFICATION",$this->lng->txt('meta_classification'));
602  $this->tpl->setVariable("TXT_PURPOSE",$this->lng->txt('meta_purpose'));
603  $this->tpl->setVariable("TXT_TAXON",$this->lng->txt('meta_taxon'));
604  $this->tpl->setVariable("TXT_KEYWORD",$this->lng->txt('meta_keyword'));
605 
606  $this->tpl->setVariable("SEL_PURPOSE",
607  ilMDUtilSelect::_getPurposeSelect($this->options['purpose'],
608  'search_adv[purpose]',
609  array(0 => $this->lng->txt('meta_please_select'))));
610 
611  if($this->options['taxon_ao'] == 'and')
612  {
613  $this->tpl->setVariable("TAXON_AND_CHECKED",'checked=checked');
614  }
615  else
616  {
617  $this->tpl->setVariable("TAXON_OR_CHECKED",'checked=checked');
618  }
619  $this->tpl->setVariable("FRM_TAXON",ilUtil::prepareFormOutput($this->options['taxon'],true));
620 
621  if($this->options['keyword_ao'] == 'and')
622  {
623  $this->tpl->setVariable("KEYWORD_AND_CHECKED",'checked=checked');
624  }
625  else
626  {
627  $this->tpl->setVariable("KEYWORD_OR_CHECKED",'checked=checked');
628  }
629  $this->tpl->setVariable("FRM_KEYWORD",ilUtil::prepareFormOutput($this->options['keyword'],true));
630 
631  $this->tpl->setVariable("BTN_SEARCH",$this->lng->txt('search'));
632  $this->tpl->setVariable("BTN_RESET",$this->lng->txt('reset'));
633 
634  return true;
635  }
636 
637  function prepareOutput()
638  {
640 
641  $this->tpl->setCurrentBlock("header_image");
642  $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_src_b.gif"));
643  $this->tpl->parseCurrentBlock();
644 
645  $this->tpl->setVariable("TXT_HEADER",$this->lng->txt('search'));
646 
647  $this->tpl->addBlockFile("TABS","tabs","tpl.tabs.html");
648 
649  $this->tpl->setCurrentBlock("tab");
650  $this->tpl->setVariable("TAB_TYPE","tabinactive");
651  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilsearchgui'));
652  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt("search"));
653  $this->tpl->parseCurrentBlock();
654 
655  $this->tpl->setCurrentBlock("tab");
656  $this->tpl->setVariable("TAB_TYPE","tabactive");
657  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTarget($this));
658  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt("search_advanced"));
659  $this->tpl->parseCurrentBlock();
660 
661  $this->tpl->setCurrentBlock("tab");
662  $this->tpl->setVariable("TAB_TYPE","tabinactive");
663  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilsearchresultgui'));
664  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt("search_search_results"));
665  $this->tpl->parseCurrentBlock();
666 
667  }
668  function saveResult()
669  {
670  include_once 'Services/Search/classes/class.ilUserResult.php';
671  include_once 'Services/Search/classes/class.ilSearchFolder.php';
672 
673  global $ilUser;
674 
675  $this->initSearchType(self::TYPE_LOM);
676  if(!$_POST['folder'])
677  {
678  ilUtil::sendInfo($this->lng->txt('search_select_one'));
679  $this->showSavedResults();
680 
681  return false;
682  }
683  if(!count($_POST['result']))
684  {
685  ilUtil::sendInfo($this->lng->txt('search_select_one_result'));
686  $this->showSavedResults();
687 
688  return false;
689  }
690 
691  $folder_obj =& new ilSearchFolder($ilUser->getId(),(int) $_POST['folder']);
692 
693  foreach($_POST['result'] as $ref_id)
694  {
695 
697  $target = addslashes(serialize(array('type' => ilObject::_lookupType(ilObject::_lookupObjId($ref_id)),
698  'id' => $ref_id)));
699 
700  $search_res_obj =& new ilUserResult($ilUser->getId());
701  $search_res_obj->setTitle($title);
702  $search_res_obj->setTarget($target);
703 
704  $folder_obj->assignResult($search_res_obj);
705  unset($search_res_obj);
706  }
707  ilUtil::sendInfo($this->lng->txt('search_results_saved'));
708  $this->showSavedResults();
709 
710  }
711 
712 
713  // PRIVATE
720  private function showSavedAdvMDResults()
721  {
722  global $ilUser;
723 
724  // Read old result sets
725  include_once 'Services/Search/classes/class.ilSearchResult.php';
726 
727  $this->initSearchType(self::TYPE_ADV_MD);
728  $result_obj = new ilSearchResult($ilUser->getId());
729  $result_obj->read(ADVANCED_MD_SEARCH);
730 
731  $this->showAdvMDSearch();
732 
733  // Show them
734  if(count($result_obj->getResults()))
735  {
736  $this->__showSearchInResults();
737  $this->addPager($result_obj,'adv_max_page');
738 
739  include_once 'Services/Search/classes/class.ilSearchResultPresentationGUI.php';
740  $search_result_presentation = new ilSearchResultPresentationGUI($result_obj);
741  $this->tpl->setVariable("RESULTS",$search_result_presentation->showResults());
742  }
743 
744  return true;
745  }
746 
747 
748  function showSavedResults()
749  {
750  global $ilUser;
751 
752  // Read old result sets
753  include_once 'Services/Search/classes/class.ilSearchResult.php';
754 
755  $this->initSearchType(self::TYPE_LOM);
756  $result_obj = new ilSearchResult($ilUser->getId());
757  $result_obj->read(ADVANCED_SEARCH);
758 
759  $this->showSearch();
760 
761  // Show them
762  if(count($result_obj->getResults()))
763  {
764  $this->__showSearchInResults();
765  $this->addPager($result_obj,'adv_max_page');
766 
767  include_once 'Services/Search/classes/class.ilSearchResultPresentationGUI.php';
768  $search_result_presentation = new ilSearchResultPresentationGUI($result_obj);
769  $this->tpl->setVariable("RESULTS",$search_result_presentation->showResults());
770  }
771 
772  return true;
773  }
774 
776  {
777  if(!$this->options['content'])
778  {
779  return false;
780  }
781  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
782  include_once 'Services/Search/classes/class.ilQueryParser.php';
783  include_once 'Services/Search/classes/class.ilSearchResult.php';
784 
785  $res =& new ilSearchResult();
786 
787 
788  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['content']));
789  $query_parser->setCombination($this->options['content_ao']);
790  $query_parser->parse();
791 
792  if($this->options['type'] == 'all' or $this->options['type'] == 'lms')
793  {
794  // LM content search
795  $lm_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
796  $res_cont =& $lm_search->performSearch();
797  $res->mergeEntries($res_cont);
798 
799  if($this->settings->enabledLucene())
800  {
801 
802  // HTLM content search
803  $htlm_search =& ilObjectSearchFactory::_getHTLMSearchInstance($query_parser);
804  $res_htlm =& $htlm_search->performSearch();
805  $res->mergeEntries($res_htlm);
806  }
807  }
808  if($this->options['type'] == 'all' or $this->options['type'] == 'tst')
809  {
810  $tst_search =& ilObjectSearchFactory::_getTestSearchInstance($query_parser);
811  $res_tes =& $tst_search->performSearch();
812  $res->mergeEntries($res_tes);
813  }
814  if($this->options['type'] == 'all' or $this->options['type'] == 'mep')
815  {
816  $med_search =& ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
817  $res_med =& $med_search->performSearch();
818  $res->mergeEntries($res_med);
819  }
820  if($this->options['type'] == 'all' or $this->options['type'] == 'glo')
821  {
823  $res_glo =& $glo_search->performSearch();
824  $res->mergeEntries($res_glo);
825  }
826  if($this->options['type'] == 'all' or $this->options['type'] == 'webr')
827  {
828  $web_search =& ilObjectSearchFactory::_getWebresourceSearchInstance($query_parser);
829  $res_web =& $web_search->performSearch();
830  $res->mergeEntries($res_web);
831  }
832 
833  return $res;
834  }
835 
836 
838  {
839  if(!$this->options['title'])
840  {
841  return false;
842  }
843  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
844  include_once 'Services/Search/classes/class.ilQueryParser.php';
845 
846  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['title']));
847  $query_parser->setCombination($this->options['title_ao']);
848  $query_parser->parse();
849  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
850  $meta_search->setFilter($this->filter);
851  $meta_search->setMode('title_description');
852  $meta_search->setOptions($this->options);
853  $res_tit =& $meta_search->performSearch();
854 
855  $meta_search->setMode('keyword_all');
856  $res_key =& $meta_search->performSearch();
857 
858  // merge them
859  $res_tit->mergeEntries($res_key);
860 
861  return $res_tit;
862  }
863 
864 
865 
867  {
868  if(!$this->options['coverage'] and !$this->options['structure'])
869  {
870  return false;
871  }
872 
873  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
874  include_once 'Services/Search/classes/class.ilQueryParser.php';
875 
876  if($this->options['coverage'])
877  {
878  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['coverage']));
879  $query_parser->setCombination($this->options['coverage_ao']);
880  $query_parser->parse();
881  }
882  else
883  {
884  $query_parser = new ilQueryParser('');
885  }
886  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
887  $meta_search->setFilter($this->filter);
888  $meta_search->setMode('general');
889  $meta_search->setOptions($this->options);
890  $res =& $meta_search->performSearch();
891 
892  return $res;
893  }
894 
896  {
897  // Return if 'any'
898  if(!$this->options['status'] and !$this->options['version'])
899  {
900  return false;
901  }
902  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
903  include_once 'Services/Search/classes/class.ilQueryParser.php';
904 
905  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['version']));
906  $query_parser->setCombination($this->options['version_ao']);
907  $query_parser->parse();
908 
909  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
910  $meta_search->setFilter($this->filter);
911  $meta_search->setMode('lifecycle');
912  $meta_search->setOptions($this->options);
913  $res =& $meta_search->performSearch();
914 
915  return $res;
916  }
918  {
919  if(!$this->options['language'])
920  {
921  return false;
922  }
923  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
924  include_once 'Services/Search/classes/class.ilQueryParser.php';
925 
926 
928  $meta_search->setFilter($this->filter);
929  $meta_search->setMode('language');
930  $meta_search->setOptions($this->options);
931  $res =& $meta_search->performSearch();
932 
933  return $res;
934  }
936  {
937  if(!strlen($this->options['role']))
938  {
939  return false;
940  }
941  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
942  include_once 'Services/Search/classes/class.ilQueryParser.php';
943 
944 
946  $meta_search->setFilter($this->filter);
947  $meta_search->setMode('contribute');
948  $meta_search->setOptions($this->options);
949  $res =& $meta_search->performSearch();
950 
951  return $res;
952  }
954  {
955  // Return if 'any'
956  if(!$this->options['entity'])
957  {
958  return false;
959  }
960  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
961  include_once 'Services/Search/classes/class.ilQueryParser.php';
962 
963  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['entity']));
964  $query_parser->setCombination($this->options['entity_ao']);
965  $query_parser->parse();
966 
967  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
968  $meta_search->setFilter($this->filter);
969  $meta_search->setMode('entity');
970  $meta_search->setOptions($this->options);
971  $res =& $meta_search->performSearch();
972 
973  return $res;
974  }
975 
976 
978  {
979  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
980  include_once 'Services/Search/classes/class.ilQueryParser.php';
981 
982 
984  $meta_search->setFilter($this->filter);
985  $meta_search->setMode('requirement');
986  $meta_search->setOptions($this->options);
987  $res =& $meta_search->performSearch();
988 
989  return $res;
990  }
992  {
993  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
994  include_once 'Services/Search/classes/class.ilQueryParser.php';
995 
996 
998  $meta_search->setFilter($this->filter);
999  $meta_search->setMode('format');
1000  $meta_search->setOptions($this->options);
1001  $res =& $meta_search->performSearch();
1002 
1003  return $res;
1004  }
1006  {
1007  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1008  include_once 'Services/Search/classes/class.ilQueryParser.php';
1009 
1010 
1012  $meta_search->setFilter($this->filter);
1013  $meta_search->setMode('educational');
1014  $meta_search->setOptions($this->options);
1015  $res =& $meta_search->performSearch();
1016 
1017  return $res;
1018  }
1020  {
1021  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1022  include_once 'Services/Search/classes/class.ilQueryParser.php';
1023 
1024 
1026  $meta_search->setFilter($this->filter);
1027  $meta_search->setMode('typical_age_range');
1028  $meta_search->setOptions($this->options);
1029  $res =& $meta_search->performSearch();
1030 
1031  return $res;
1032  }
1034  {
1035  if(!$this->options['copyright'] and !$this->options['costs'])
1036  {
1037  return false;
1038  }
1039  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1040  include_once 'Services/Search/classes/class.ilQueryParser.php';
1041 
1042 
1044  $meta_search->setFilter($this->filter);
1045  $meta_search->setMode('rights');
1046  $meta_search->setOptions($this->options);
1047  $res =& $meta_search->performSearch();
1048 
1049  return $res;
1050  }
1051 
1053  {
1054  // Return if 'any'
1055  if(!$this->options['purpose'])
1056  {
1057  return false;
1058  }
1059  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1060  include_once 'Services/Search/classes/class.ilQueryParser.php';
1061 
1062 
1064  $meta_search->setFilter($this->filter);
1065  $meta_search->setMode('classification');
1066  $meta_search->setOptions($this->options);
1067  $res =& $meta_search->performSearch();
1068 
1069  return $res;
1070  }
1071 
1073  {
1074  // Return if 'any'
1075  if(!$this->options['taxon'])
1076  {
1077  return false;
1078  }
1079  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1080  include_once 'Services/Search/classes/class.ilQueryParser.php';
1081 
1082  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['taxon']));
1083  $query_parser->setCombination($this->options['taxon_ao']);
1084  $query_parser->parse();
1085 
1086  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
1087  $meta_search->setFilter($this->filter);
1088  $meta_search->setMode('taxon');
1089  $meta_search->setOptions($this->options);
1090  $res =& $meta_search->performSearch();
1091 
1092  return $res;
1093  }
1094 
1102  private function searchAdvancedMD($res)
1103  {
1104  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1105  foreach($_POST as $key => $value)
1106  {
1107  if(!is_numeric($key))
1108  {
1109  continue;
1110  }
1111  if(!$value)
1112  {
1113  continue;
1114  }
1115 
1117  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1118  include_once 'Services/Search/classes/class.ilQueryParser.php';
1119 
1120  if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_SELECT)
1121  {
1122  $value = (int) $value;
1123  $options = $def->getFieldValues();
1124  if(!isset($options[$value - 1]))
1125  {
1126  continue;
1127  }
1128  $value = $options[$value - 1];
1129  }
1130  if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE)
1131  {
1132  $start = $this->toUnixTime($_POST['date_start'][$key]['date']);
1133  $end = $this->toUnixTime($_POST['date_end'][$key]['date']);
1134 
1135  }
1136  if($def->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATETIME)
1137  {
1138  $start = $this->toUnixTime($_POST['date_start'][$key]['date'],$_POST['date_start'][$key]['time']);
1139  $end = $this->toUnixTime($_POST['date_end'][$key]['date'],$_POST['date_end'][$key]['time']);
1140  }
1141 
1142  $query_parser = new ilQueryParser(ilUtil::stripSlashes($value));
1143  if($_POST['boolean'][$key] == 1)
1144  {
1145  $query_parser->setCombination('and');
1146  }
1147  else
1148  {
1149  $query_parser->setCombination('or');
1150  }
1151  $query_parser->parse();
1152 
1153  $adv_md_search = ilObjectSearchFactory::_getAdvancedMDSearchInstance($query_parser);
1154  $adv_md_search->setDefinition($def);
1155  $adv_md_search->setTimeRange($start,$end);
1156  $adv_md_search->setFilter($this->filter);
1157  $res_field = $adv_md_search->performSearch();
1158  $this->__storeEntries($res,$res_field);
1159 
1160  }
1161  return $res;
1162  }
1163 
1165  {
1166  // Return if 'any'
1167  if(!$this->options['keyword'])
1168  {
1169  return false;
1170  }
1171  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
1172  include_once 'Services/Search/classes/class.ilQueryParser.php';
1173 
1174  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->options['keyword']));
1175  $query_parser->setCombination($this->options['keyword_ao']);
1176  $query_parser->parse();
1177 
1178  $meta_search =& ilObjectSearchFactory::_getAdvancedSearchInstance($query_parser);
1179  $meta_search->setFilter($this->filter);
1180  $meta_search->setMode('keyword');
1181  $meta_search->setOptions($this->options);
1182  $res =& $meta_search->performSearch();
1183 
1184  return $res;
1185  }
1186 
1187  function __setSearchOptions(&$post_vars)
1188  {
1189  if(isset($_POST['cmd']['performSearch']))
1190  {
1191  $this->options = $_SESSION['search_adv'] = $_POST['search_adv'];
1192  }
1193  elseif(isset($_POST['cmd']['performAdvMDSearch']))
1194  {
1195  $this->options = $_SESSION['search_adv_md'] = $_POST;
1196  }
1197  else
1198  {
1199  $this->options = $_SESSION['search_adv'];
1200  }
1201 
1202  $_POST['result'] = $_POST['id'];
1203 
1204  $this->filter = array();
1205 
1206  switch($this->options['type'])
1207  {
1208  case 'cat':
1209  $this->filter[] = 'cat';
1210  break;
1211 
1212  case 'webr':
1213  $this->filter[] = 'webr';
1214  break;
1215 
1216  case 'lms':
1217  $this->filter[] = 'lm';
1218  $this->filter[] = 'dbk';
1219  $this->filter[] = 'pg';
1220  $this->filter[] = 'st';
1221  $this->filter[] = 'sahs';
1222  $this->filter[] = 'htlm';
1223  break;
1224 
1225  case 'glo':
1226  $this->filter[] = 'glo';
1227  break;
1228 
1229  case 'tst':
1230  $this->filter[] = 'tst';
1231  $this->filter[] = 'svy';
1232  $this->filter[] = 'qpl';
1233  $this->filter[] = 'spl';
1234  break;
1235 
1236  case 'mep':
1237  $this->filter[] = 'mep';
1238  break;
1239 
1240  case 'crs':
1241  $this->filter[] = 'crs';
1242  break;
1243 
1244  case 'file':
1245  $this->filter[] = 'file';
1246  break;
1247 
1248  case 'adv_all':
1249  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1251  break;
1252 
1253  case 'all':
1254  default:
1255  $this->filter[] = 'webr';
1256  $this->filter[] = 'crs';
1257  $this->filter[] = 'mep';
1258  $this->filter[] = 'tst';
1259  $this->filter[] = 'svy';
1260  $this->filter[] = 'qpl';
1261  $this->filter[] = 'spl';
1262  $this->filter[] = 'glo';
1263  $this->filter[] = 'lm';
1264  $this->filter[] = 'dbk';
1265  $this->filter[] = 'pg';
1266  $this->filter[] = 'st';
1267  $this->filter[] = 'sahs';
1268  $this->filter[] = 'htlm';
1269  $this->filter[] = 'file';
1270  }
1271  return true;
1272  }
1273 
1275  {
1276  $options = array('all' => $this->lng->txt('search_any'),
1277  'crs' => $this->lng->txt('objs_crs'),
1278  'lms' => $this->lng->txt('learning_resources'),
1279  'glo' => $this->lng->txt('objs_glo'),
1280  'mep' => $this->lng->txt('objs_mep'),
1281  'tst' => $this->lng->txt('search_tst_svy'),
1282  'file'=> $this->lng->txt('objs_file'),
1283  'webr' => $this->lng->txt('objs_webr'));
1284 
1285 
1286  return ilUtil::formSelect($this->options['type'],'search_adv[type]',$options,false,true);
1287  }
1288 
1289 
1290  function __storeEntries(&$res,&$new_res)
1291  {
1292 
1293  if($this->stored == false)
1294  {
1295 
1296 
1297  $res->mergeEntries($new_res);
1298  $this->stored = true;
1299 
1300  return true;
1301  }
1302  else
1303  {
1304  $res->intersectEntries($new_res);
1305 
1306  return true;
1307  }
1308  }
1315  {
1316  $this->tpl->setCurrentBlock("search_results");
1317  $this->tpl->setVariable("BTN_SEARCHRESULTS",$this->lng->txt('search_in_result'));
1318  $this->tpl->parseCurrentBlock();
1319 
1320  $this->tpl->setCurrentBlock("save_result");
1321  $this->tpl->setVariable("DOWNRIGHT",ilUtil::getImagePath('arrow_downright.gif'));
1322  $this->tpl->setVariable("BTN_SAVE_RESULT",$this->lng->txt('save'));
1323  $this->tpl->setVariable("SELECT_FOLDER",$this->__getFolderSelect());
1324  $this->tpl->parseCurrentBlock();
1325 
1326  return true;
1327  }
1329  {
1330  global $ilUser;
1331 
1332  include_once 'Services/Search/classes/class.ilSearchFolder.php';
1333 
1334  // INITIATE SEARCH FOLDER OBJECT
1335  $folder_obj =& new ilSearchFolder($ilUser->getId());
1336 
1337 
1338  $subtree = $folder_obj->getSubtree();
1339 
1340  $options[0] = $this->lng->txt("search_select_one_folder_select");
1341  $options[$folder_obj->getRootId()] = $this->lng->txt("search_save_as_select")." ".$this->lng->txt("search_search_results");
1342 
1343  foreach($subtree as $node)
1344  {
1345  if($node["obj_id"] == $folder_obj->getRootId())
1346  {
1347  continue;
1348  }
1349  // CREATE PREFIX
1350  $prefix = $this->lng->txt("search_save_as_select");
1351  for($i = 1; $i < $node["depth"];++$i)
1352  {
1353  $prefix .= "&nbsp;&nbsp;";
1354  }
1355  $options[$node["obj_id"]] = $prefix.$node["title"];
1356  }
1357  return ilUtil::formSelect(0,'folder',$options,false,true);
1358  }
1359 
1366  private function initUserSearchCache()
1367  {
1368  global $ilUser;
1369 
1370  include_once('Services/Search/classes/class.ilUserSearchCache.php');
1371  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
1372  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1373  if($_GET['page_number'])
1374  {
1375  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
1376  }
1377  }
1378 
1385  public function setSubTabs()
1386  {
1387  global $ilTabs;
1388 
1389  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1391  {
1392  return true;
1393  }
1394  $ilTabs->addSubTabTarget('search_lom',$this->ctrl->getLinkTarget($this,'showSavedResults'));
1395  $ilTabs->addSubTabTarget('search_adv_md',$this->ctrl->getLinkTarget($this,'showSavedAdvMDResults'));
1396 
1397  }
1398 
1406  private function toUnixTime($date,$time = array())
1407  {
1408  return mktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1409  }
1410 
1418  private function initSearchType($type)
1419  {
1420  if($type == self::TYPE_LOM)
1421  {
1422  $_SESSION['search_last_sub_section'] = self::TYPE_LOM;
1423  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_SEARCH);
1424  }
1425  else
1426  {
1427  $_SESSION['search_last_sub_section'] = self::TYPE_ADV_MD;
1428  $this->search_cache->switchSearchType(ilUserSearchCache::ADVANCED_MD_SEARCH);
1429  }
1430  }
1431 }
1432 ?>