ILIAS  release_4-4 Revision
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...
 
 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:47
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 508 of file class.ilLuceneSearchGUI.php.

509  {
510  $this->admin_panel_commands[] =
511  array("cmd" => $a_cmd, "txt" => $a_txt);
512  }

◆ 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 432 of file class.ilLuceneSearchGUI.php.

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

433  {
434  global $lng;
435 
436  $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false;
437 
438  // admin panel commands
439  if ((count($this->admin_panel_commands) > 0))
440  {
441  foreach($this->admin_panel_commands as $cmd)
442  {
443  $this->tpl->setCurrentBlock("lucene_admin_panel_cmd");
444  $this->tpl->setVariable("LUCENE_PANEL_CMD", $cmd["cmd"]);
445  $this->tpl->setVariable("LUCENE_TXT_PANEL_CMD", $cmd["txt"]);
446  $this->tpl->parseCurrentBlock();
447  }
448 
449  $adm_cmds = true;
450  }
451  if ($adm_cmds)
452  {
453  $this->tpl->setCurrentBlock("lucene_adm_view_components");
454  $this->tpl->setVariable("LUCENE_ADM_IMG_ARROW", ilUtil::getImagePath("arrow_upright.png"));
455  $this->tpl->setVariable("LUCENE_ADM_ALT_ARROW", $lng->txt("actions"));
456  $this->tpl->parseCurrentBlock();
457  $adm_view_cmp = true;
458  }
459 
460  // admin view button
461  if (is_array($this->admin_view_button))
462  {
463  if (is_array($this->admin_view_button))
464  {
465  $this->tpl->setCurrentBlock("lucene_admin_button");
466  $this->tpl->setVariable("LUCENE_ADMIN_MODE_LINK",
467  $this->admin_view_button["link"]);
468  $this->tpl->setVariable("LUCENE_TXT_ADMIN_MODE",
469  $this->admin_view_button["txt"]);
470  $this->tpl->parseCurrentBlock();
471  }
472  $this->tpl->setCurrentBlock("lucene_admin_view");
473  $this->tpl->parseCurrentBlock();
474  $adm_view = true;
475  }
476 
477  // creation selector
478  if (is_array($this->creation_selector))
479  {
480  $this->tpl->setCurrentBlock("lucene_add_commands");
481  if ($adm_cmds)
482  {
483  $this->tpl->setVariable("LUCENE_ADD_COM_WIDTH", 'width="1"');
484  }
485  $this->tpl->setVariable("LUCENE_SELECT_OBJTYPE_REPOS",
486  $this->creation_selector["options"]);
487  $this->tpl->setVariable("LUCENE_BTN_NAME_REPOS",
488  $this->creation_selector["command"]);
489  $this->tpl->setVariable("LUCENE_TXT_ADD_REPOS",
490  $this->creation_selector["txt"]);
491  $this->tpl->parseCurrentBlock();
492  $creation_selector = true;
493  }
494  if ($adm_view || $creation_selector)
495  {
496  $this->tpl->setCurrentBlock("lucene_adm_panel");
497  if ($adm_view_cmp)
498  {
499  $this->tpl->setVariable("LUCENE_ADM_TBL_WIDTH", 'width:"100%";');
500  }
501  $this->tpl->parseCurrentBlock();
502  }
503  }
$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 352 of file class.ilLuceneSearchGUI.php.

References fields, and ilSearchSettings\getInstance().

Referenced by prepareOutput().

353  {
354  if(ilSearchSettings::getInstance()->getHideAdvancedSearch())
355  {
356  return false;
357  }
358 
359  $this->tabs_gui->addTarget('search',$this->ctrl->getLinkTarget($this));
360 
361  if(ilSearchSettings::getInstance()->isLuceneUserSearchEnabled())
362  {
363  $this->tabs_gui->addTarget('search_user',$this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
364  }
365 
366  if($this->fields->getActiveFields())
367  {
368  $this->tabs_gui->addTarget('search_advanced',$this->ctrl->getLinkTargetByClass('illuceneAdvancedSearchgui'));
369  }
370 
371  $this->tabs_gui->setTabActive('search');
372 
373  }
$errors fields
Definition: imgupload.php:47
+ 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 381 of file class.ilLuceneSearchGUI.php.

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

Referenced by __construct().

382  {
383  global $ilUser;
384 
385  include_once('Services/Search/classes/class.ilUserSearchCache.php');
386  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
387  $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_DEFAULT);
388  if((int) $_GET['page_number'])
389  {
390  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
391  }
392  if(isset($_POST['term']))
393  {
394  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['term']));
395  if($_POST['item_filter_enabled'])
396  {
397  $filtered = array();
398  foreach(ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions() as $type => $data)
399  {
400  if($_POST['filter_type'][$type])
401  {
402  $filtered[$type] = 1;
403  }
404  }
405  $this->search_cache->setItemFilter($filtered);
406 
407  // Mime filter
408  $mime = array();
409  foreach(ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions() as $type => $data)
410  {
411  if($_POST['filter_type'][$type])
412  {
413  $mime[$type] = 1;
414  }
415  }
416  $this->search_cache->setMimeFilter($mime);
417  }
418  else
419  {
420  // @todo: keep item filter settings
421  $this->search_cache->setItemFilter(array());
422  $this->search_cache->setMimeFilter(array());
423  }
424  }
425  }
$_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
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
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 242 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().

