ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLuceneSearchGUI Class Reference

GUI for simple Lucene search More...

+ Inheritance diagram for ilLuceneSearchGUI:
+ Collaboration diagram for ilLuceneSearchGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute Command. More...
 
 prepareOutput ()
 Add admin panel command. More...
 
- Public Member Functions inherited from ilSearchBaseGUI
 ilSearchBaseGUI ()
 Constructor public. More...
 
 prepareOutput ()
 
 initStandardSearchForm ($a_mode)
 Init standard search form. More...
 
 getSearchAreaForm ()
 Init standard search form. More...
 
 handleCommand ($a_cmd)
 Handle command. More...
 
 addToDeskObject ()
 Interface methods. More...
 
 removeFromDeskObject ()
 Remove from dektop. More...
 
 delete ()
 Show deletion screen. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 cancelMoveLinkObject ()
 Cancel move/link. More...
 
 performDelete ()
 Delete objects. More...
 
 cut ()
 Interface ilAdministrationCommandHandler. More...
 
 link ()
 Interface ilAdministrationCommandHandler. More...
 
 paste ()
 Paste. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection link. More...
 
 showMoveIntoObjectTree ()
 Target selection cut. More...
 
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects. More...
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 Enable administration panel. More...
 
 disableAdministrationPanel ()
 Disable administration panel. More...
 
 addLocator ()
 Add Locator. More...
 
 autoComplete ()
 Data resource for autoComplete. More...
 

Protected Member Functions

 getType ()
 Get type of search (details | fast) More...
 
 getDetails ()
 Needed for base class search form. More...
 
 getMimeDetails ()
 Needed for base class search form. More...
 
 remoteSearch ()
 Search from main menu. More...
 
 showSavedResults ()
 Show saved results. More...
 
 search ()
 Search (button pressed) More...
 
 performSearch ()
 Perform search. More...
 
 storeRoot ()
 Store new root node. More...
 
 getTabs ()
 get tabs More...
 
 initUserSearchCache ()
 Init user search cache. More...
 
 fillAdminPanel ()
 Put admin panel into template: More...
 
 addAdminPanelCommand ($a_cmd, $a_txt)
 Add a command to the admin panel. More...
 
 setAdminViewButton ($a_link, $a_txt)
 Show admin view button. More...
 
 setPageFormAction ($a_action)
 
 showSearchForm ()
 Show search form. More...
 
- Protected Member Functions inherited from ilSearchBaseGUI
 addPager ($result, $a_session_key)
 Add Pager. More...
 
 buildSearchAreaPath ($a_root_node)
 Build path for search area. More...
 

Protected Attributes

 $ilTabs
 
- Protected Attributes inherited from ilSearchBaseGUI
 $ctrl = null
 

Additional Inherited Members

- Data Fields inherited from ilSearchBaseGUI
const SEARCH_FAST = 1
 
const SEARCH_DETAILS = 2
 
const SEARCH_AND = 'and'
 
const SEARCH_OR = 'or'
 
const SEARCH_FORM_LUCENE = 1
 
const SEARCH_FORM_STANDARD = 2
 
const SEARCH_FORM_USER = 3
 
 $settings = null
 
 $ilias = null
 
 $lng = null
 
 $tpl = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLuceneSearchGUI::__construct ( )

Constructor.

Definition at line 51 of file class.ilLuceneSearchGUI.php.

References $ilTabs, fields, ilLuceneAdvancedSearchFields\getInstance(), and initUserSearchCache().

52  {
53  global $ilTabs;
54 
55  $this->tabs_gui = $ilTabs;
56  parent::__construct();
58  $this->initUserSearchCache();
59 
60  }
$errors fields
Definition: imgupload.php:48
initUserSearchCache()
Init user search cache.
static getInstance()
Get singleton instance.
+ Here is the call graph for this function:

Member Function Documentation

◆ addAdminPanelCommand()

ilLuceneSearchGUI::addAdminPanelCommand (   $a_cmd,
  $a_txt 
)
protected

Add a command to the admin panel.

Definition at line 514 of file class.ilLuceneSearchGUI.php.

