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->tabs_gui->addTarget(
'search',$this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
310 $this->tabs_gui->addTarget(
'search_user',$this->ctrl->getLinkTargetByClass(
'illuceneusersearchgui'));
315 $this->
fields->getActiveFields())
317 $this->tabs_gui->addTarget(
'search_advanced',$this->ctrl->getLinkTarget($this));
320 $this->tabs_gui->setTabActive(
'search_advanced');
333 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
336 if((
int)
$_GET[
'page_number'])
338 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
340 if(isset(
$_POST[
'query']))
342 $this->search_cache->setQuery(
$_POST[
'query']);
349 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
352 if ((count($this->admin_panel_commands) > 0))
354 foreach($this->admin_panel_commands as
$cmd)
356 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
357 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
358 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
359 $this->tpl->parseCurrentBlock();
366 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
368 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW", $lng->txt(
"actions"));
369 $this->tpl->parseCurrentBlock();
370 $adm_view_cmp =
true;
374 if (is_array($this->admin_view_button))
376 if (is_array($this->admin_view_button))
378 $this->tpl->setCurrentBlock(
"lucene_admin_button");
379 $this->tpl->setVariable(
"LUCENE_ADMIN_MODE_LINK",
380 $this->admin_view_button[
"link"]);
381 $this->tpl->setVariable(
"LUCENE_TXT_ADMIN_MODE",
382 $this->admin_view_button[
"txt"]);
383 $this->tpl->parseCurrentBlock();
385 $this->tpl->setCurrentBlock(
"lucene_admin_view");
386 $this->tpl->parseCurrentBlock();
391 if (is_array($this->creation_selector))
393 $this->tpl->setCurrentBlock(
"lucene_add_commands");
396 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
398 $this->tpl->setVariable(
"LUCENE_SELECT_OBJTYPE_REPOS",
399 $this->creation_selector[
"options"]);
400 $this->tpl->setVariable(
"LUCENE_BTN_NAME_REPOS",
401 $this->creation_selector[
"command"]);
402 $this->tpl->setVariable(
"LUCENE_TXT_ADD_REPOS",
403 $this->creation_selector[
"txt"]);
404 $this->tpl->parseCurrentBlock();
405 $creation_selector =
true;
407 if ($adm_view || $creation_selector)
409 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
412 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
414 $this->tpl->parseCurrentBlock();
423 $this->admin_panel_commands[] =
424 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
432 $this->admin_view_button =
433 array(
"link" => $a_link,
"txt" => $a_txt);
438 $this->page_form_action = $a_action;