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 $this->
addPager($filter,
'max_page');
126 $presentation->setPreviousNext($this->prev_link, $this->next_link);
128 if($presentation->render())
130 $this->tpl->setVariable(
'SEARCH_RESULTS',$presentation->getHTML(
true));
132 elseif(strlen(trim($qp->getQuery())))
139 $this->tpl->setVariable(
'SEARCH_TABLE',$this->form->getHTML());
141 if($filter->getResultIds())
154 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
157 $this->form->setFormAction($this->ctrl->getFormAction($this,
'search'));
158 $this->form->setTitle($this->lng->txt(
'search_advanced'));
159 $this->form->addCommandButton(
'search',$this->lng->txt(
'search'));
160 $this->form->addCommandButton(
'reset',$this->lng->txt(
'reset'));
162 foreach($this->
fields->getActiveSections() as $definition)
164 if($definition[
'name'] !=
'default')
167 $section->setTitle($definition[
'name']);
171 foreach($definition[
'fields'] as $field_name)
173 if(is_object($element = $this->
fields->getFormElement($this->search_cache->getQuery(),$field_name)))
175 $this->form->addItem($element);
187 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
188 $this->search_cache->setQuery(array(
'lom_content' =>
ilUtil::stripSlashes($_POST[
'queryString'])));
189 $this->search_cache->save();
195 if(!is_array($this->search_cache->getQuery()))
203 $this->search_cache->deleteCachedEntries();
206 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
217 $this->search_cache->setQuery(array());
218 $this->search_cache->save();
231 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
232 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
235 if(!strlen(trim($qp->getQuery())))
246 $ilBench->start(
'Lucene',
'ResultFilter');
247 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
248 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
251 $filter->setCandidates($searcher->getResult());
253 $ilBench->stop(
'Lucene',
'ResultFilter');
255 if($filter->getResultObjIds()) {
256 $searcher->highlight($filter->getResultObjIds());
260 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_search.html',
'Services/Search');
261 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
263 $presentation->setResults($filter->getResultIds());
264 $presentation->setSearcher($searcher);
267 $ilBench->start(
'Lucene',
'1500_fo');
268 $this->
addPager($filter,
'max_page');
269 $ilBench->stop(
'Lucene',
'1500_fo');
270 $presentation->setPreviousNext($this->prev_link, $this->next_link);
272 if($presentation->render())
274 $this->tpl->setVariable(
'SEARCH_RESULTS',$presentation->getHTML(
true));
283 $this->tpl->setVariable(
'SEARCH_TABLE',$this->form->getHTML());
285 if($filter->getResultIds())
306 $this->ctrl->getLinkTarget($this,
"disableAdministrationPanel"),
307 $this->lng->txt(
"basic_commands"));
310 $this->lng->txt(
"delete_selected_items"));
315 $this->lng->txt(
"move_selected_items"));
318 $this->lng->txt(
"link_selected_items"));
322 #$this->addAdminPanelCommand("paste",
323 # $this->lng->txt("paste_clipboard_items"));
325 $this->lng->txt(
"clear_clipboard"));
328 elseif($ilUser->getId() != ANONYMOUS_USER_ID)
331 $this->ctrl->getLinkTarget($this,
"enableAdministrationPanel"),
332 $this->lng->txt(
"all_commands"));
335 $this->ctrl->setParameter($this,
"type",
"");
336 $this->ctrl->setParameter($this,
"item_ref_id",
"");
337 $this->tpl->setPageFormAction($this->ctrl->getFormAction($this));
351 $this->tabs_gui->addTarget(
'search',$this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
353 if($this->
fields->getActiveFields())
355 $this->tabs_gui->addTarget(
'search_advanced',$this->ctrl->getLinkTarget($this));
358 $this->tabs_gui->setTabActive(
'search_advanced');
371 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
374 if((
int)
$_GET[
'page_number'])
376 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
378 if(isset(
$_POST[
'query']))
380 $this->search_cache->setQuery(
$_POST[
'query']);
387 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
390 if ((count($this->admin_panel_commands) > 0))
392 foreach($this->admin_panel_commands as
$cmd)
394 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
395 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
396 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
397 $this->tpl->parseCurrentBlock();
404 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
406 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW", $lng->txt(
"actions"));
407 $this->tpl->parseCurrentBlock();
408 $adm_view_cmp =
true;
412 if (is_array($this->admin_view_button))
414 if (is_array($this->admin_view_button))
416 $this->tpl->setCurrentBlock(
"lucene_admin_button");
417 $this->tpl->setVariable(
"LUCENE_ADMIN_MODE_LINK",
418 $this->admin_view_button[
"link"]);
419 $this->tpl->setVariable(
"LUCENE_TXT_ADMIN_MODE",
420 $this->admin_view_button[
"txt"]);
421 $this->tpl->parseCurrentBlock();
423 $this->tpl->setCurrentBlock(
"lucene_admin_view");
424 $this->tpl->parseCurrentBlock();
429 if (is_array($this->creation_selector))
431 $this->tpl->setCurrentBlock(
"lucene_add_commands");
434 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
436 $this->tpl->setVariable(
"LUCENE_SELECT_OBJTYPE_REPOS",
437 $this->creation_selector[
"options"]);
438 $this->tpl->setVariable(
"LUCENE_BTN_NAME_REPOS",
439 $this->creation_selector[
"command"]);
440 $this->tpl->setVariable(
"LUCENE_TXT_ADD_REPOS",
441 $this->creation_selector[
"txt"]);
442 $this->tpl->parseCurrentBlock();
443 $creation_selector =
true;
445 if ($adm_view || $creation_selector)
447 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
450 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
452 $this->tpl->parseCurrentBlock();
461 $this->admin_panel_commands[] =
462 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
470 $this->admin_view_button =
471 array(
"link" => $a_link,
"txt" => $a_txt);
476 $this->page_form_action = $a_action;