243  {
244  global $ilUser,$ilBench;
245 
246  unset($_SESSION['vis_references']);
247 
248  $filter_query = '';
249  if($this->search_cache->getItemFilter() and ilSearchSettings::getInstance()->isLuceneItemFilterEnabled())
250  {
251  $filter_settings = ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions();
252  foreach((array) $this->search_cache->getItemFilter() as $obj => $value)
253  {
254  if(!$filter_query)
255  {
256  $filter_query .= '+( ';
257  }
258  else
259  {
260  $filter_query .= 'OR';
261  }
262  $filter_query .= (' '. (string) $filter_settings[$obj]['filter'].' ');
263  }
264  $filter_query .= ') ';
265  }
266  // begin-patch mime_filter
267  $mime_query = '';
268  if($this->search_cache->getMimeFilter() and ilSearchSettings::getInstance()->isLuceneMimeFilterEnabled())
269  {
270  $filter_settings = ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions();
271  foreach($this->search_cache->getMimeFilter() as $mime => $value)
272  {
273  if(!$mime_query)
274  {
275  $mime_query .= '+( ';
276  }
277  else
278  {
279  $mime_query .= 'OR';
280  }
281  $mime_query .= (' '. (string) $filter_settings[$mime]['filter'].' ');
282  }
283  $mime_query .= ') ';
284  }
285  $filter_query = $filter_query . ' '. $mime_query;
286 
287  include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
288  include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
289  $qp = new ilLuceneQueryParser($filter_query.' +('.$this->search_cache->getQuery().')');
290  $qp->parse();
291  $searcher = ilLuceneSearcher::getInstance($qp);
292  $searcher->search();
293 
294  // Filter results
295  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
296  include_once './Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
297  $filter = ilLuceneSearchResultFilter::getInstance($ilUser->getId());
298  $filter->addFilter(new ilLucenePathFilter($this->search_cache->getRoot()));
299  $filter->setCandidates($searcher->getResult());
300  $filter->filter();
301 
302  if($filter->getResultObjIds()) {
303  $searcher->highlight($filter->getResultObjIds());
304  }
305 
306  // Show results
307  $this->showSearchForm();
308 
309  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
310  $presentation = new ilSearchResultPresentation($this);
311  $presentation->setResults($filter->getResultIds());
312  $presentation->setSearcher($searcher);
313 
314  // TODO: other handling required
315  $ilBench->start('Lucene','1500_fo');
316  $this->addPager($filter,'max_page');
317  $ilBench->stop('Lucene','1500_fo');
318 
319  $presentation->setPreviousNext($this->prev_link, $this->next_link);
320 
321  if($presentation->render())
322  {
323  $this->tpl->setVariable('SEARCH_RESULTS',$presentation->getHTML(true));
324  }
325  else
326  {
327  ilUtil::sendInfo(sprintf($this->lng->txt('search_no_match_hint'),$this->search_cache->getQuery()));
328  }
329  }
< 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, search(), and ilUtil\stripSlashes().

152  {
153  $_POST['query'] = $_POST['queryString'];
154  $this->search_cache->setRoot((int) $_POST['root_id']);
155  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['queryString']));
156  $this->search_cache->save();
157 
158  $this->search();
159  }
$_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 217 of file class.ilLuceneSearchGUI.php.

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

Referenced by remoteSearch().

218  {
219  if(!$this->form->checkInput())
220  {
221  $this->search_cache->deleteCachedEntries();
222  // Reset details
223  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
225  $this->showSearchForm();
226  return false;
227  }
228 
229  unset($_SESSION['max_page']);
230  $this->search_cache->deleteCachedEntries();
231 
232  // Reset details
233  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
235 
236  $this->performSearch();
237  }
< 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 517 of file class.ilLuceneSearchGUI.php.

518  {
519  $this->admin_view_button =
520  array("link" => $a_link, "txt" => $a_txt);
521  }

