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';
56 parent::__construct();
67 $next_class = $this->ctrl->getNextClass($this);
68 $cmd = $this->ctrl->getCmd();
73 case 'ilobjectcopygui':
74 $this->ctrl->setReturn($this);
75 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
77 $this->ctrl->forwardCommand($cp);
84 $cmd =
"showSavedResults";
101 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
102 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
109 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
111 $filter->loadFromDb();
114 if($filter->getResultObjIds()) {
115 $searcher->highlight($filter->getResultObjIds());
118 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
119 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
121 $presentation->setResults($filter->getResultIds());
122 $presentation->setSearcher($searcher);
126 $this->
addPager($filter,
'max_page');
127 $presentation->setPreviousNext($this->prev_link, $this->next_link);
129 if($presentation->render())
131 $this->tpl->setVariable(
'SEARCH_RESULTS',$presentation->getHTML(
true));
133 elseif(strlen(trim($qp->getQuery())))
140 $this->tpl->setVariable(
'SEARCH_TABLE',$this->form->getHTML());
142 if($filter->getResultIds())
155 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
158 $this->form->setFormAction($this->ctrl->getFormAction($this,
'search'));
159 $this->form->setTitle($this->lng->txt(
'search_advanced'));
160 $this->form->addCommandButton(
'search',$this->lng->txt(
'search'));
161 $this->form->addCommandButton(
'reset',$this->lng->txt(
'reset'));
163 foreach($this->
fields->getActiveSections() as $definition)
165 if($definition[
'name'] !=
'default')
168 $section->setTitle($definition[
'name']);
172 foreach($definition[
'fields'] as $field_name)
174 if(is_object($element = $this->
fields->getFormElement($this->search_cache->getQuery(),$field_name,$this->form)))
176 $this->form->addItem($element);
188 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
190 $this->search_cache->save();
196 if(!is_array($this->search_cache->getQuery()))
204 $this->search_cache->deleteCachedEntries();
207 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
218 $this->search_cache->setQuery(
array());
219 $this->search_cache->save();
232 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
233 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
236 if(!strlen(trim($qp->getQuery())))
247 $ilBench->start(
'Lucene',
'ResultFilter');
248 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
249 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
252 $filter->setCandidates($searcher->getResult());
254 $ilBench->stop(
'Lucene',
'ResultFilter');
256 if($filter->getResultObjIds()) {
257 $searcher->highlight($filter->getResultObjIds());
261 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
262 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
264 $presentation->setResults($filter->getResultIds());
265 $presentation->setSearcher($searcher);
268 $ilBench->start(
'Lucene',
'1500_fo');
269 $this->
addPager($filter,
'max_page');
270 $ilBench->stop(
'Lucene',
'1500_fo');
271 $presentation->setPreviousNext($this->prev_link, $this->next_link);
273 if($presentation->render())
275 $this->tpl->setVariable(
'SEARCH_RESULTS',$presentation->getHTML(
true));
284 $this->tpl->setVariable(
'SEARCH_TABLE',$this->form->getHTML());
286 if($filter->getResultIds())
297 parent::prepareOutput();
309 $ilHelp->setScreenIdComponent(
"src_luc");
311 $this->tabs_gui->addTarget(
'search',$this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
315 $this->tabs_gui->addTarget(
'search_user',$this->ctrl->getLinkTargetByClass(
'illuceneusersearchgui'));
320 $this->
fields->getActiveFields())
322 $this->tabs_gui->addTarget(
'search_advanced',$this->ctrl->getLinkTarget($this));
325 $this->tabs_gui->setTabActive(
'search_advanced');
338 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
341 if((
int)
$_GET[
'page_number'])
343 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
345 if(isset(
$_POST[
'query']))
347 $this->search_cache->setQuery(
$_POST[
'query']);
354 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
357 if ((count($this->admin_panel_commands) > 0))
359 foreach($this->admin_panel_commands as
$cmd)
361 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
362 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
363 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
364 $this->tpl->parseCurrentBlock();
371 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
373 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW", $lng->txt(
"actions"));
374 $this->tpl->parseCurrentBlock();
375 $adm_view_cmp =
true;
379 if (is_array($this->admin_view_button))
381 if (is_array($this->admin_view_button))
383 $this->tpl->setCurrentBlock(
"lucene_admin_button");
384 $this->tpl->setVariable(
"LUCENE_ADMIN_MODE_LINK",
385 $this->admin_view_button[
"link"]);
386 $this->tpl->setVariable(
"LUCENE_TXT_ADMIN_MODE",
387 $this->admin_view_button[
"txt"]);
388 $this->tpl->parseCurrentBlock();
390 $this->tpl->setCurrentBlock(
"lucene_admin_view");
391 $this->tpl->parseCurrentBlock();
396 if (is_array($this->creation_selector))
398 $this->tpl->setCurrentBlock(
"lucene_add_commands");
401 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
403 $this->tpl->setVariable(
"LUCENE_SELECT_OBJTYPE_REPOS",
404 $this->creation_selector[
"options"]);
405 $this->tpl->setVariable(
"LUCENE_BTN_NAME_REPOS",
406 $this->creation_selector[
"command"]);
407 $this->tpl->setVariable(
"LUCENE_TXT_ADD_REPOS",
408 $this->creation_selector[
"txt"]);
409 $this->tpl->parseCurrentBlock();
410 $creation_selector =
true;
412 if ($adm_view || $creation_selector)
414 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
417 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
419 $this->tpl->parseCurrentBlock();
428 $this->admin_panel_commands[] =
429 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
437 $this->admin_view_button =
438 array(
"link" => $a_link,
"txt" => $a_txt);
443 $this->page_form_action = $a_action;
GUI class for the workflow of copying objects.
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
reset()
Reset search form.
remoteSearch()
Search from main menu.
setPageFormAction($a_action)
executeCommand()
Execute Command.
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
prepareOutput()
Add admin panel command.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct()
Constructor.
static _getInstance($a_usr_id)
Get singleton instance.
static getInstance($a_user_id)
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
initFormSearch()
Show search form.
handleCommand($a_cmd)
Handle command.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initUserSearchCache()
Init user search cache.
Create styles array
The data for the language used.
addAdminPanelCommand($a_cmd, $a_txt)
Add a command to the admin panel.
showSavedResults()
Show saved results.
setAdminViewButton($a_link, $a_txt)
Show admin view button.
performSearch()
Perform search.
static getInstance()
Get singleton instance.