19declare(strict_types=1);
51 $this->
tabs = $DIC->tabs();
52 $this->
help = $DIC->help();
53 $this->
ctrl = $DIC->ctrl();
54 $this->
lng = $DIC->language();
55 $this->
lng->loadLanguageModule(
'search');
56 $this->tpl =
$DIC->ui()->mainTemplate();
57 $this->
user = $DIC->user();
58 $this->
http = $DIC->http();
68 $next_class = $this->
ctrl->getNextClass($this);
69 $cmd = $this->
ctrl->getCmd();
72 switch ($next_class) {
73 case strtolower(PublicProfileGUI::class):
76 if ($this->
http->wrapper()->query()->has(
'user_id')) {
83 $profile->setBackUrl($this->
ctrl->getLinkTarget($this,
'showSavedResults'));
84 $ret = $this->
ctrl->forwardCommand($profile);
85 $this->tpl->setContent($ret);
91 $cmd =
"showSavedResults";
100 $this->tpl->loadStandardTemplate();
102 $this->tpl->setTitleIcon(
106 $this->tpl->setTitle($this->
lng->txt(
"search"));
113 $this->
help->setScreenIdComponent(
'src_luc');
115 $this->
tabs->addTarget(
'search', $this->
ctrl->getLinkTargetByClass(ilSearchGUI::class));
118 $this->
tabs->addTarget(
'search_user', $this->
ctrl->getLinkTargetByClass(ilLuceneUserSearchGUI::class));
121 $this->
tabs->setTabActive(
'search_user');
131 if ($this->
http->wrapper()->post()->has(
'root_id')) {
132 $root_id = $this->
http->wrapper()->post()->retrieve(
138 if ($this->
http->wrapper()->post()->has(
'queryString')) {
139 $queryString = $this->
http->wrapper()->post()->retrieve(
141 $this->
refinery->kindlyTo()->string()
144 $this->search_cache->setRoot($root_id);
145 $this->search_cache->setQuery($queryString);
146 $this->search_cache->save();
152 if (strlen($this->search_cache->getQuery())) {
165 $this->search_cache->deleteCachedEntries();
188 $user_table->setLuceneResult($searcher->getResult());
189 $user_table->parseUserIds($searcher->getResult()->getCandidates());
191 $this->tpl->setVariable(
'SEARCH_RESULTS', $user_table->getHTML());
199 if ($this->
http->wrapper()->post()->has(
'term')) {
200 $query = $this->
http->wrapper()->post()->retrieve(
202 $this->
refinery->kindlyTo()->string()
204 $this->search_cache->setQuery($query);
205 $this->search_cache->setItemFilter([]);
206 $this->search_cache->setMimeFilter([]);
207 $this->search_cache->save();
213 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_usr_search.html',
'components/ILIAS/Search');
214 $this->tpl->addJavascript(
"assets/js/Search.js");
216 $this->tpl->setVariable(
"FORM_ACTION", $this->
ctrl->getFormAction($this,
"performSearch"));
218 $this->tpl->setVariable(
"SEARCH_LABEL", $this->
lng->txt(
"search"));
220 $btn->setCommand(
"performSearch");
221 $btn->setCaption(
"search");
222 $this->tpl->setVariable(
"SUBMIT_BTN", $btn->render());
GUI class for public user profile presentation.
Class ilCtrl provides processing control methods.
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
__construct()
Constructor.
ilGlobalTemplateInterface $tpl
executeCommand()
Execute Command.
search()
Search (button pressed)
performSearch()
Perform search.
remoteSearch()
Search from main menu.
ilUserSearchCache $search_cache
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
TableGUI class user search results.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for storing search result.
static _getInstance(int $a_usr_id)
const int LUCENE_USER_SEARCH
Interface GlobalHttpState.
static http()
Fetches the global http state from ILIAS.