ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMainMenuGUI Class Reference

Handles display of the main menu. More...

+ Collaboration diagram for ilMainMenuGUI:

Public Member Functions

 __construct ($a_target="_top", $a_use_start_template=false, ilGlobalTemplate $a_main_tpl=null)
 
 setMode (int $a_value)
 
 getMode ()
 
 setTopBarBack ($a_url, $a_caption=null)
 
 getSpacerClass ()
 
 setActive ($a_active)
 
 setLoginTargetPar ($a_val)
 
 getLoginTargetPar ()
 
 getHTML ()
 
 renderAwareness ()
 Render awareness tool. More...
 
 showLogoOnly (bool $a_value)
 Toggle rendering of main menu, search, user info. More...
 

Static Public Member Functions

static _checkAdministrationPermission ()
 

Data Fields

 $tpl
 
 $target
 
 $start_template
 
const MODE_FULL = 1
 
const MODE_TOPBAR_ONLY = 2
 
const MODE_TOPBAR_REDUCED = 3
 
const MODE_TOPBAR_MEMBERVIEW = 4
 

Protected Member Functions

 initMemberView ()
 
 addToolbarTooltip (string $element_id, string $help_id)
 Add toolbar tooltip. More...
 
 buildLoginTarget ()
 

Protected Attributes

 $rbacsystem
 
 $user
 
 $lng
 
 $plugin_admin
 
 $tree
 
 $access
 
 $nav_history
 
 $settings
 
 $ctrl
 
 $help
 
 $main_tpl
 
 $mode
 
 $topbar_back_url
 
 $topbar_back_caption
 

Private Member Functions

 setTemplateVars ()
 Set all template variables (images, scripts, target frames, ...) More...
 
 renderStatusBox (ilTemplate $a_tpl)
 
 renderHelpButtons ()
 
 renderOnScreenChatMenu ()
 
 getHeaderURL ()
 
 renderBackgroundTasks ()
 

Detailed Description

Handles display of the main menu.

Author
Alex Killing
Version
$Id$

Definition at line 14 of file class.ilMainMenuGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMainMenuGUI::__construct (   $a_target = "_top",
  $a_use_start_template = false,
ilGlobalTemplate  $a_main_tpl = null 
)
Parameters
string$a_targettarget frame
boolean$a_use_start_templatetrue means: target scripts should be called through start template

Definition at line 81 of file class.ilMainMenuGUI.php.

82 {
83 global $DIC;
84
85 if ($a_main_tpl != null) {
86 $this->main_tpl = $a_main_tpl;
87 } else {
88 $this->main_tpl = $DIC["tpl"];
89 }
90
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"];
98 $this->settings = $DIC->settings();
99 $this->ctrl = $DIC->ctrl();
100 $this->help = $DIC["ilHelp"];
101 $this->ui = $DIC->ui();
102 $rbacsystem = $DIC->rbac()->system();
103 $ilUser = $DIC->user();
104
105 $this->tpl = new ilTemplate(
106 "tpl.main_menu.html",
107 true,
108 true,
109 "Services/MainMenu"
110 );
111 $this->target = $a_target;
112 $this->start_template = $a_use_start_template;
113
114 $this->setMode(self::MODE_FULL);
115
116 // member view
118 if ($set->isActive()) {
119 $this->initMemberView();
120 }
121 }
user()
Definition: user.php:4
setMode(int $a_value)
special template class to simplify handling of ITX/PEAR
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
$ilUser
Definition: imgupload.php:18
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5

References $DIC, $ilUser, $rbacsystem, ilMemberViewSettings\getInstance(), help(), initMemberView(), setMode(), settings(), ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAdministrationPermission()

static ilMainMenuGUI::_checkAdministrationPermission ( )
static
Returns
bool
Deprecated:
Please use RBAC directly

Definition at line 379 of file class.ilMainMenuGUI.php.

380 {
381 global $DIC;
382
383 $rbacsystem = $DIC->rbac()->system();
384
385 //if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
386 if ($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID)) {
387 return true;
388 }
389
390 return false;
391 }
const SYSTEM_FOLDER_ID
Definition: constants.php:33

References $DIC, $rbacsystem, and SYSTEM_FOLDER_ID.

Referenced by ilObjMediaPoolGUI\createMediaFromUploadDir(), ilObjMediaPoolGUI\listMedia(), and ilObjMediaPoolGUI\selectUploadDirFiles().

+ Here is the caller graph for this function:

◆ addToolbarTooltip()