◆ setPageFormAction()

ilLuceneSearchGUI::setPageFormAction (   $a_action)
protected

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

524  {
525  $this->page_form_action = $a_action;
526  }

◆ showSavedResults()

ilLuceneSearchGUI::showSavedResults ( )
protected

Show saved results.

Returns

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

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

166  {
167  global $ilUser,$ilBench;
168 
169  if(!strlen($this->search_cache->getQuery()))
170  {
171  $this->showSearchForm();
172  return false;
173  }
174 
175  include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
176  include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
177  $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
178  $qp->parse();
179  $searcher = ilLuceneSearcher::getInstance($qp);
180  $searcher->search();
181 
182  // Load saved results
183  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
184  $filter = ilLuceneSearchResultFilter::getInstance($ilUser->getId());
185  $filter->loadFromDb();
186 
187  // Highlight
188  $searcher->highlight($filter->getResultObjIds());
189 
190  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
191  $presentation = new ilSearchResultPresentation($this);
192  $presentation->setResults($filter->getResultIds());
193 
194  $presentation->setSearcher($searcher);
195 
196  // TODO: other handling required
197  $this->addPager($filter,'max_page');
198 
199  $presentation->setPreviousNext($this->prev_link, $this->next_link);
200 
201  $this->showSearchForm();
202 
203  if($presentation->render())
204  {
205  $this->tpl->setVariable('SEARCH_RESULTS',$presentation->getHTML(true));
206  }
207  elseif(strlen($this->search_cache->getQuery()))
208  {
209  ilUtil::sendInfo(sprintf($this->lng->txt('search_no_match_hint'),$qp->getQuery()));
210  }
211  }
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 532 of file class.ilLuceneSearchGUI.php.

References $ilCtrl, ilSearchBaseGUI\$lng, ilUtil\getImagePath(), ilSearchSettings\getInstance(), ilSearchBaseGUI\getSearchAreaForm(), ilUtil\img(), ilOverlayGUI\initJavascript(), ilSearchSettings\OPERATOR_AND, and ilUtil\prepareFormOutput().

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

533  {
534  global $ilCtrl, $lng;
535 
536  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lucene_search.html','Services/Search');
537 
538  // include js needed
539  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
541  $this->tpl->addJavascript("./Services/Search/js/Search.js");
542 
543  $this->tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this,'performSearch'));
544  $this->tpl->setVariable("TERM", ilUtil::prepareFormOutput($this->search_cache->getQuery()));
545  $this->tpl->setVariable("TXT_SEARCH", $lng->txt("search"));
546  $this->tpl->setVariable("TXT_OPTIONS", $lng->txt("options"));
547  $this->tpl->setVariable("ARR_IMG", ilUtil::img(ilUtil::getImagePath("mm_down_arrow_dark.png")));
548  $this->tpl->setVariable("TXT_COMBINATION", $lng->txt("search_term_combination"));
549  $this->tpl->setVariable('TXT_COMBINATION_DEFAULT', ilSearchSettings::getInstance()->getDefaultOperator() == ilSearchSettings::OPERATOR_AND ? $lng->txt('search_all_words') : $lng->txt('search_any_word'));
550  $this->tpl->setVariable("TXT_AREA", $lng->txt("search_area"));
551 
552  if (ilSearchSettings::getInstance()->isLuceneItemFilterEnabled())
553  {
554  $this->tpl->setCurrentBlock("type_sel");
555  $this->tpl->setVariable('TXT_TYPE_DEFAULT',$lng->txt("search_off"));
556  $this->tpl->setVariable("ARR_IMGT", ilUtil::img(ilUtil::getImagePath("mm_down_arrow_dark.png")));
557  $this->tpl->setVariable("TXT_FILTER_BY_TYPE", $lng->txt("search_filter_by_type"));
558  $this->tpl->setVariable('FORM',$this->form->getHTML());
559  $this->tpl->parseCurrentBlock();
560  }
561 
562  // search area form
563  $this->tpl->setVariable('SEARCH_AREA_FORM', $this->getSearchAreaForm()->getHTML());
564  $this->tpl->setVariable("TXT_CHANGE", $lng->txt("change"));
565 
566  return true;
567  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getSearchAreaForm()
Init standard search form.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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 334 of file class.ilLuceneSearchGUI.php.

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

335  {
336  $form = $this->getSearchAreaForm();
337 
338  $this->root_node = $form->getItemByPostVar('area')->getValue();
339  $this->search_cache->setRoot($this->root_node);
340  $this->search_cache->save();
341  $this->search_cache->deleteCachedEntries();
342 
343  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
345 
346  $this->performSearch();
347  }
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: