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,$this->form)))
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_adv_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())
308 $ilHelp->setScreenIdComponent(
"src_luc");
310 $this->tabs_gui->addTarget(
'search',$this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
314 $this->tabs_gui->addTarget(
'search_user',$this->ctrl->getLinkTargetByClass(
'illuceneusersearchgui'));
319 $this->
fields->getActiveFields())
321 $this->tabs_gui->addTarget(
'search_advanced',$this->ctrl->getLinkTarget($this));
324 $this->tabs_gui->setTabActive(
'search_advanced');
337 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
340 if((
int)
$_GET[
'page_number'])
342 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
344 if(isset(
$_POST[
'query']))
346 $this->search_cache->setQuery(
$_POST[
'query']);
353 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
356 if ((count($this->admin_panel_commands) > 0))
358 foreach($this->admin_panel_commands as
$cmd)
360 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
361 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
362 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
363 $this->tpl->parseCurrentBlock();
370 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
372 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW", $lng->txt(
"actions"));
373 $this->tpl->parseCurrentBlock();
374 $adm_view_cmp =
true;
378 if (is_array($this->admin_view_button))
380 if (is_array($this->admin_view_button))
382 $this->tpl->setCurrentBlock(
"lucene_admin_button");
383 $this->tpl->setVariable(
"LUCENE_ADMIN_MODE_LINK",
384 $this->admin_view_button[
"link"]);
385 $this->tpl->setVariable(
"LUCENE_TXT_ADMIN_MODE",
386 $this->admin_view_button[
"txt"]);
387 $this->tpl->parseCurrentBlock();
389 $this->tpl->setCurrentBlock(
"lucene_admin_view");
390 $this->tpl->parseCurrentBlock();
395 if (is_array($this->creation_selector))
397 $this->tpl->setCurrentBlock(
"lucene_add_commands");
400 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
402 $this->tpl->setVariable(
"LUCENE_SELECT_OBJTYPE_REPOS",
403 $this->creation_selector[
"options"]);
404 $this->tpl->setVariable(
"LUCENE_BTN_NAME_REPOS",
405 $this->creation_selector[
"command"]);
406 $this->tpl->setVariable(
"LUCENE_TXT_ADD_REPOS",
407 $this->creation_selector[
"txt"]);
408 $this->tpl->parseCurrentBlock();
409 $creation_selector =
true;
411 if ($adm_view || $creation_selector)
413 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
416 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
418 $this->tpl->parseCurrentBlock();
427 $this->admin_panel_commands[] =
428 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
436 $this->admin_view_button =
437 array(
"link" => $a_link,
"txt" => $a_txt);
442 $this->page_form_action = $a_action;