ilMainMenuGUI::addToolbarTooltip ( string  $element_id,
string  $help_id 
)
protected

Add toolbar tooltip.

Parameters
string$element_id
string$help_id

Definition at line 647 of file class.ilMainMenuGUI.php.

648 {
649 if (ilHelp::getMainMenuTooltip($help_id) != "") {
651 $element_id,
653 "",
654 "top right",
655 "top left",
656 false
657 );
658 }
659 }
static getMainMenuTooltip($a_item_id)
Get main menu tooltip.
static addTooltip( $a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
Adds a tooltip to an HTML element.

References ilTooltipGUI\addTooltip(), and ilHelp\getMainMenuTooltip().

Referenced by renderAwareness(), renderBackgroundTasks(), renderHelpButtons(), renderOnScreenChatMenu(), and setTemplateVars().

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

◆ buildLoginTarget()

ilMainMenuGUI::buildLoginTarget ( )
protected

Definition at line 662 of file class.ilMainMenuGUI.php.

663 {
664 global $DIC;
665
666 $tree = $DIC->repositoryTree();
667 $ilUser = $DIC->user();
668
669 $target_str = "";
670
671 // repository
672 if ($_GET["ref_id"] != "") {
673 if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId()) {
674 $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
675 $type = ilObject::_lookupType($obj_id);
676 $target_str = $type . "_" . $_GET["ref_id"];
677 }
678 } // personal workspace
679 else {
680 if ($_GET["wsp_id"] != "" && $_GET["wsp_id"] > 0) {
681 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
682 $tree = new ilWorkspaceTree($ilUser->getId());
683 $obj_id = $tree->lookupObjectId((int) $_GET["wsp_id"]);
684 if ($obj_id) {
685 $type = ilObject::_lookupType($obj_id);
686 $target_str = $type . "_" . (int) $_GET["wsp_id"] . "_wsp";
687 }
688 } // portfolio
689 else {
690 if ($_GET["prt_id"] != "") {
691 $target_str = "prtf_" . (int) $_GET["prt_id"];
692 }
693 }
694 }
695
696 return $target_str;
697 }
$_GET["client_id"]
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Tree handler for personal workspace.
$type

References $_GET, $DIC, $ilUser, $tree, $type, ilObject\_lookupObjId(), and ilObject\_lookupType().

Referenced by setTemplateVars().

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

◆ getHeaderURL()

ilMainMenuGUI::getHeaderURL ( )
private
Returns
string

Definition at line 563 of file class.ilMainMenuGUI.php.

563 : string
564 {
565 $url = ilUserUtil::getStartingPointAsUrl();
566
567 if (!$url) {
568 $url = "./goto.php?target=root_1";
569 }
570
571 return $url;
572 }
$url

References $url.

Referenced by setTemplateVars().

+ Here is the caller graph for this function:

◆ getHTML()

ilMainMenuGUI::getHTML ( )
Returns
string
Exceptions
ilTemplateException
Deprecated:

Definition at line 399 of file class.ilMainMenuGUI.php.

400 {
401 // this is a workaround for bugs like 14016
402 // the main menu does not need the YUI connection, but many other
403 // features since they rely on il.Util.sendAjaxGetRequestToUrl (see Services/Javascript)
404 // which still uses YUI. This should be migrated to jQuery with a future major release
406
407 $this->setTemplateVars();
408
409 return $this->tpl->get();
410 }
setTemplateVars()
Set all template variables (images, scripts, target frames, ...)
static initConnection(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.

References ilYuiUtil\initConnection(), and setTemplateVars().

+ Here is the call graph for this function:

◆ getLoginTargetPar()

ilMainMenuGUI::getLoginTargetPar ( )
Deprecated:
Get target parameter for login

Definition at line 201 of file class.ilMainMenuGUI.php.

202 {
203 return $this->login_target_par;
204 }

Referenced by setTemplateVars().

+ Here is the caller graph for this function:

◆ getMode()

ilMainMenuGUI::getMode ( )
Returns
int

Definition at line 140 of file class.ilMainMenuGUI.php.

140 : int
141 {
142 return $this->mode;
143 }

References $mode.

Referenced by getSpacerClass(), renderHelpButtons(), and setTemplateVars().

+ Here is the caller graph for this function:

◆ getSpacerClass()

ilMainMenuGUI::getSpacerClass ( )
Returns
string

Definition at line 160 of file class.ilMainMenuGUI.php.

161 {
162 switch ($this->getMode()) {
166 return "ilFixedTopSpacerBarOnly";
167
168 case self::MODE_FULL:
169 return "ilFixedTopSpacer";
170 }
171 }

References getMode(), MODE_FULL, MODE_TOPBAR_MEMBERVIEW, MODE_TOPBAR_ONLY, and MODE_TOPBAR_REDUCED.

+ Here is the call graph for this function:

◆ initMemberView()

ilMainMenuGUI::initMemberView ( )
protected
Returns
bool

Definition at line 416 of file class.ilMainMenuGUI.php.

416 : bool
417 {
419
420 $ref_id = ilMemberViewSettings::getInstance()->getCurrentRefId();
421
422 if (!$ref_id) {
423 return false;
424 }
425
427 $ref_id,
429 array('mv' => 0)
430 );
431
432 $this->setMode(self::MODE_TOPBAR_MEMBERVIEW);
433 $this->setTopBarBack($url, $lng->txt('mem_view_close'));
434
435 return true;
436 }
setTopBarBack($a_url, $a_caption=null)

