ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLuceneUserSearchGUI Class Reference

GUI for Lucene user search More...

+ Inheritance diagram for ilLuceneUserSearchGUI:
+ Collaboration diagram for ilLuceneUserSearchGUI:

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...
 
 remoteSearch ()
 Search from main menu. More...
 
 showSavedResults ()
 Show saved results. More...
 
 search ()
 Search (button pressed) More...
 
 performSearch ()
 Perform search. More...
 
 getTabs ()
 get tabs More...
 
 initUserSearchCache ()
 Init user search cache. More...
 
 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()

ilLuceneUserSearchGUI::__construct ( )

Constructor.

Definition at line 27 of file class.ilLuceneUserSearchGUI.php.

References $ilTabs, and initUserSearchCache().

28  {
29  global $ilTabs;
30 
31  $this->tabs_gui = $ilTabs;
32  parent::__construct();
33  $this->initUserSearchCache();
34 
35  }
initUserSearchCache()
Init user search cache.
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilLuceneUserSearchGUI::executeCommand ( )

Execute Command.

Definition at line 40 of file class.ilLuceneUserSearchGUI.php.

References $_REQUEST, $cmd, $GLOBALS, $ilBench, $ilCtrl, $ret, ilSearchBaseGUI\handleCommand(), ilSearchBaseGUI\initStandardSearchForm(), prepareOutput(), and ilSearchBaseGUI\SEARCH_FORM_USER.

41  {
42  global $ilBench, $ilCtrl;
43 
44  $next_class = $this->ctrl->getNextClass($this);
45  $cmd = $this->ctrl->getCmd();
46 
47  $this->prepareOutput();
48  switch($next_class)
49  {
50  case "ilpublicuserprofilegui":
51  include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
52  $profile = new ilPublicUserProfileGUI((int) $_REQUEST['user']);
53  $profile->setBackUrl($this->ctrl->getLinkTarget($this,'showSavedResults'));
54  $ret = $ilCtrl->forwardCommand($profile);
55  $GLOBALS['tpl']->setContent($ret);
56  break;
57 
58 
59  default:
61  if(!$cmd)
62  {
63  $cmd = "showSavedResults";
64  }
65  $this->handleCommand($cmd);
66  break;
67  }
68  return true;
69  }
prepareOutput()
Add admin panel command.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
GUI class for public user profile presentation.
$GLOBALS['ct_recipient']
initStandardSearchForm($a_mode)
Init standard search form.
handleCommand($a_cmd)
Handle command.
global $ilBench
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ getDetails()

ilLuceneUserSearchGUI::getDetails ( )
protected

Needed for base class search form.

Todo:
rename
Returns
type

Definition at line 103 of file class.ilLuceneUserSearchGUI.php.

104  {
105  return (array) $this->search_cache->getItemFilter();
106  }

◆ getTabs()

ilLuceneUserSearchGUI::getTabs ( )
protected

get tabs

Definition at line 197 of file class.ilLuceneUserSearchGUI.php.

References ilSearchSettings\getInstance(), and ilLuceneAdvancedSearchFields\getInstance().

Referenced by prepareOutput().

198  {
199  $this->tabs_gui->addTarget('search',$this->ctrl->getLinkTargetByClass('illucenesearchgui'));
200 
201  if(ilSearchSettings::getInstance()->isLuceneUserSearchEnabled())
202  {
203  $this->tabs_gui->addTarget('search_user',$this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
204  }
205 
207 
208  if(
209  !ilSearchSettings::getInstance()->getHideAdvancedSearch() and
210  $fields->getActiveFields())
211  {
212  $this->tabs_gui->addTarget('search_advanced',$this->ctrl->getLinkTargetByClass('illuceneadvancedsearchgui'));
213  }
214 
215  $this->tabs_gui->setTabActive('search_user');
216  }
static getInstance()
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilLuceneUserSearchGUI::getType ( )
protected

Get type of search (details | fast)

Todo:
rename Needed for base class search form

Definition at line 89 of file class.ilLuceneUserSearchGUI.php.

References ilSearchBaseGUI\SEARCH_DETAILS, and ilSearchBaseGUI\SEARCH_FAST.

90  {
91  if(count($this->search_cache))
92  {
94  }
96  }

◆ initUserSearchCache()

ilLuceneUserSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

private

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

References $_GET, $_POST, $ilUser, ilUserSearchCache\_getInstance(), ilUserSearchCache\LUCENE_USER_SEARCH, and ilUtil\stripSlashes().

Referenced by __construct().

225  {
226  global $ilUser;
227 
228  include_once('Services/Search/classes/class.ilUserSearchCache.php');
229  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
230  $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_USER_SEARCH);
231  if((int) $_GET['page_number'])
232  {
233  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
234  }
235  if(isset($_POST['term']))
236  {
237  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['term']));
238  $this->search_cache->setItemFilter(array());
239  $this->search_cache->setMimeFilter(array());
240  $this->search_cache->save();
241  }
242  }
$_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()

ilLuceneUserSearchGUI::performSearch ( )
protected

Perform search.

Definition at line 167 of file class.ilLuceneUserSearchGUI.php.

References $GLOBALS, ilLuceneSearcher\getInstance(), ilLuceneQueryParser\parse(), showSearchForm(), ilRepositoryUserResultTableGUI\TYPE_GLOBAL_SEARCH, and ilLuceneSearcher\TYPE_USER.

Referenced by search(), and showSavedResults().

168  {
169  include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
170  include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
171  $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
172  $qp->parse();
173  $searcher = ilLuceneSearcher::getInstance($qp);
174  $searcher->setType(ilLuceneSearcher::TYPE_USER);
175  $searcher->search();
176 
177  $this->showSearchForm();
178 
179  include_once './Services/Search/classes/class.ilRepositoryUserResultTableGUI.php';
180  $user_table = new ilRepositoryUserResultTableGUI(
181  $this,
182  'performSearch',
183  false,
185  );
186  $user_table->setLuceneResult($searcher->getResult());
187  $user_table->parseUserIds($searcher->getResult()->getCandidates());
188 
189  $GLOBALS['tpl']->setVariable('SEARCH_RESULTS',$user_table->getHTML());
190 
191  return true;
192  }
parse()
parse query string
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
$GLOBALS['ct_recipient']
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilLuceneUserSearchGUI::prepareOutput ( )

Add admin panel command.

Todo:

Definition at line 75 of file class.ilLuceneUserSearchGUI.php.

References getTabs().

Referenced by executeCommand().

76  {
77  parent::prepareOutput();
78  $this->getTabs();
79  return true;
80  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remoteSearch()

ilLuceneUserSearchGUI::remoteSearch ( )
protected

Search from main menu.

Definition at line 112 of file class.ilLuceneUserSearchGUI.php.

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

113  {
114  $_POST['query'] = $_POST['queryString'];
115  $this->search_cache->setRoot((int) $_POST['root_id']);
116  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['queryString']));
117  $this->search_cache->save();
118 
119  $this->search();
120  }
$_POST['username']
Definition: cron.php:12
search()
Search (button pressed)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ search()

ilLuceneUserSearchGUI::search ( )
protected

Search (button pressed)

Returns

Definition at line 142 of file class.ilLuceneUserSearchGUI.php.

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

Referenced by remoteSearch().

143  {
144  if(!$this->form->checkInput())
145  {
146  $this->search_cache->deleteCachedEntries();
147  // Reset details
148  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
150  $this->showSearchForm();
151  return false;
152  }
153 
154  unset($_SESSION['max_page']);
155  $this->search_cache->deleteCachedEntries();
156 
157  // Reset details
158  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
160 
161  $this->performSearch();
162  }
< 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']
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSavedResults()

ilLuceneUserSearchGUI::showSavedResults ( )
protected

Show saved results.

Returns

Definition at line 126 of file class.ilLuceneUserSearchGUI.php.

References $ilBench, $ilUser, performSearch(), and showSearchForm().

127  {
128  global $ilUser,$ilBench;
129 
130  if(strlen($this->search_cache->getQuery()))
131  {
132  return $this->performSearch();
133  }
134 
135  return $this->showSearchForm();
136  }
global $ilUser
Definition: imgupload.php:15
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneUserSearchGUI::showSearchForm ( )
protected

Show search form.

Returns
boolean

Definition at line 250 of file class.ilLuceneUserSearchGUI.php.

References $GLOBALS, $ilCtrl, ilSearchBaseGUI\$lng, ilOverlayGUI\initJavascript(), and ilUtil\prepareFormOutput().

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

251  {
252  global $ilCtrl, $lng;
253 
254  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lucene_usr_search.html','Services/Search');
255 
256  // include js needed
257  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
259  $this->tpl->addJavascript("./Services/Search/js/Search.js");
260 
261  $this->tpl->setVariable('FORM_ACTION',$GLOBALS['ilCtrl']->getFormAction($this,'performSearch'));
262  $this->tpl->setVariable("TERM", ilUtil::prepareFormOutput($this->search_cache->getQuery()));
263  $this->tpl->setVariable("TXT_SEARCH", $lng->txt("search"));
264 
265  return true;
266  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
global $ilCtrl
Definition: ilias.php:18
$GLOBALS['ct_recipient']
static initJavascript()
Init javascript.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ilTabs

ilLuceneUserSearchGUI::$ilTabs
protected

Definition at line 22 of file class.ilLuceneUserSearchGUI.php.

Referenced by __construct().


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