85 if ($a_main_tpl != null) {
86 $this->main_tpl = $a_main_tpl;
88 $this->main_tpl = $DIC[
"tpl"];
91 $this->rbacsystem = $DIC->rbac()->system();
92 $this->
user = $DIC->user();
93 $this->lng = $DIC->language();
94 $this->plugin_admin = $DIC[
"ilPluginAdmin"];
95 $this->tree = $DIC->repositoryTree();
96 $this->access = $DIC->access();
97 $this->nav_history = $DIC[
"ilNavigationHistory"];
99 $this->ctrl = $DIC->ctrl();
100 $this->
help = $DIC[
"ilHelp"];
101 $this->
ui = $DIC->ui();
106 "tpl.main_menu.html",
111 $this->target = $a_target;
112 $this->start_template = $a_use_start_template;
114 $this->
setMode(self::MODE_FULL);
118 if ($set->isActive()) {
133 $this->mode = (int) $a_value;
152 $this->topbar_back_url = $a_url;
153 $this->topbar_back_caption = trim($a_caption);
163 case self::MODE_TOPBAR_ONLY:
164 case self::MODE_TOPBAR_REDUCED:
165 case self::MODE_TOPBAR_MEMBERVIEW:
166 return "ilFixedTopSpacerBarOnly";
168 case self::MODE_FULL:
169 return "ilFixedTopSpacer";
182 $this->active = $a_active;
193 $this->login_target_par = $a_val;
203 return $this->login_target_par;
218 if ($this->logo_only) {
219 $this->tpl->setVariable(
"HEADER_URL", $this->
getHeaderURL());
221 $this->tpl->setVariable(
"HEADER_ICON_RESPONSIVE",
ilUtil::getImagePath(
"HeaderIconResponsive.svg"));
224 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
225 if (trim($header_top_title) !=
"" && $this->tpl->blockExists(
"header_top_title")) {
226 $this->tpl->setCurrentBlock(
"header_top_title");
227 $this->tpl->setVariable(
"TXT_HEADER_TITLE", $header_top_title);
228 $this->tpl->parseCurrentBlock();
236 if ($this->
getMode() != self::MODE_TOPBAR_REDUCED
237 && $this->
getMode() != self::MODE_TOPBAR_MEMBERVIEW
248 array(
"main_menu_gui" => $this,
"main_menu_search_gui" => $main_search)
250 if (!$uip->replaced()) {
251 $html = $main_search->getHTML();
253 $html = $uip->getHTML($html);
256 $this->tpl->setVariable(
'SEARCHBOX', $html);
271 if ($this->
getMode() == self::MODE_FULL) {
272 $this->tpl->setVariable(
"MAIN_MENU_LIST_ENTRIES",
"-");
275 if ($this->
getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
276 $link_dir = (defined(
"ILIAS_MODULE"))
281 if (
$GLOBALS[
'DIC'][
'ilUser']->getId() == ANONYMOUS_USER_ID) {
283 $this->tpl->setCurrentBlock(
"registration_link");
284 $this->tpl->setVariable(
"TXT_REGISTER",
$lng->txt(
"register"));
285 $this->tpl->setVariable(
"LINK_REGISTER", $link_dir .
"register.php?client_id=" . rawurlencode(CLIENT_ID) .
"&lang=" .
$ilUser->getCurrentLanguage());
286 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
"userisanonymous");
291 $this->tpl->setVariable(
"TXT_NOT_LOGGED_IN",
$lng->txt(
"not_logged_in"));
292 $this->tpl->setVariable(
"TXT_LOGIN",
$lng->txt(
"log_in"));
298 $this->tpl->setVariable(
300 $link_dir .
"login.php?target=" . $target_str .
"&client_id=" . rawurlencode(CLIENT_ID) .
"&cmd=force_login&lang=" .
$ilUser->getCurrentLanguage()
302 $this->tpl->parseCurrentBlock();
304 $this->tpl->setCurrentBlock(
"userisloggedin");
305 $this->tpl->setVariable(
"TXT_LOGIN_AS",
$lng->txt(
"login_as"));
306 $user_img_src =
$ilUser->getPersonalPicturePath(
"small",
true);
307 $user_img_alt =
$ilUser->getFullname();
308 $this->tpl->setVariable(
"USER_IMG",
ilUtil::img($user_img_src, $user_img_alt));
309 $this->tpl->setVariable(
"USR_LINK_PROFILE",
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToProfile");
310 $this->tpl->setVariable(
"USR_TXT_PROFILE",
$lng->txt(
"personal_profile"));
311 $this->tpl->setVariable(
"USR_LINK_SETTINGS",
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToSettings");
312 $this->tpl->setVariable(
"USR_TXT_SETTINGS",
$lng->txt(
"personal_settings"));
313 $this->tpl->setVariable(
"TXT_LOGOUT2",
$lng->txt(
"logout"));
314 $this->tpl->setVariable(
"LINK_LOGOUT2", $link_dir .
"logout.php?lang=" .
$ilUser->getCurrentLanguage());
315 $this->tpl->setVariable(
"USERNAME",
$ilUser->getFullname());
316 $this->tpl->setVariable(
"LOGIN",
$ilUser->getLogin());
317 $this->tpl->setVariable(
"MATRICULATION",
$ilUser->getMatriculation());
318 $this->tpl->setVariable(
"EMAIL",
$ilUser->getEmail());
319 $this->tpl->parseCurrentBlock();
325 $this->tpl->setVariable(
"TOPBAR_CLASS",
" ilMemberViewMainHeader");
326 $this->tpl->setVariable(
"MEMBER_VIEW_INFO",
$lng->txt(
"mem_view_long"));
329 if (!$this->topbar_back_url) {
330 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
331 if (trim($header_top_title) !=
"" && $this->tpl->blockExists(
"header_top_title")) {
332 $this->tpl->setCurrentBlock(
"header_top_title");
334 $this->tpl->setVariable(
"TXT_HEADER_TITLE", $header_top_title);
335 $this->tpl->parseCurrentBlock();
338 $this->tpl->setCurrentBlock(
"header_back_bl");
339 $this->tpl->setVariable(
"URL_HEADER_BACK", $this->topbar_back_url);
340 $this->tpl->setVariable(
342 $this->topbar_back_caption
343 ? $this->topbar_back_caption
346 $this->tpl->parseCurrentBlock();
351 if ($this->
getMode() == self::MODE_FULL) {
353 $this->tpl->setVariable(
"HEADER_URL", $this->
getHeaderURL());
355 $this->tpl->setVariable(
"HEADER_ICON_RESPONSIVE",
ilUtil::getImagePath(
"HeaderIconResponsive.svg"));
358 $this->tpl->setVariable(
"TXT_MAIN_MENU",
$lng->txt(
"main_menu"));
360 $this->tpl->parseCurrentBlock();
370 $ui_factory = $this->
ui->factory();
371 $ui_renderer = $this->
ui->renderer();
386 if (
$rbacsystem->checkAccess(
"visible", SYSTEM_FOLDER_ID)) {
409 return $this->tpl->get();
432 $this->
setMode(self::MODE_TOPBAR_MEMBERVIEW);
449 if ((defined(
"OH_REF_ID") && OH_REF_ID > 0) || DEVMODE == 1) {
450 if ($ilHelp->getScreenId() !=
"") {
451 if ($this->
getMode() == self::MODE_FULL) {
452 $this->tpl->setCurrentBlock(
"screen_id");
453 $this->tpl->setVariable(
"SCREEN_ID", $ilHelp->getScreenId());
454 $this->tpl->parseCurrentBlock();
459 $help_active =
false;
462 $helpl->setAsDropDown(
true,
true);
464 if ($ilHelp->hasSections()) {
467 $lng->loadLanguageModule(
"help");
471 $main_tpl->addJavascript(
"./Services/Help/js/ilHelp.js");
478 $lng->txt(
"help_open_online_help"),
484 $helpl->addEntry(
"<span> </span> " .
$lng->txt(
"help_topcis"),
"#",
"",
"il.Help.listHelp(event, false);");
487 $module_id = (int)
$ilSetting->get(
"help_module");
488 if ((OH_REF_ID > 0 || $module_id > 0) &&
$ilUser->getLanguage() ==
"de" 493 $lng->loadLanguageModule(
"help");
494 $main_tpl->addJavascript(
"./Services/Help/js/ilHelp.js");
498 $lng->txt(
"help_toggle_tooltips"),
504 $helpl->addEntry(
'<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> ' .
$lng->txt(
"help_tooltips"),
"#",
"",
"return il.Help.switchTooltips(event);");
507 if ($help_active && $ilHelp->hasSections()) {
508 $this->tpl->setCurrentBlock(
"help");
509 $this->tpl->setVariable(
"TXT_HELP",
$lng->txt(
"help"));
510 $this->tpl->setVariable(
"HELP_CLICK",
"il.Help.listHelp(event, false);");
511 $this->tpl->parseCurrentBlock();
516 $ilHelp->setCtrlPar();
517 $this->main_tpl->addOnLoadCode(
518 "il.Help.setAjaxUrl('" .
519 $ilCtrl->getLinkTargetByClass(
"ilhelpgui",
"",
"",
true)
527 $menu =
new ilOnScreenChatMenuGUI();
528 $this->tpl->setVariable(
'ONSCREENCHAT', $menu->getMainMenuHTML());
538 include_once(
"./Services/Awareness/classes/class.ilAwarenessGUI.php");
541 $this->tpl->setVariable(
"AWARENESS", $aw->getMainMenuHTML());
556 $this->logo_only = (bool) $a_value;
568 $url =
"./goto.php?target=root_1";
581 if ($DIC->user()->isAnonymous() || (int) $DIC->user()->getId() === 0) {
585 $DIC->language()->loadLanguageModule(
"background_tasks");
587 $persistence = $DIC->backgroundTasks()->persistence();
588 $metas = $persistence->getBucketMetaOfUser($DIC->user()->getId());
589 if (!count($metas)) {
593 $numberOfUserInteractions = count(
597 return $meta->
getState() == State::USER_INTERACTION;
601 $numberOfNotUserInteractions = count($metas) - $numberOfUserInteractions;
605 ->withFixedPosition()
606 ->withTitle($DIC->language()->txt(
"background_tasks_running"));
607 $DIC->ctrl()->clearParametersByClass(ilBTControllerGUI::class);
608 $DIC->ctrl()->setParameterByClass(
609 ilBTControllerGUI::class,
613 $DIC->ctrl()->setParameterByClass(
614 ilBTControllerGUI::class,
615 ilBTControllerGUI::REPLACE_SIGNAL,
616 $popover->getReplaceContentSignal()->getId()
619 $url = $DIC->ctrl()->getLinkTargetByClass([ilBTControllerGUI::class], ilBTControllerGUI::CMD_GET_POPOVER_CONTENT,
"",
true);
620 $popover = $popover->withAsyncContentUrl(
$url);
622 $glyph =
$factory->symbol()->glyph()
624 ->withOnClick($popover->getShowSignal())
625 ->withCounter(
$factory->counter()->novelty($numberOfUserInteractions))
626 ->withCounter(
$factory->counter()->status($numberOfNotUserInteractions));
628 $main_tpl->addJavascript(
'./Services/BackgroundTasks/js/background_task_refresh.js');
630 $this->tpl->setVariable(
632 $DIC->ui()->renderer()->render([$glyph, $popover])
635 $this->tpl->setVariable(
'BACKGROUNDTASKS_REFRESH_URI',
$url);
666 $tree = $DIC->repositoryTree();
672 if (
$_GET[
"ref_id"] !=
"") {
680 if (
$_GET[
"wsp_id"] !=
"" &&
$_GET[
"wsp_id"] > 0) {
681 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
683 $obj_id =
$tree->lookupObjectId((
int)
$_GET[
"wsp_id"]);
686 $target_str =
$type .
"_" . (int) $_GET[
"wsp_id"] .
"_wsp";
690 if (
$_GET[
"prt_id"] !=
"") {
691 $target_str =
"prtf_" . (int)
$_GET[
"prt_id"];
Handles display of the main menu.
static _lookupRegistrationType()
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getInstance()
Get instance.
setLoginTargetPar($a_val)
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
static getStartingPointAsUrl()
Get current starting point setting as URL.
Tree handler for personal workspace.
showLogoOnly(bool $a_value)
Toggle rendering of main menu, search, user info.
renderAwareness()
Render awareness tool.
setTopBarBack($a_url, $a_caption=null)
renderStatusBox(ilTemplate $a_tpl)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const MODE_TOPBAR_MEMBERVIEW
static _lookupObjId($a_id)
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
static getMainMenuTooltip($a_item_id)
Get main menu tooltip.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct($a_target="_top", $a_use_start_template=false, ilGlobalTemplate $a_main_tpl=null)
static _checkAdministrationPermission()
setTemplateVars()
Set all template variables (images, scripts, target frames, ...)
Accordion user interface class.
addToolbarTooltip(string $element_id, string $help_id)
Add toolbar tooltip.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
const MODE_TOPBAR_REDUCED