References $lng, $url, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilMemberViewSettings\getInstance(), setMode(), and setTopBarBack().

Referenced by __construct().

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

◆ renderAwareness()

ilMainMenuGUI::renderAwareness ( )

Render awareness tool.

Definition at line 536 of file class.ilMainMenuGUI.php.

537 {
538 include_once("./Services/Awareness/classes/class.ilAwarenessGUI.php");
540
541 $this->tpl->setVariable("AWARENESS", $aw->getMainMenuHTML());
542 $this->addToolbarTooltip("awareness_trigger", "mm_tb_aware");
543 }
static getInstance()
Get instance.
addToolbarTooltip(string $element_id, string $help_id)
Add toolbar tooltip.

References addToolbarTooltip(), and ilAwarenessGUI\getInstance().

Referenced by setTemplateVars().

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

◆ renderBackgroundTasks()

ilMainMenuGUI::renderBackgroundTasks ( )
private

Definition at line 575 of file class.ilMainMenuGUI.php.

576 {
577 global $DIC;
578
580
581 if ($DIC->user()->isAnonymous() || (int) $DIC->user()->getId() === 0) {
582 return;
583 }
584
585 $DIC->language()->loadLanguageModule("background_tasks");
586 $factory = $DIC->ui()->factory();
587 $persistence = $DIC->backgroundTasks()->persistence();
588 $metas = $persistence->getBucketMetaOfUser($DIC->user()->getId());
589 if (!count($metas)) {
590 return;
591 }
592
593 $numberOfUserInteractions = count(
594 array_filter(
595 $metas,
596 function (BucketMeta $meta) {
597 return $meta->getState() == State::USER_INTERACTION;
598 }
599 )
600 );
601 $numberOfNotUserInteractions = count($metas) - $numberOfUserInteractions;
602
603 $popover = $factory->popover()
604 ->listing(array())
605 ->withFixedPosition()
606 ->withTitle($DIC->language()->txt("background_tasks_running")); // needs to have empty content
607 $DIC->ctrl()->clearParametersByClass(ilBTControllerGUI::class);
608 $DIC->ctrl()->setParameterByClass(
609 ilBTControllerGUI::class,
611 ilBTControllerGUI::hash("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}")
612 );
613 $DIC->ctrl()->setParameterByClass(
614 ilBTControllerGUI::class,
615 ilBTControllerGUI::REPLACE_SIGNAL,
616 $popover->getReplaceContentSignal()->getId()
617 );
618
619 $url = $DIC->ctrl()->getLinkTargetByClass([ilBTControllerGUI::class], ilBTControllerGUI::CMD_GET_POPOVER_CONTENT, "", true);
620 $popover = $popover->withAsyncContentUrl($url);
621
622 $glyph = $factory->symbol()->glyph()
623 ->briefcase()
624 ->withOnClick($popover->getShowSignal())
625 ->withCounter($factory->counter()->novelty($numberOfUserInteractions))
626 ->withCounter($factory->counter()->status($numberOfNotUserInteractions));
627
628 $main_tpl->addJavascript('./Services/BackgroundTasks/js/background_task_refresh.js');
629
630 $this->tpl->setVariable(
631 'BACKGROUNDTASKS',
632 $DIC->ui()->renderer()->render([$glyph, $popover])
633 );
634
635 $this->tpl->setVariable('BACKGROUNDTASKS_REFRESH_URI', $url);
636
637 $this->addToolbarTooltip("mm_tb_background_tasks", "mm_tb_bgtasks");
638 }
$factory
Definition: metadata.php:58

