ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLuceneUserSearchGUI Class Reference

@classDescription 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
 __construct ()
 Constructor @access 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...
 
 showPasteTree ()
 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...
 
 keepObjectsInClipboardObject ()
 cancel action but keep objects in clipboard
Returns
void
More...
 
 addLocator ()
 Add Locator. More...
 
 autoComplete ()
 Data resource for autoComplete. More...
 
 addToDeskObject ()
 Add desktop item @access public. More...
 
 removeFromDeskObject ()
 Remove from desktop @access public. More...
 
 delete ()
 Show delete confirmation. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 performDelete ()
 Perform Delete. More...
 
 cut ()
 Cut object. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection link. More...
 
 showPasteTree ()
 Target selection cut. More...
 
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects. More...
 
 paste ()
 Paste. More...
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 Enable administration panel. More...
 
 disableAdministrationPanel ()
 Disable administration panel. More...
 
 cancelMoveLinkObject ()
 Cancel move/link. More...
 
 keepObjectsInClipboardObject ()
 cancel action but keep objects in clipboard 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...
 
 getCreationDateForm ()
 
 getSearchCache ()
 Get user search cache. More...
 
 loadCreationFilter ()
 Load creation date filter. More...
 

Protected Attributes

 $ilTabs
 
- Protected Attributes inherited from ilSearchBaseGUI
 $settings = null
 
 $ctrl = null
 
 $favourites
 
 $user
 

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
 
 $ilias = null
 
 $lng = null
 
 $tpl = null
 

Detailed Description

@classDescription GUI for Lucene user search

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

@ilCtrl_Calls ilLuceneUserSearchGUI: ilPublicUserProfileGUI @ilCtrl_IsCalledBy ilLuceneUserSearchGUI: ilSearchController

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

Constructor & Destructor Documentation

◆ __construct()

ilLuceneUserSearchGUI::__construct ( )

Constructor.

Reimplemented from ilSearchBaseGUI.

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

28 {
29 global $DIC;
30
31 $ilTabs = $DIC['ilTabs'];
32
33 $this->tabs_gui = $ilTabs;
35 $this->initUserSearchCache();
36 }
initUserSearchCache()
Init user search cache.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, $ilTabs, ILIAS\GlobalScreen\Provider\__construct(), and initUserSearchCache().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilLuceneUserSearchGUI::executeCommand ( )

Execute Command.

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

42 {
43 global $DIC;
44
45 $ilBench = $DIC['ilBench'];
46 $ilCtrl = $DIC['ilCtrl'];
47
48 $next_class = $this->ctrl->getNextClass($this);
49 $cmd = $this->ctrl->getCmd();
50
51 $this->prepareOutput();
52 switch ($next_class) {
53 case "ilpublicuserprofilegui":
54 include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
55 $profile = new ilPublicUserProfileGUI((int) $_REQUEST['user']);
56 $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'showSavedResults'));
57 $ret = $ilCtrl->forwardCommand($profile);
58 $GLOBALS['DIC']['tpl']->setContent($ret);
59 break;
60
61
62 default:
64 if (!$cmd) {
65 $cmd = "showSavedResults";
66 }
67 $this->handleCommand($cmd);
68 break;
69 }
70 return true;
71 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
prepareOutput()
Add admin panel command.
GUI class for public user profile presentation.
initStandardSearchForm($a_mode)
Init standard search form.
handleCommand($a_cmd)
Handle command.
global $ilBench
Definition: ilias.php:18
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

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

+ 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 104 of file class.ilLuceneUserSearchGUI.php.

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

◆ getTabs()

ilLuceneUserSearchGUI::getTabs ( )
protected

get tabs

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

200 {
201 global $DIC;
202
203 $ilHelp = $DIC['ilHelp'];
204
205 $ilHelp->setScreenIdComponent("src_luc");
206
207 $this->tabs_gui->addTarget('search', $this->ctrl->getLinkTargetByClass('illucenesearchgui'));
208
209 if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
210 $this->tabs_gui->addTarget('search_user', $this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
211 }
212
214
215 if (
216 !ilSearchSettings::getInstance()->getHideAdvancedSearch() and
217 $fields->getActiveFields()) {
218 $this->tabs_gui->addTarget('search_advanced', $this->ctrl->getLinkTargetByClass('illuceneadvancedsearchgui'));
219 }
220
221 $this->tabs_gui->setTabActive('search_user');
222 }
static getInstance()
Get singleton instance.

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

Referenced by prepareOutput().

+ 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 91 of file class.ilLuceneUserSearchGUI.php.

92 {
93 if (count($this->search_cache)) {
95 }
97 }

References ilSearchBaseGUI\SEARCH_DETAILS, and ilSearchBaseGUI\SEARCH_FAST.

◆ initUserSearchCache()

ilLuceneUserSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

@access private

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

231 {
232 global $DIC;
233
234 $ilUser = $DIC['ilUser'];
235
236 include_once('Services/Search/classes/class.ilUserSearchCache.php');
237 $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
238 $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_USER_SEARCH);
239 if ((int) $_GET['page_number']) {
240 $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
241 }
242 if (isset($_POST['term'])) {
243 $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['term']));
244 $this->search_cache->setItemFilter(array());
245 $this->search_cache->setMimeFilter(array());
246 $this->search_cache->save();
247 }
248 }
$_GET["client_id"]
$_POST["username"]
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
$ilUser
Definition: imgupload.php:18

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

Referenced by __construct().

+ 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 169 of file class.ilLuceneUserSearchGUI.php.

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

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

Referenced by search(), and showSavedResults().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilLuceneUserSearchGUI::prepareOutput ( )

Add admin panel command.

Todo:

Reimplemented from ilSearchBaseGUI.

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

78 {
79 parent::prepareOutput();
80 $this->getTabs();
81 return true;
82 }

References getTabs().

Referenced by executeCommand().

+ 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 113 of file class.ilLuceneUserSearchGUI.php.

114 {
115 $_POST['query'] = $_POST['queryString'];
116 $this->search_cache->setRoot((int) $_POST['root_id']);
117 $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['queryString']));
118 $this->search_cache->save();
119
120 $this->search();
121 }
search()
Search (button pressed)

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

+ Here is the call graph for this function:

◆ search()

ilLuceneUserSearchGUI::search ( )
protected

Search (button pressed)

Returns

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

146 {
147 if (!$this->form->checkInput()) {
148 $this->search_cache->deleteCachedEntries();
149 // Reset details
150 include_once './Services/Object/classes/class.ilSubItemListGUI.php';
152 $this->showSearchForm();
153 return false;
154 }
155
156 unset($_SESSION['max_page']);
157 $this->search_cache->deleteCachedEntries();
158
159 // Reset details
160 include_once './Services/Object/classes/class.ilSubItemListGUI.php';
162
163 $this->performSearch();
164 }
$_SESSION["AccountId"]
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final

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

Referenced by remoteSearch().

+ 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 127 of file class.ilLuceneUserSearchGUI.php.

128 {
129 global $DIC;
130
131 $ilUser = $DIC['ilUser'];
132 $ilBench = $DIC['ilBench'];
133
134 if (strlen($this->search_cache->getQuery())) {
135 return $this->performSearch();
136 }
137
138 return $this->showSearchForm();
139 }

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

+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneUserSearchGUI::showSearchForm ( )
protected

Show search form.

Returns
boolean

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

257 {
258 global $DIC;
259
260 $ilCtrl = $DIC['ilCtrl'];
261 $lng = $DIC['lng'];
262
263 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lucene_usr_search.html', 'Services/Search');
264
265 // include js needed
266 include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
268 $this->tpl->addJavascript("./Services/Search/js/Search.js");
269
270 $this->tpl->setVariable('FORM_ACTION', $GLOBALS['DIC']['ilCtrl']->getFormAction($this, 'performSearch'));
271 $this->tpl->setVariable("TERM", ilUtil::prepareFormOutput($this->search_cache->getQuery()));
272 $this->tpl->setVariable("SEARCH_LABEL", $lng->txt("search"));
273 include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
275 $btn->setCommand("performSearch");
276 $btn->setCaption("search");
277 $this->tpl->setVariable("SUBMIT_BTN", $btn->render());
278
279 return true;
280 }
static initJavascript()
Init javascript.
static getInstance()
Factory.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

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

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

+ 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: