19declare(strict_types=1);
51 $this->
lng = $DIC->language();
52 $this->
lng->loadLanguageModule(
"search");
53 $this->tree =
$DIC->repositoryTree();
54 $this->
ctrl = $DIC->ctrl();
55 $this->
user = $DIC->user();
57 $this->
http = $DIC->http();
59 $this->global_template =
$DIC->ui()->mainTemplate();
67 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
68 $this->ref_id = $this->
http->wrapper()->query()->retrieve(
79 $this->global_template->addJavaScript(
'assets/js/legacyAutocomplete.js',
true, 3);
80 $this->global_template->addJavascript(
'assets/js/SearchMainMenu.js');
82 $this->tpl =
new ilTemplate(
'tpl.main_menu_search.html',
true,
true,
'components/ILIAS/Search');
84 $this->tpl->setVariable(
'LABEL_SEARCH_OPTIONS', $this->
lng->txt(
"label_search_options"));
86 $this->tpl->setCurrentBlock(
"position");
87 $this->tpl->setVariable(
'TXT_GLOBALLY', $this->
lng->txt(
"search_globally"));
89 $this->tpl->parseCurrentBlock();
91 $this->tpl->setCurrentBlock(
"position_hid");
93 $this->tpl->parseCurrentBlock();
96 $this->tpl->setCurrentBlock(
'position_rep');
97 $this->tpl->setVariable(
'TXT_CURRENT_POSITION', $this->
lng->txt(
"search_at_current_position"));
98 $this->tpl->setVariable(
'REF_ID', $this->ref_id);
99 $this->tpl->parseCurrentBlock();
104 $this->tpl->setCurrentBlock(
'usr_search');
105 $this->tpl->setVariable(
'TXT_USR_SEARCH', $this->
lng->txt(
'search_users'));
107 $this->tpl->parseCurrentBlock();
109 $this->tpl->setVariable(
113 $this->tpl->setVariable(
'BTN_SEARCH', $this->
lng->txt(
'search'));
114 $this->tpl->setVariable(
'SEARCH_INPUT_LABEL', $this->
lng->txt(
'search_field'));
116 $this->tpl->setVariable(
'IMG_MM_SEARCH',
ilUtil::img(
118 $this->
lng->txt(
"search")
122 $this->tpl->setVariable(
126 $this->tpl->setVariable(
'TXT_SEARCH_LINK', $this->
lng->txt(
"last_search_result"));
128 $this->tpl->setVariable(
'TXT_SEARCH', $this->
lng->txt(
"search"));
130 return $this->tpl->get();
135 return $this->
ctrl->getLinkTargetByClass(
136 [strtolower(ilSearchControllerGUI::class), strtolower(ilSearchGUI::class)],
148 return $this->
ctrl->getLinkTargetByClass(
149 [strtolower(ilSearchControllerGUI::class), strtolower(ilLuceneUserSearchGUI::class)],
156 return $this->
ctrl->getLinkTargetByClass(
157 [strtolower(ilSearchControllerGUI::class)],
Class ilCtrl provides processing control methods.
Add a search box to main menu.
getStandardSearchAction()
ilGlobalTemplateInterface $global_template
buildSearchLink(string $cmd)
const int TYPE_USER_SEARCH
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
Interface GlobalHttpState.
static http()
Fetches the global http state from ILIAS.