References $DIC, $factory, $main_tpl, $url, addToolbarTooltip(), ilBTControllerGUI\FROM_URL, ILIAS\BackgroundTasks\BucketMeta\getState(), and ilBTControllerGUI\hash().

Referenced by setTemplateVars().

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

◆ renderHelpButtons()

ilMainMenuGUI::renderHelpButtons ( )
private

Definition at line 439 of file class.ilMainMenuGUI.php.

440 {
441 $ilHelp = $this->help;
443 $ilCtrl = $this->ctrl;
447
448 // screen id
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();
455 }
456 }
457 }
458
459 $help_active = false;
460
461 $helpl = new ilGroupedListGUI();
462 $helpl->setAsDropDown(true, true);
463
464 if ($ilHelp->hasSections()) {
465 $help_active = true;
466
467 $lng->loadLanguageModule("help");
468 //$this->tpl->setCurrentBlock("help_icon");
469
470 // add javascript needed by help (to do: move to help class)
471 $main_tpl->addJavascript("./Services/Help/js/ilHelp.js");
472 $acc = new ilAccordionGUI();
473 $acc->addJavascript($main_tpl);
474 $acc->addCss();
475
477 "help_tr",
478 $lng->txt("help_open_online_help"),
479 "",
480 "bottom center",
481 "top center",
482 false
483 );
484 $helpl->addEntry("<span>&nbsp;</span> " . $lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);");
485 }
486
487 $module_id = (int) $ilSetting->get("help_module");
488 if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de"
489 && $ilSetting->get("help_mode") != "1"
490 ) {
491 $help_active = true;
492
493 $lng->loadLanguageModule("help");
494 $main_tpl->addJavascript("./Services/Help/js/ilHelp.js");
495
497 "help_tt",
498 $lng->txt("help_toggle_tooltips"),
499 "",
500 "bottom center",
501 "top center",
502 false
503 );
504 $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> ' . $lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);");
505 }
506
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();
512
513 $this->addToolbarTooltip("mm_help", "mm_tb_help");
514
515 // always set ajax url
516 $ilHelp->setCtrlPar();
517 $this->main_tpl->addOnLoadCode(
518 "il.Help.setAjaxUrl('" .
519 $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
520 . "');"
521 );
522 }
523 }
Accordion user interface class.
Grouped list GUI class.
global $ilSetting
Definition: privfeed.php:17

References $ctrl, $help, $ilSetting, $ilUser, $lng, $main_tpl, $settings, $user, addToolbarTooltip(), ilTooltipGUI\addTooltip(), and getMode().

Referenced by setTemplateVars().

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

◆ renderOnScreenChatMenu()

ilMainMenuGUI::renderOnScreenChatMenu ( )
private

Definition at line 525 of file class.ilMainMenuGUI.php.

526 {
527 $menu = new ilOnScreenChatMenuGUI();
528 $this->tpl->setVariable('ONSCREENCHAT', $menu->getMainMenuHTML());
529 $this->addToolbarTooltip("onscreenchatmenu-dropdown", "mm_tb_oschat");
530 }

References addToolbarTooltip().

Referenced by setTemplateVars().

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

◆ renderStatusBox()

ilMainMenuGUI::renderStatusBox ( ilTemplate  $a_tpl)
private
Parameters
ilTemplate$a_tpl

Definition at line 367 of file class.ilMainMenuGUI.php.

368 {
370 $ui_factory = $this->ui->factory();
371 $ui_renderer = $this->ui->renderer();
372 }

References $ilUser, $user, and ui().

Referenced by setTemplateVars().

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

◆ setActive()

ilMainMenuGUI::setActive (   $a_active)
Parameters
string$a_active"desktop"|"repository"|"search"|"chat_invitation"|"administration"
Deprecated:

Definition at line 180 of file class.ilMainMenuGUI.php.

181 {
182 $this->active = $a_active;
183 }

◆ setLoginTargetPar()

ilMainMenuGUI::setLoginTargetPar (   $a_val)
Deprecated:
Set target parameter for login (public sector). This is used by the main menu

Definition at line 191 of file class.ilMainMenuGUI.php.

192 {
193 $this->login_target_par = $a_val;
194 }

◆ setMode()

ilMainMenuGUI::setMode ( int  $a_value)
Parameters
int$a_valueaccepts values: self::MODE_TOPBAR_ONLY: self::MODE_TOPBAR_REDUCED: self::MODE_TOPBAR_MEMBERVIEW: case self::MODE_FULL:

Definition at line 131 of file class.ilMainMenuGUI.php.

132 {
133 $this->mode = (int) $a_value;
134 }

Referenced by __construct(), and initMemberView().

+ Here is the caller graph for this function:

◆ setTemplateVars()

ilMainMenuGUI::setTemplateVars ( )
private

Set all template variables (images, scripts, target frames, ...)

Definition at line 210 of file class.ilMainMenuGUI.php.

211 {
215 $ilPluginAdmin = $this->plugin_admin;
217
218 if ($this->logo_only) {
219 $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
220 $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
221 $this->tpl->setVariable("HEADER_ICON_RESPONSIVE", ilUtil::getImagePath("HeaderIconResponsive.svg"));
222
223 // #15759
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();
229 }
230
231 return;
232 }
233
234 // get user interface plugins
235
236 if ($this->getMode() != self::MODE_TOPBAR_REDUCED
237 && $this->getMode() != self::MODE_TOPBAR_MEMBERVIEW
238 ) {
239 // search
240 if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
241 $main_search = new ilMainMenuSearchGUI();
242 $html = "";
243
244 // user interface plugin slot + default rendering
245 $uip = new ilUIHookProcessor(
246 "Services/MainMenu",
247 "main_menu_search",
248 array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search)
249 );
250 if (!$uip->replaced()) {
251 $html = $main_search->getHTML();
252 }
253 $html = $uip->getHTML($html);
254
255 if (strlen($html)) {
256 $this->tpl->setVariable('SEARCHBOX', $html);
257 $this->addToolbarTooltip("ilMMSearch", "mm_tb_search");
258 }
259 }
260
261 $this->renderStatusBox($this->tpl);
262
263 // online help
264 $this->renderHelpButtons();
265
266 $this->renderOnScreenChatMenu();
267 $this->renderBackgroundTasks();
268 $this->renderAwareness();
269 }
270
271 if ($this->getMode() == self::MODE_FULL) {
272 $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", "-");
273 }
274
275 if ($this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
276 $link_dir = (defined("ILIAS_MODULE"))
277 ? "../"
278 : "";
279
280 // login stuff
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();
287 }
288
289
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"));
293
294 // #13058
295 $target_str = ($this->getLoginTargetPar() != "")
296 ? $this->getLoginTargetPar()
297 : $this->buildLoginTarget();
298 $this->tpl->setVariable(
299 "LINK_LOGIN",
300 $link_dir . "login.php?target=" . $target_str . "&client_id=" . rawurlencode(CLIENT_ID) . "&cmd=force_login&lang=" . $ilUser->getCurrentLanguage()
301 );
302 $this->tpl->parseCurrentBlock();
303 } else {
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();
320
321 $this->addToolbarTooltip("userlog", "mm_tb_user");
322 }
323 } else {
324 // member view info
325 $this->tpl->setVariable("TOPBAR_CLASS", " ilMemberViewMainHeader");
326 $this->tpl->setVariable("MEMBER_VIEW_INFO", $lng->txt("mem_view_long"));
327 }
328
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");
333 // php7-workaround alex: added phpversion() to help during development of php7 compatibility
334 $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
335 $this->tpl->parseCurrentBlock();
336 }
337 } else {
338 $this->tpl->setCurrentBlock("header_back_bl");
339 $this->tpl->setVariable("URL_HEADER_BACK", $this->topbar_back_url);
340 $this->tpl->setVariable(
341 "TXT_HEADER_BACK",
342 $this->topbar_back_caption
343 ? $this->topbar_back_caption
344 : $lng->txt("back")
345 );
346 $this->tpl->parseCurrentBlock();
347 }
348
349 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
350
351 if ($this->getMode() == self::MODE_FULL) {
352 // $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
353 $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
354 $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
355 $this->tpl->setVariable("HEADER_ICON_RESPONSIVE", ilUtil::getImagePath("HeaderIconResponsive.svg"));
356 }
357
358 $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
359
360 $this->tpl->parseCurrentBlock();
361 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
renderStatusBox(ilTemplate $a_tpl)
renderAwareness()
Render awareness tool.
Add a search box to main menu.
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
Class ilUIHookProcessor.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const CLIENT_ID
Definition: constants.php:39
const ANONYMOUS_USER_ID
Definition: constants.php:25