515  {
516  $this->admin_panel_commands[] =
517  array("cmd" => $a_cmd, "txt" => $a_txt);
518  }

◆ executeCommand()

ilLuceneSearchGUI::executeCommand ( )

Execute Command.

Definition at line 65 of file class.ilLuceneSearchGUI.php.

References $cmd, $ilBench, $ilCtrl, ilSearchBaseGUI\getSearchAreaForm(), ilSearchBaseGUI\handleCommand(), ilSearchBaseGUI\initStandardSearchForm(), prepareOutput(), and ilSearchBaseGUI\SEARCH_FORM_LUCENE.

66  {
67  global $ilBench, $ilCtrl;
68 
69  $ilBench->start('Lucene','0900_executeCommand');
70  $next_class = $this->ctrl->getNextClass($this);
71  $cmd = $this->ctrl->getCmd();
72 
73  $this->prepareOutput();
74  switch($next_class)
75  {
76  case "ilpropertyformgui":
77  /*$this->initStandardSearchForm(ilSearchBaseGUI::SEARCH_FORM_LUCENE);
78  $ilCtrl->setReturn($this, 'storeRoot');
79  $ilCtrl->forwardCommand($this->form);*/
80  $form = $this->getSearchAreaForm();
81  $ilCtrl->setReturn($this, 'storeRoot');
82  $ilCtrl->forwardCommand($form);
83  break;
84 
85  case 'ilobjectcopygui':
86  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
87  $cp = new ilObjectCopyGUI($this);
88  $this->ctrl->forwardCommand($cp);
89  break;
90 
91  default:
93  if(!$cmd)
94  {
95  $cmd = "showSavedResults";
96  }
97  $this->handleCommand($cmd);
98  break;
99  }
100  $ilBench->stop('Lucene','0900_executeCommand');
101  return true;
102  }
getSearchAreaForm()
Init standard search form.
GUI class for the workflow of copying objects.
$cmd
Definition: sahs_server.php:35
prepareOutput()
Add admin panel command.
global $ilCtrl
Definition: ilias.php:18
initStandardSearchForm($a_mode)
Init standard search form.
handleCommand($a_cmd)
Handle command.
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ fillAdminPanel()

ilLuceneSearchGUI::fillAdminPanel ( )
protected

Put admin panel into template:

  • creation selector
  • admin view on/off button

Definition at line 438 of file class.ilLuceneSearchGUI.php.

References $cmd, ilSearchBaseGUI\$lng, and ilUtil\getImagePath().

439  {
440  global $lng;
441 
442  $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false;
443 
444  // admin panel commands
445  if ((count($this->admin_panel_commands) > 0))
446  {
447  foreach($this->admin_panel_commands as $cmd)
448  {
449  $this->tpl->setCurrentBlock("lucene_admin_panel_cmd");
450  $this->tpl->setVariable("LUCENE_PANEL_CMD", $cmd["cmd"]);
451  $this->tpl->setVariable("LUCENE_TXT_PANEL_CMD", $cmd["txt"]);
452  $this->tpl->parseCurrentBlock();
453  }
454 
455  $adm_cmds = true;
456  }
457  if ($adm_cmds)
458  {
459  $this->tpl->setCurrentBlock("lucene_adm_view_components");
460  $this->tpl->setVariable("LUCENE_ADM_IMG_ARROW", ilUtil::getImagePath("arrow_upright.svg"));
461  $this->tpl->setVariable("LUCENE_ADM_ALT_ARROW", $lng->txt("actions"));
462  $this->tpl->parseCurrentBlock();
463  $adm_view_cmp = true;
464  }
465 
466  // admin view button
467  if (is_array($this->admin_view_button))
468  {
469  if (is_array($this->admin_view_button))
470  {
471  $this->tpl->setCurrentBlock("lucene_admin_button");
472  $this->tpl->setVariable("LUCENE_ADMIN_MODE_LINK",
473  $this->admin_view_button["link"]);
474  $this->tpl->setVariable("LUCENE_TXT_ADMIN_MODE",
475  $this->admin_view_button["txt"]);
476  $this->tpl->parseCurrentBlock();
477  }
478  $this->tpl->setCurrentBlock("lucene_admin_view");
479  $this->tpl->parseCurrentBlock();
480  $adm_view = true;
481  }
482 
483  // creation selector
484  if (is_array($this->creation_selector))
485  {
486  $this->tpl->setCurrentBlock("lucene_add_commands");
487  if ($adm_cmds)
488  {
489  $this->tpl->setVariable("LUCENE_ADD_COM_WIDTH", 'width="1"');
490  }
491  $this->tpl->setVariable("LUCENE_SELECT_OBJTYPE_REPOS",
492  $this->creation_selector["options"]);
493  $this->tpl->setVariable("LUCENE_BTN_NAME_REPOS",
494  $this->creation_selector["command"]);
495  $this->tpl->setVariable("LUCENE_TXT_ADD_REPOS",
496  $this->creation_selector["txt"]);
497  $this->tpl->parseCurrentBlock();
498  $creation_selector = true;
499  }
500  if ($adm_view || $creation_selector)
501  {
502  $this->tpl->setCurrentBlock("lucene_adm_panel");
503  if ($adm_view_cmp)
504  {
505  $this->tpl->setVariable("LUCENE_ADM_TBL_WIDTH", 'width:"100%";');
506  }
507  $this->tpl->parseCurrentBlock();
508  }
509  }
$cmd
Definition: sahs_server.php:35
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ getDetails()

ilLuceneSearchGUI::getDetails ( )
protected

Needed for base class search form.

Todo:
rename
Returns
type

Definition at line 133 of file class.ilLuceneSearchGUI.php.

134  {
135  return (array) $this->search_cache->getItemFilter();
136  }

◆ getMimeDetails()

ilLuceneSearchGUI::getMimeDetails ( )
protected

Needed for base class search form.

Todo:
rename
Returns
type

Definition at line 143 of file class.ilLuceneSearchGUI.php.

144  {
145  return (array) $this->search_cache->getMimeFilter();
146  }

◆ getTabs()

ilLuceneSearchGUI::getTabs ( )
protected

get tabs

Definition at line 359 of file class.ilLuceneSearchGUI.php.

References fields, and ilSearchSettings\getInstance().

Referenced by prepareOutput().

360  {
361  global $ilHelp;
362 
363  $ilHelp->setScreenIdComponent("src_luc");
364 
365  $this->tabs_gui->addTarget('search',$this->ctrl->getLinkTarget($this));
366 
367  if(ilSearchSettings::getInstance()->isLuceneUserSearchEnabled())
368  {
369  $this->tabs_gui->addTarget('search_user',$this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
370  }
371 
372  if($this->fields->getActiveFields() && !ilSearchSettings::getInstance()->getHideAdvancedSearch())
373  {
374  $this->tabs_gui->addTarget('search_advanced',$this->ctrl->getLinkTargetByClass('illuceneAdvancedSearchgui'));
375  }
376 
377  $this->tabs_gui->setTabActive('search');
378 
379  }
$errors fields
Definition: imgupload.php:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilLuceneSearchGUI::getType ( )
protected

Get type of search (details | fast)

Todo:
rename Needed for base class search form

Definition at line 119 of file class.ilLuceneSearchGUI.php.

References ilSearchBaseGUI\SEARCH_DETAILS, and ilSearchBaseGUI\SEARCH_FAST.

120  {
121  if(count($this->search_cache))
122  {
124  }
126  }

◆ initUserSearchCache()

ilLuceneSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

private

Definition at line 387 of file class.ilLuceneSearchGUI.php.

References $_GET, $_POST, $data, $ilUser, ilUserSearchCache\_getInstance(), ilSearchSettings\getInstance(), ilUserSearchCache\LUCENE_DEFAULT, and ilUtil\stripSlashes().

Referenced by __construct().

388  {
389  global $ilUser;
390 
391  include_once('Services/Search/classes/class.ilUserSearchCache.php');
392  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
393  $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_DEFAULT);
394  if((int) $_GET['page_number'])
395  {
396  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
397  }
398  if(isset($_POST['term']))
399  {
400  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['term']));
401  if($_POST['item_filter_enabled'])
402  {
403  $filtered = array();
404  foreach(ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions() as $type => $data)
405  {
406  if($_POST['filter_type'][$type])
407  {
408  $filtered[$type] = 1;
409  }
410  }
411  $this->search_cache->setItemFilter($filtered);
412 
413  // Mime filter
414  $mime = array();
415  foreach(ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions() as $type => $data)
416  {
417  if($_POST['filter_type'][$type])
418  {
419  $mime[$type] = 1;
420  }
421  }
422  $this->search_cache->setMimeFilter($mime);
423  }
424  else
425  {
426  // @todo: keep item filter settings
427  $this->search_cache->setItemFilter(array());
428  $this->search_cache->setMimeFilter(array());
429  }
430  }
431  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _getInstance($a_usr_id)
Get singleton instance.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilLuceneSearchGUI::performSearch ( )
protected

Perform search.

Definition at line 249 of file class.ilLuceneSearchGUI.php.

References $_SESSION, $ilBench, $ilUser, ilSearchBaseGUI\addPager(), ilSearchSettings\getInstance(), ilLuceneSearcher\getInstance(), ilLuceneSearchResultFilter\getInstance(), ilUtil\sendInfo(), and showSearchForm().

Referenced by search(), and storeRoot().

250  {
251  global $ilUser,$ilBench;
252 
253  unset($_SESSION['vis_references']);
254 
255  $filter_query = '';
256  if($this->search_cache->getItemFilter() and ilSearchSettings::getInstance()->isLuceneItemFilterEnabled())
257  {
258  $filter_settings = ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions();
259  foreach((array) $this->search_cache->getItemFilter() as $obj => $value)
260  {
261  if(!$filter_query)
262  {
263  $filter_query .= '+( ';
264  }
265  else
266  {
267  $filter_query .= 'OR';
268  }
269  $filter_query .= (' '. (string) $filter_settings[$obj]['filter'].' ');
270  }
271  $filter_query .= ') ';
272  }
273  // begin-patch mime_filter
274  $mime_query = '';
275  if($this->search_cache->getMimeFilter() and ilSearchSettings::getInstance()->isLuceneMimeFilterEnabled())
276  {
277  $filter_settings = ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions();
278  foreach($this->search_cache->getMimeFilter() as $mime => $value)
279  {
280  if(!$mime_query)
281  {
282  $mime_query .= '+( ';
283  }
284  else
285  {
286  $mime_query .= 'OR';
287  }
288  $mime_query .= (' '. (string) $filter_settings[$mime]['filter'].' ');
289  }
290  $mime_query .= ') ';
291  }
292  $filter_query = $filter_query . ' '. $mime_query;
293 
294  include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
295  include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
296  $qp = new ilLuceneQueryParser($filter_query.' +('.$this->search_cache->getQuery().')');
297  $qp->parse();
298  $searcher = ilLuceneSearcher::getInstance($qp);
299  $searcher->search();
300 
301  // Filter results
302  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
303  include_once './Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
304  $filter = ilLuceneSearchResultFilter::getInstance($ilUser->getId());
305  $filter->addFilter(new ilLucenePathFilter($this->search_cache->getRoot()));
306  $filter->setCandidates($searcher->getResult());
307  $filter->filter();
308 
309  if($filter->getResultObjIds()) {
310  $searcher->highlight($filter->getResultObjIds());
311  }
312 
313  // Show results
314  $this->showSearchForm();
315 
316  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
317  $presentation = new ilSearchResultPresentation($this);
318  $presentation->setResults($filter->getResultIds());
319  $presentation->setSearcher($searcher);
320 
321  // TODO: other handling required
322  $ilBench->start('Lucene','1500_fo');
323  $this->addPager($filter,'max_page');
324  $ilBench->stop('Lucene','1500_fo');
325 
326  $presentation->setPreviousNext($this->prev_link, $this->next_link);
327 
328  if($presentation->render())
329  {
330  $this->tpl->setVariable('SEARCH_RESULTS',$presentation->getHTML(true));
331  }
332  else
333  {
334  ilUtil::sendInfo(sprintf($this->lng->txt('search_no_match_hint'),$this->search_cache->getQuery()));
335  }
336  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
showSearchForm()
Show search form.
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
global $ilUser
Definition: imgupload.php:15
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilLuceneSearchGUI::prepareOutput ( )

Add admin panel command.

Definition at line 107 of file class.ilLuceneSearchGUI.php.

References getTabs().

Referenced by executeCommand().

108  {
109  parent::prepareOutput();
110  $this->getTabs();
111  return true;
112  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remoteSearch()

ilLuceneSearchGUI::remoteSearch ( )
protected

Search from main menu.

Definition at line 151 of file class.ilLuceneSearchGUI.php.

References $_POST, $query, search(), and ilUtil\stripSlashes().

152  {
153  $query = trim(ilUtil::stripSlashes($_POST['queryString']));
154 
155  include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
156  $qp = new ilLuceneQueryParser($query);
157  $qp->parseAutoWildcard();
158 
159  $query = $qp->getQuery();
160 
161  $this->search_cache->setRoot((int) $_POST['root_id']);
162  $this->search_cache->setQuery(ilUtil::stripSlashes($query));
163  $this->search_cache->save();
164 
165  $this->search();
166  }
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
search()
Search (button pressed)
+ Here is the call graph for this function:

◆ search()

ilLuceneSearchGUI::search ( )
protected

Search (button pressed)

Returns

Definition at line 224 of file class.ilLuceneSearchGUI.php.

References $_SESSION, performSearch(), ilSubItemListGUI\resetDetails(), and showSearchForm().

Referenced by remoteSearch().

225  {
226  if(!$this->form->checkInput())
227  {
228  $this->search_cache->deleteCachedEntries();
229  // Reset details
230  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
232  $this->showSearchForm();
233  return false;
234  }
235 
236  unset($_SESSION['max_page']);
237  $this->search_cache->deleteCachedEntries();
238 
239  // Reset details
240  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
242 
243  $this->performSearch();
244  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
showSearchForm()
Show search form.
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
performSearch()
Perform search.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdminViewButton()

ilLuceneSearchGUI::setAdminViewButton (   $a_link,
  $a_txt 
)
protected

Show admin view button.

Definition at line 523 of file class.ilLuceneSearchGUI.php.

524  {
525  $this->admin_view_button =
526  array("link" => $a_link, "txt" => $a_txt);
527  }

◆ setPageFormAction()

ilLuceneSearchGUI::setPageFormAction (   $a_action)
protected

Definition at line 529 of file class.ilLuceneSearchGUI.php.

530  {
531  $this->page_form_action = $a_action;
532  }

◆ showSavedResults()

ilLuceneSearchGUI::showSavedResults ( )
protected

Show saved results.

Returns

Definition at line 172 of file class.ilLuceneSearchGUI.php.

References $ilBench, $ilUser, ilSearchBaseGUI\addPager(), ilLuceneSearcher\getInstance(), ilLuceneSearchResultFilter\getInstance(), ilLuceneQueryParser\parse(), ilUtil\sendInfo(), and showSearchForm().

173  {
174  global $ilUser,$ilBench;
175 
176  if(!strlen($this->search_cache->getQuery()))
177  {
178  $this->showSearchForm();
179  return false;
180  }
181 
182  include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
183  include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
184  $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
185  $qp->parse();
186  $searcher = ilLuceneSearcher::getInstance($qp);
187  $searcher->search();
188 
189  // Load saved results
190  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
191  $filter = ilLuceneSearchResultFilter::getInstance($ilUser->getId());
192  $filter->loadFromDb();
193 
194  // Highlight
195  $searcher->highlight($filter->getResultObjIds());
196 
197  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
198  $presentation = new ilSearchResultPresentation($this);
199  $presentation->setResults($filter->getResultIds());
200 
201  $presentation->setSearcher($searcher);
202 
203  // TODO: other handling required
204  $this->addPager($filter,'max_page');
205 
206  $presentation->setPreviousNext($this->prev_link, $this->next_link);
207 
208  $this->showSearchForm();
209 
210  if($presentation->render())
211  {
212  $this->tpl->setVariable('SEARCH_RESULTS',$presentation->getHTML(true));
213  }
214  elseif(strlen($this->search_cache->getQuery()))
215  {
216  ilUtil::sendInfo(sprintf($this->lng->txt('search_no_match_hint'),$qp->getQuery()));
217  }
218  }
showSearchForm()
Show search form.
parse()
parse query string
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
global $ilUser
Definition: imgupload.php:15
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneSearchGUI::showSearchForm ( )
protected

Show search form.

Returns
boolean

Definition at line 538 of file class.ilLuceneSearchGUI.php.

References $ilCtrl, ilSearchBaseGUI\$lng, ilGlyphGUI\CARET, ilGlyphGUI\get(), ilSubmitButton\getInstance(), ilSearchSettings\getInstance(), ilSearchBaseGUI\getSearchAreaForm(), ilOverlayGUI\initJavascript(), ilSearchSettings\OPERATOR_AND, and ilUtil\prepareFormOutput().

Referenced by performSearch(), search(), and showSavedResults().

539  {
540  global $ilCtrl, $lng;
541 
542  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lucene_search.html','Services/Search');
543 
544  // include js needed
545  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
547  $this->tpl->addJavascript("./Services/Search/js/Search.js");
548 
549  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
550 
551  $this->tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this,'performSearch'));
552  $this->tpl->setVariable("TERM", ilUtil::prepareFormOutput($this->search_cache->getQuery()));
553  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
555  $btn->setCommand("performSearch");
556  $btn->setCaption("search");
557  $this->tpl->setVariable("SUBMIT_BTN",$btn->render());
558  $this->tpl->setVariable("TXT_OPTIONS", $lng->txt("options"));
559  $this->tpl->setVariable("ARR_IMG", ilGlyphGUI::get(ilGlyphGUI::CARET));
560  $this->tpl->setVariable("TXT_COMBINATION", $lng->txt("search_term_combination"));
561  $this->tpl->setVariable('TXT_COMBINATION_DEFAULT', ilSearchSettings::getInstance()->getDefaultOperator() == ilSearchSettings::OPERATOR_AND ? $lng->txt('search_all_words') : $lng->txt('search_any_word'));
562  $this->tpl->setVariable("TXT_AREA", $lng->txt("search_area"));
563 
564  if (ilSearchSettings::getInstance()->isLuceneItemFilterEnabled())
565  {
566  $this->tpl->setCurrentBlock("type_sel");
567  $this->tpl->setVariable('TXT_TYPE_DEFAULT',$lng->txt("search_off"));
568  $this->tpl->setVariable("ARR_IMGT", ilGlyphGUI::get(ilGlyphGUI::CARET));
569  $this->tpl->setVariable("TXT_FILTER_BY_TYPE", $lng->txt("search_filter_by_type"));
570  $this->tpl->setVariable('FORM',$this->form->getHTML());
571  $this->tpl->parseCurrentBlock();
572  }
573 
574  // search area form
575  $this->tpl->setVariable('SEARCH_AREA_FORM', $this->getSearchAreaForm()->getHTML());
576  $this->tpl->setVariable("TXT_CHANGE", $lng->txt("change"));
577 
578  return true;
579  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getSearchAreaForm()
Init standard search form.
static get($a_glyph, $a_text="")
Get glyph html.
global $ilCtrl
Definition: ilias.php:18
static initJavascript()
Init javascript.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeRoot()

ilLuceneSearchGUI::storeRoot ( )
protected

Store new root node.

Definition at line 341 of file class.ilLuceneSearchGUI.php.

References ilSearchBaseGUI\getSearchAreaForm(), performSearch(), and ilSubItemListGUI\resetDetails().

342  {
343  $form = $this->getSearchAreaForm();
344 
345  $this->root_node = $form->getItemByPostVar('area')->getValue();
346  $this->search_cache->setRoot($this->root_node);
347  $this->search_cache->save();
348  $this->search_cache->deleteCachedEntries();
349 
350  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
352 
353  $this->performSearch();
354  }
getSearchAreaForm()
Init standard search form.
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
performSearch()
Perform search.
+ Here is the call graph for this function:

Field Documentation

◆ $ilTabs

ilLuceneSearchGUI::$ilTabs
protected

Definition at line 46 of file class.ilLuceneSearchGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: