87 if ($a_main_tpl != null) {
88 $this->main_tpl = $a_main_tpl;
90 $this->main_tpl = $DIC[
"tpl"];
93 $this->rbacsystem = $DIC->rbac()->system();
94 $this->
user = $DIC->user();
95 $this->lng = $DIC->language();
96 $this->plugin_admin = $DIC[
"ilPluginAdmin"];
97 $this->tree = $DIC->repositoryTree();
98 $this->access = $DIC->access();
99 $this->nav_history = $DIC[
"ilNavigationHistory"];
101 $this->ctrl = $DIC->ctrl();
102 $this->help = $DIC[
"ilHelp"];
103 $this->ui = $DIC->ui();
108 "tpl.main_menu.html",
113 $this->target = $a_target;
114 $this->start_template = $a_use_start_template;
117 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
123 $this->
setMode(self::MODE_FULL);
127 if ($set->isActive()) {
142 $this->mode = (int) $a_value;
161 $this->topbar_back_url = $a_url;
162 $this->topbar_back_caption = trim($a_caption);
172 case self::MODE_TOPBAR_ONLY:
173 case self::MODE_TOPBAR_REDUCED:
174 case self::MODE_TOPBAR_MEMBERVIEW:
175 return "ilFixedTopSpacerBarOnly";
177 case self::MODE_FULL:
178 return "ilFixedTopSpacer";
191 $this->active = $a_active;
202 $this->login_target_par = $a_val;
212 return $this->login_target_par;
225 $lng = $DIC->language();
228 $gr_list->setAsDropDown(
true);
234 $base = preg_replace(
"/&*lang=[a-z]{2}&*/",
"",
$base);
239 $link = str_replace(
"?&",
"?", $link);
241 $gr_list->addEntry(
$lng->_lookupEntry($lang_key,
"meta",
"meta_l_" . $lang_key), $link);
244 return $gr_list->getHTML();
262 if ($this->logo_only) {
263 $this->tpl->setVariable(
"HEADER_URL", $this->
getHeaderURL());
265 $this->tpl->setVariable(
"HEADER_ICON_RESPONSIVE",
ilUtil::getImagePath(
"HeaderIconResponsive.svg"));
266 $this->tpl->setVariable(
"LOGO_TITLE",
$lng->txt(
"logo"));
269 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
270 if (trim($header_top_title) !=
"" && $this->tpl->blockExists(
"header_top_title")) {
271 $this->tpl->setCurrentBlock(
"header_top_title");
272 $this->tpl->setVariable(
"TXT_HEADER_TITLE", $header_top_title);
273 $this->tpl->parseCurrentBlock();
281 if ($this->
getMode() != self::MODE_TOPBAR_REDUCED
282 && $this->
getMode() != self::MODE_TOPBAR_MEMBERVIEW
293 array(
"main_menu_gui" => $this,
"main_menu_search_gui" => $main_search)
295 if (!$uip->replaced()) {
296 $html = $main_search->getHTML();
301 $this->tpl->setVariable(
'SEARCHBOX',
$html);
318 if ($this->
getMode() == self::MODE_FULL) {
320 $new_renderer = $renderer->getHTML();
321 $this->tpl->setVariable(
"MAIN_MENU_LIST_ENTRIES", $new_renderer);
324 if ($this->
getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
325 $link_dir = (defined(
"ILIAS_MODULE"))
330 if (
$GLOBALS[
'DIC'][
'ilUser']->getId() == ANONYMOUS_USER_ID) {
332 $this->tpl->setCurrentBlock(
"registration_link");
333 $this->tpl->setVariable(
"TXT_REGISTER",
$lng->txt(
"register"));
334 $this->tpl->setVariable(
"LINK_REGISTER", $link_dir .
"register.php?client_id=" . rawurlencode(CLIENT_ID) .
"&lang=" .
$ilUser->getCurrentLanguage());
335 $this->tpl->parseCurrentBlock();
339 $selection = self::getLanguageSelection();
341 $this->tpl->setVariable(
"TXT_LANGSELECT",
$lng->txt(
"language"));
342 $this->tpl->setVariable(
"LANG_SELECT", $selection);
345 $this->tpl->setCurrentBlock(
"userisanonymous");
346 $this->tpl->setVariable(
"TXT_NOT_LOGGED_IN",
$lng->txt(
"not_logged_in"));
347 $this->tpl->setVariable(
"TXT_LOGIN",
$lng->txt(
"log_in"));
353 $this->tpl->setVariable(
355 $link_dir .
"login.php?target=" . $target_str .
"&client_id=" . rawurlencode(CLIENT_ID) .
"&cmd=force_login&lang=" .
$ilUser->getCurrentLanguage()
357 $this->tpl->parseCurrentBlock();
361 $this->tpl->setCurrentBlock(
"userisloggedin");
362 $this->tpl->setVariable(
"TXT_LOGIN_AS",
$lng->txt(
"login_as"));
363 $user_img_src =
$ilUser->getPersonalPicturePath(
"small",
true);
364 $user_img_alt =
$ilUser->getFullname();
365 $this->tpl->setVariable(
"USER_IMG",
ilUtil::img($user_img_src, $user_img_alt));
366 $this->tpl->setVariable(
"USR_LINK_PROFILE",
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile");
367 $this->tpl->setVariable(
"USR_TXT_PROFILE",
$lng->txt(
"personal_profile"));
368 $this->tpl->setVariable(
"USR_LINK_SETTINGS",
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings");
369 $this->tpl->setVariable(
"USR_TXT_SETTINGS",
$lng->txt(
"personal_settings"));
370 $this->tpl->setVariable(
"TXT_LOGOUT2",
$lng->txt(
"logout"));
371 $this->tpl->setVariable(
"LINK_LOGOUT2", $link_dir .
"logout.php?lang=" .
$ilUser->getCurrentLanguage());
372 $this->tpl->setVariable(
"USERNAME",
$ilUser->getFullname());
373 $this->tpl->setVariable(
"LOGIN",
$ilUser->getLogin());
374 $this->tpl->setVariable(
"MATRICULATION",
$ilUser->getMatriculation());
375 $this->tpl->setVariable(
"EMAIL",
$ilUser->getEmail());
376 $this->tpl->parseCurrentBlock();
382 $this->tpl->setVariable(
"TOPBAR_CLASS",
" ilMemberViewMainHeader");
383 $this->tpl->setVariable(
"MEMBER_VIEW_INFO",
$lng->txt(
"mem_view_long"));
386 if (!$this->topbar_back_url) {
387 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
388 if (trim($header_top_title) !=
"" && $this->tpl->blockExists(
"header_top_title")) {
389 $this->tpl->setCurrentBlock(
"header_top_title");
391 $this->tpl->setVariable(
"TXT_HEADER_TITLE", $header_top_title);
392 $this->tpl->parseCurrentBlock();
395 $this->tpl->setCurrentBlock(
"header_back_bl");
396 $this->tpl->setVariable(
"URL_HEADER_BACK", $this->topbar_back_url);
397 $this->tpl->setVariable(
399 $this->topbar_back_caption
400 ? $this->topbar_back_caption
403 $this->tpl->parseCurrentBlock();
408 if ($this->
getMode() == self::MODE_FULL) {
410 $this->tpl->setVariable(
"HEADER_URL", $this->
getHeaderURL());
412 $this->tpl->setVariable(
"HEADER_ICON_RESPONSIVE",
ilUtil::getImagePath(
"HeaderIconResponsive.svg"));
413 $this->tpl->setVariable(
"LOGO_TITLE",
$lng->txt(
"logo"));
416 $this->tpl->setVariable(
"TXT_MAIN_MENU",
$lng->txt(
"main_menu"));
418 $this->tpl->parseCurrentBlock();
428 $ui_factory = $this->ui->factory();
429 $ui_renderer = $this->ui->renderer();
436 $glyph = $ui_factory->glyph()->mail(
"ilias.php?baseClass=ilMailGUI");
438 if ($new_mails > 0) {
439 $glyph = $glyph->withCounter($ui_factory->counter()->novelty($new_mails));
442 $a_tpl->
setVariable(
'GLYPH', $ui_renderer->render($glyph));
461 if (
$rbacsystem->checkAccess(
"visible", SYSTEM_FOLDER_ID)) {
484 return $this->tpl->get();
507 $this->
setMode(self::MODE_TOPBAR_MEMBERVIEW);
524 if ((defined(
"OH_REF_ID") && OH_REF_ID > 0) || DEVMODE == 1) {
525 if ($ilHelp->getScreenId() !=
"") {
526 if ($this->
getMode() == self::MODE_FULL) {
527 $this->tpl->setCurrentBlock(
"screen_id");
528 $this->tpl->setVariable(
"SCREEN_ID", $ilHelp->getScreenId());
529 $this->tpl->parseCurrentBlock();
534 $help_active =
false;
537 $helpl->setAsDropDown(
true,
true);
539 if ($ilHelp->hasSections()) {
542 $lng->loadLanguageModule(
"help");
546 $main_tpl->addJavascript(
"./Services/Help/js/ilHelp.js");
553 $lng->txt(
"help_open_online_help"),
559 $helpl->addEntry(
"<span> </span> " .
$lng->txt(
"help_topcis"),
"#",
"",
"il.Help.listHelp(event, false);");
562 $module_id = (int)
$ilSetting->get(
"help_module");
563 if ((OH_REF_ID > 0 || $module_id > 0) &&
$ilUser->getLanguage() ==
"de" 568 $lng->loadLanguageModule(
"help");
569 $main_tpl->addJavascript(
"./Services/Help/js/ilHelp.js");
573 $lng->txt(
"help_toggle_tooltips"),
579 $helpl->addEntry(
'<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> ' .
$lng->txt(
"help_tooltips"),
"#",
"",
"return il.Help.switchTooltips(event);");
582 if ($help_active && $ilHelp->hasSections()) {
583 $this->tpl->setCurrentBlock(
"help");
584 $this->tpl->setVariable(
"TXT_HELP",
$lng->txt(
"help"));
585 $this->tpl->setVariable(
"HELP_CLICK",
"il.Help.listHelp(event, false);");
586 $this->tpl->parseCurrentBlock();
591 $ilHelp->setCtrlPar();
592 $this->main_tpl->addOnLoadCode(
593 "il.Help.setAjaxUrl('" .
594 $ilCtrl->getLinkTargetByClass(
"ilhelpgui",
"",
"",
true)
621 $this->tpl->setVariable(
'ONSCREENCHAT', $menu->getMainMenuHTML());
631 include_once(
"./Services/Awareness/classes/class.ilAwarenessGUI.php");
634 $this->tpl->setVariable(
"AWARENESS", $aw->getMainMenuHTML());
647 $this->tpl->touchBlock(
'osd_container');
666 $this->logo_only = (bool) $a_value;
678 $url =
"./goto.php?target=root_1";
691 if ($DIC->user()->isAnonymous() || (int) $DIC->user()->getId() === 0) {
693 $this->tpl->setVariable(
'BGT_HIDDEN',
'true');
697 $DIC->language()->loadLanguageModule(
"background_tasks");
699 $persistence = $DIC->backgroundTasks()->persistence();
700 $metas = $persistence->getBucketMetaOfUser($DIC->user()->getId());
701 if (!count($metas)) {
703 $this->tpl->setVariable(
'BGT_HIDDEN',
'true');
707 $numberOfUserInteractions = count(
711 return $meta->
getState() == State::USER_INTERACTION;
715 $numberOfNotUserInteractions = count($metas) - $numberOfUserInteractions;
719 ->withFixedPosition()
720 ->withTitle($DIC->language()->txt(
"background_tasks_running"));
721 $DIC->ctrl()->clearParametersByClass(ilBTControllerGUI::class);
722 $DIC->ctrl()->setParameterByClass(
723 ilBTControllerGUI::class,
727 $DIC->ctrl()->setParameterByClass(
728 ilBTControllerGUI::class,
730 $popover->getReplaceContentSignal()->getId()
734 $popover = $popover->withAsyncContentUrl(
$url);
738 ->withOnClick($popover->getShowSignal())
739 ->withCounter(
$factory->counter()->novelty($numberOfUserInteractions))
740 ->withCounter(
$factory->counter()->status($numberOfNotUserInteractions));
742 $main_tpl->addJavascript(
'./Services/BackgroundTasks/js/background_task_refresh.js');
744 $this->tpl->setVariable(
746 $DIC->ui()->renderer()->render([$glyph, $popover])
750 $this->tpl->setVariable(
'BGT_HIDDEN',
'false');
752 $this->tpl->setVariable(
'BACKGROUNDTASKS_REFRESH_URI',
$url);
static buildLoginTarget()
Add current object (repository/workspace) as target for login url.
Handles display of the main menu.
static _lookupRegistrationType()
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
renderOnScreenNotifications(\ilObjUser $user, \ilTemplate $mainTpl, \ilLanguage $lng)
static initializeFrontend()
Initialize frontend and delivers required javascript files and configuration to the global template...
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
Class ilNotificationOSDGUI.
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
const CMD_GET_POPOVER_CONTENT
static getInstance()
Get instance.
setLoginTargetPar($a_val)
populateWithOnScreenChat()
populateWithBuddySystem()
Includes all buddy system/user connections related javascript code.
static getStartingPointAsUrl()
Get current starting point setting as URL.
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
showLogoOnly(bool $a_value)
Toggle rendering of main menu, search, user info.
renderAwareness()
Render awareness tool.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
setTopBarBack($a_url, $a_caption=null)
setVariable($variable, $value='')
Sets a variable value.
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)
special template class to simplify handling of ITX/PEAR
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
static getLanguageSelection($a_in_topbar=false)
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
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
__construct($a_target="_top", $a_use_start_template=false, ilTemplate $a_main_tpl=null)
Class ilMMEntryRendererGUI.
static getInstance()
Get instance.
static _checkAdministrationPermission()
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
static initializeFrontend()
setTemplateVars()
Set all template variables (images, scripts, target frames, ...)
static getNumberOfNewMailsByUserId($usr_id)
Determines the number of new mails for the passed user id and stores this information in a local cach...
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
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.