References $GLOBALS, $ilUser, $lng, $main_tpl, $plugin_admin, $rbacsystem, $user, ilSearchSettings\_getSearchSettingRefId(), ilRegistrationSettings\_lookupRegistrationType(), addToolbarTooltip(), ANONYMOUS_USER_ID, buildLoginTarget(), CLIENT_ID, getHeaderURL(), ilUtil\getImagePath(), getLoginTargetPar(), getMode(), ilUtil\getStyleSheetLocation(), IL_REG_DISABLED, ilUtil\img(), renderAwareness(), renderBackgroundTasks(), renderHelpButtons(), renderOnScreenChatMenu(), and renderStatusBox().

Referenced by getHTML().

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

◆ setTopBarBack()

ilMainMenuGUI::setTopBarBack (   $a_url,
  $a_caption = null 
)
Parameters
$a_url
null$a_caption

Definition at line 150 of file class.ilMainMenuGUI.php.

151 {
152 $this->topbar_back_url = $a_url;
153 $this->topbar_back_caption = trim($a_caption);
154 }

Referenced by initMemberView().

+ Here is the caller graph for this function:

◆ showLogoOnly()

ilMainMenuGUI::showLogoOnly ( bool  $a_value)

Toggle rendering of main menu, search, user info.

Parameters
bool$a_value
Deprecated:
do not use in other contextx
See also
ilImprintGUI

Definition at line 554 of file class.ilMainMenuGUI.php.

555 {
556 $this->logo_only = (bool) $a_value;
557 }

Field Documentation

◆ $access

ilMainMenuGUI::$access
protected

Definition at line 40 of file class.ilMainMenuGUI.php.

◆ $ctrl

ilMainMenuGUI::$ctrl
protected

Definition at line 52 of file class.ilMainMenuGUI.php.

Referenced by renderHelpButtons().

◆ $help

ilMainMenuGUI::$help
protected

Definition at line 56 of file class.ilMainMenuGUI.php.

Referenced by renderHelpButtons().

◆ $lng

ilMainMenuGUI::$lng
protected

Definition at line 28 of file class.ilMainMenuGUI.php.

Referenced by initMemberView(), renderHelpButtons(), and setTemplateVars().

◆ $main_tpl

ilMainMenuGUI::$main_tpl
protected

◆ $mode

ilMainMenuGUI::$mode
protected

Definition at line 67 of file class.ilMainMenuGUI.php.

Referenced by getMode().

◆ $nav_history

ilMainMenuGUI::$nav_history
protected

Definition at line 44 of file class.ilMainMenuGUI.php.

◆ $plugin_admin

ilMainMenuGUI::$plugin_admin
protected

Definition at line 32 of file class.ilMainMenuGUI.php.

Referenced by setTemplateVars().

◆ $rbacsystem

ilMainMenuGUI::$rbacsystem
protected

◆ $settings

ilMainMenuGUI::$settings
protected

Definition at line 48 of file class.ilMainMenuGUI.php.

Referenced by renderHelpButtons().

◆ $start_template

ilMainMenuGUI::$start_template

Definition at line 62 of file class.ilMainMenuGUI.php.

◆ $target

ilMainMenuGUI::$target

Definition at line 61 of file class.ilMainMenuGUI.php.

◆ $topbar_back_caption

ilMainMenuGUI::$topbar_back_caption
protected

Definition at line 69 of file class.ilMainMenuGUI.php.

◆ $topbar_back_url

ilMainMenuGUI::$topbar_back_url
protected

Definition at line 68 of file class.ilMainMenuGUI.php.

◆ $tpl

ilMainMenuGUI::$tpl

Definition at line 60 of file class.ilMainMenuGUI.php.

◆ $tree

ilMainMenuGUI::$tree
protected

Definition at line 36 of file class.ilMainMenuGUI.php.

Referenced by buildLoginTarget().

◆ $user

ilMainMenuGUI::$user
protected

Definition at line 24 of file class.ilMainMenuGUI.php.

Referenced by renderHelpButtons(), renderStatusBox(), and setTemplateVars().

◆ MODE_FULL

const ilMainMenuGUI::MODE_FULL = 1

◆ MODE_TOPBAR_MEMBERVIEW

const ilMainMenuGUI::MODE_TOPBAR_MEMBERVIEW = 4

Definition at line 73 of file class.ilMainMenuGUI.php.

Referenced by getSpacerClass().

◆ MODE_TOPBAR_ONLY

◆ MODE_TOPBAR_REDUCED


The documentation for this class was generated from the following file: