24 include_once
'./Services/Search/classes/class.ilSearchBaseGUI.php';
25 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchFields.php';
26 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
27 include_once
'./Services/Administration/interfaces/interface.ilAdministrationCommandHandling.php';
67 $next_class = $this->ctrl->getNextClass($this);
68 $cmd = $this->ctrl->getCmd();
73 case 'ilobjectcopygui':
74 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
76 $this->ctrl->forwardCommand($cp);
83 $cmd =
"showSavedResults";
100 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
101 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
108 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
110 $filter->loadFromDb();
113 if($filter->getResultObjIds()) {
114 $searcher->highlight($filter->getResultObjIds());
117 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
118 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
120 $presentation->setResults($filter->getResultIds());
121 $presentation->setSearcher($searcher);
125 $ilBench->start(
'Lucene',
'1500_fo');
126 $this->
addPager($filter,
'max_page');
127 $ilBench->stop(
'Lucene',
'1500_fo');
128 $presentation->setPreviousNext($this->prev_link, $this->next_link);
130 if($presentation->render())
132 $this->tpl->setVariable(
'SEARCH_RESULTS',$presentation->getHTML(
true));
134 elseif(strlen(trim($qp->getQuery())))
141 $this->tpl->setVariable(
'SEARCH_TABLE',$this->form->getHTML());
143 if($filter->getResultIds())
156 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
159 $this->form->setFormAction($this->ctrl->getFormAction($this,
'search'));
160 $this->form->setTitle($this->lng->txt(
'search_advanced'));
161 $this->form->addCommandButton(
'search',$this->lng->txt(
'search'));
162 $this->form->addCommandButton(
'reset',$this->lng->txt(
'reset'));
164 foreach($this->fields->getActiveSections() as $definition)
166 if($definition[
'name'] !=
'default')
169 $section->setTitle($definition[
'name']);
173 foreach($definition[
'fields'] as $field_name)
175 if(is_object($element = $this->fields->getFormElement($this->search_cache->getQuery(),$field_name)))
177 $this->form->addItem($element);
189 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
190 $this->search_cache->setQuery(array(
'lom_content' =>
ilUtil::stripSlashes($_POST[
'queryString'])));
191 $this->search_cache->save();
197 if(!is_array($this->search_cache->getQuery()))
205 $this->search_cache->deleteCachedEntries();
208 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
219 $this->search_cache->setQuery(array());
220 $this->search_cache->save();
233 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
234 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
237 if(!strlen(trim($qp->getQuery())))
248 $ilBench->start(
'Lucene',
'ResultFilter');
249 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
250 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
253 $filter->setCandidates($searcher->getResult());
255 $ilBench->stop(
'Lucene',
'ResultFilter');
257 if($filter->getResultObjIds()) {
258 $searcher->highlight($filter->getResultObjIds());
262 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_search.html',
'Services/Search');
263 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
265 $presentation->setResults($filter->getResultIds());
266 $presentation->setSearcher($searcher);
269 $ilBench->start(
'Lucene',
'1500_fo');
270 $this->
addPager($filter,
'max_page');
271 $ilBench->stop(
'Lucene',
'1500_fo');
272 $presentation->setPreviousNext($this->prev_link, $this->next_link);
274 if($presentation->render())
276 $this->tpl->setVariable(
'SEARCH_RESULTS',$presentation->getHTML(
true));
285 $this->tpl->setVariable(
'SEARCH_TABLE',$this->form->getHTML());
287 if($filter->getResultIds())
308 $this->ctrl->getLinkTarget($this,
"disableAdministrationPanel"),
309 $this->lng->txt(
"basic_commands"));
312 $this->lng->txt(
"delete_selected_items"));
317 $this->lng->txt(
"move_selected_items"));
320 $this->lng->txt(
"link_selected_items"));
324 #$this->addAdminPanelCommand("paste",
325 # $this->lng->txt("paste_clipboard_items"));
327 $this->lng->txt(
"clear_clipboard"));
330 elseif($ilUser->getId() != ANONYMOUS_USER_ID)
333 $this->ctrl->getLinkTarget($this,
"enableAdministrationPanel"),
334 $this->lng->txt(
"all_commands"));
337 $this->ctrl->setParameter($this,
"type",
"");
338 $this->ctrl->setParameter($this,
"item_ref_id",
"");
339 $this->tpl->setPageFormAction($this->ctrl->getFormAction($this));
353 $this->tabs_gui->addTarget(
'search',$this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
355 if($this->fields->getActiveFields())
357 $this->tabs_gui->addTarget(
'search_advanced',$this->ctrl->getLinkTarget($this));
360 $this->tabs_gui->setTabActive(
'search_advanced');
373 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
376 if((
int)
$_GET[
'page_number'])
378 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
380 if(isset(
$_POST[
'query']))
382 $this->search_cache->setQuery(
$_POST[
'query']);
389 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
392 if ((count($this->admin_panel_commands) > 0))
394 foreach($this->admin_panel_commands as
$cmd)
396 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
397 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
398 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
399 $this->tpl->parseCurrentBlock();
406 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
408 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW", $lng->txt(
"actions"));
409 $this->tpl->parseCurrentBlock();
410 $adm_view_cmp =
true;
414 if (is_array($this->admin_view_button))
416 if (is_array($this->admin_view_button))
418 $this->tpl->setCurrentBlock(
"lucene_admin_button");
419 $this->tpl->setVariable(
"LUCENE_ADMIN_MODE_LINK",
420 $this->admin_view_button[
"link"]);
421 $this->tpl->setVariable(
"LUCENE_TXT_ADMIN_MODE",
422 $this->admin_view_button[
"txt"]);
423 $this->tpl->parseCurrentBlock();
425 $this->tpl->setCurrentBlock(
"lucene_admin_view");
426 $this->tpl->parseCurrentBlock();
431 if (is_array($this->creation_selector))
433 $this->tpl->setCurrentBlock(
"lucene_add_commands");
436 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
438 $this->tpl->setVariable(
"LUCENE_SELECT_OBJTYPE_REPOS",
439 $this->creation_selector[
"options"]);
440 $this->tpl->setVariable(
"LUCENE_BTN_NAME_REPOS",
441 $this->creation_selector[
"command"]);
442 $this->tpl->setVariable(
"LUCENE_TXT_ADD_REPOS",
443 $this->creation_selector[
"txt"]);
444 $this->tpl->parseCurrentBlock();
445 $creation_selector =
true;
447 if ($adm_view || $creation_selector)
449 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
452 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
454 $this->tpl->parseCurrentBlock();
463 $this->admin_panel_commands[] =
464 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
472 $this->admin_view_button =
473 array(
"link" => $a_link,
"txt" => $a_txt);
478 $this->page_form_action = $a_action;