ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 
 setMode ($a_value)
 
 getMode ()
 
 setTopBarBack ($a_url, $a_caption=null)
 
 getSpacerClass ()
 
 setActive ($a_active)
 
 setTemplate (&$tpl)
 set output template More...
 
 getTemplate ()
 get output template More...
 
 setLoginTargetPar ($a_val)
 Set target parameter for login (public sector). More...
 
 getLoginTargetPar ()
 Get target parameter for login. More...
 
 setTemplateVars ()
 set all template variables (images, scripts, target frames, ...) More...
 
 renderStatusBox ($a_tpl)
 Render status box. More...
 
 renderMainMenuListEntries ($a_tpl, $a_call_get=true)
 desc More...
 
 renderEntry ($a_tpl, $a_id, $a_txt, $a_script, $a_target="_top")
 Render main menu entry. More...
 
 getScriptTarget ($a_script)
 generates complete script target (private) More...
 
 getHTML ()
 
 renderDropDown ($a_tpl, $a_id)
 GetDropDownHTML. More...
 
 renderHelpButtons ()
 Render help button. More...
 
 renderAwareness ()
 Render awareness tool. More...
 
 showLogoOnly ($a_value)
 Toggle rendering of main menu, search, user info. More...
 

Static Public Member Functions

static getLanguageSelection ($a_in_topbar=false)
 
static _checkAdministrationPermission ()
 

Data Fields

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

Protected Member Functions

 initMemberView ()
 Init member view type $lng. More...
 
 populateWithBuddySystem ()
 Includes all buddy system/user connections related javascript code. More...
 
 populateWithOnScreenChat ()
 
 renderOnScreenChatMenu ()
 
 renderOnScreenNotifications (\ilObjUser $user, \ilTemplate $mainTpl, \ilLanguage $lng)
 
 getHeaderURL ()
 

Protected Attributes

 $mode
 
 $topbar_back_url
 
 $topbar_back_caption
 

Detailed Description

Handles display of the main menu.

Author
Alex Killing
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $ilias, $ilUser, ilMemberViewSettings\getInstance(), ilMailGlobalServices\getMailObjectRefId(), initMemberView(), Monolog\Handler\mail(), and setMode().

41  {
42  global $ilias, $rbacsystem, $ilUser;
43 
44  $this->tpl = new ilTemplate("tpl.main_menu.html", true, true,
45  "Services/MainMenu");
46  $this->ilias = $ilias;
47  $this->target = $a_target;
48  $this->start_template = $a_use_start_template;
49 
50  $this->mail = false;
51  if($ilUser->getId() != ANONYMOUS_USER_ID)
52  {
53  if($rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))
54  {
55  $this->mail = true;
56  }
57  }
58 
59  $this->setMode(self::MODE_FULL);
60 
61  // member view
62  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
64  if($set->isActive())
65  {
66  $this->initMemberView();
67  }
68  }
initMemberView()
Init member view type $lng.
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
static getInstance()
Get instance.
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAdministrationPermission()

static ilMainMenuGUI::_checkAdministrationPermission ( )
static

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

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

731  {
732  global $rbacsystem;
733 
734  //if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
735  if($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID))
736  {
737  return true;
738  }
739  return false;
740  }
+ Here is the caller graph for this function:

◆ getHeaderURL()

ilMainMenuGUI::getHeaderURL ( )
protected

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

References $url, and ilUserUtil\getStartingPointAsUrl().

Referenced by setTemplateVars().

1093  {
1094  include_once './Services/User/classes/class.ilUserUtil.php';
1096 
1097  if(!$url)
1098  {
1099  $url = "./goto.php?target=root_1";
1100  }
1101 
1102  return $url;
1103  }
$url
Definition: shib_logout.php:72
static getStartingPointAsUrl()
Get current starting point setting as URL.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilMainMenuGUI::getHTML ( )

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

References setTemplateVars().

743  {
744  // this is a workaround for bugs like 14016
745  // the main menu does not need the YUI connection, but many other
746  // features since they rely on il.Util.sendAjaxGetRequestToUrl (see Services/Javascript)
747  // which still uses YUI. This should be migrated to jQuery with a future major release
748  include_once "Services/YUI/classes/class.ilYuiUtil.php";
749  ilYUIUtil::initConnection();
750 
751  $this->setTemplateVars();
752 
753  return $this->tpl->get();
754  }
setTemplateVars()
set all template variables (images, scripts, target frames, ...)
+ Here is the call graph for this function:

◆ getLanguageSelection()

static ilMainMenuGUI::getLanguageSelection (   $a_in_topbar = false)
static

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

References $_SERVER, $ilUser, $languages, $lng, and ilUtil\appendUrlParameterString().

Referenced by ilStartUpGUI\getLanguageSelection().

145  {
146  global $lng;
147 
148  global $ilUser;
149  include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
150  $gr_list = new ilGroupedListGUI();
151  $gr_list->setAsDropDown(true);
152 
153  $languages = $lng->getInstalledLanguages();
154  if(sizeof($languages) > 1) // #11237
155  {
156  foreach ($languages as $lang_key)
157  {
158  $base = substr($_SERVER["REQUEST_URI"], strrpos($_SERVER["REQUEST_URI"], "/") + 1);
159  $base = preg_replace("/&*lang=[a-z]{2}&*/", "", $base);
160  $link = ilUtil::appendUrlParameterString($base,
161  "lang=".$lang_key);
162  $link = str_replace("?&", "?", $link);
163 
164  $gr_list->addEntry($lng->_lookupEntry($lang_key, "meta", "meta_l_".$lang_key), $link);
165  }
166  return $gr_list->getHTML();
167  }
168  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
Grouped list GUI class.
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
$languages
Definition: cssgen2.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLoginTargetPar()

ilMainMenuGUI::getLoginTargetPar ( )

Get target parameter for login.

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

Referenced by setTemplateVars().

140  {
141  return $this->login_target_par;
142  }
+ Here is the caller graph for this function:

◆ getMode()

ilMainMenuGUI::getMode ( )

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

References $mode.

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

76  {
77  return $this->mode;
78  }
+ Here is the caller graph for this function:

◆ getScriptTarget()

ilMainMenuGUI::getScriptTarget (   $a_script)

generates complete script target (private)

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

References defined.

721  {
722  $script = "./".$a_script;
723  if (defined("ILIAS_MODULE"))
724  {
725  $script = ".".$script;
726  }
727  return $script;
728  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ getSpacerClass()

ilMainMenuGUI::getSpacerClass ( )

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

References getMode().

87  {
88  switch($this->getMode())
89  {
90  case self::MODE_TOPBAR_ONLY:
91  case self::MODE_TOPBAR_REDUCED:
92  case self::MODE_TOPBAR_MEMBERVIEW:
93  return "ilFixedTopSpacerBarOnly";
94 
95  case self::MODE_FULL:
96  return "ilFixedTopSpacer";
97  }
98  }
+ Here is the call graph for this function:

◆ getTemplate()

ilMainMenuGUI::getTemplate ( )

get output template

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

122  {
123  echo "ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
124  return;
125  }

◆ initMemberView()

ilMainMenuGUI::initMemberView ( )
protected

Init member view type $lng.

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

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

Referenced by __construct().

761  {
762  global $lng;
763 
764  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
765  $ref_id = ilMemberViewSettings::getInstance()->getCurrentRefId();
766 
767  if(!$ref_id)
768  {
769  return FALSE;
770  }
771 
772  include_once './Services/Link/classes/class.ilLink.php';
774  $ref_id,
776  array('mv' => 0));
777 
778  $this->setMode(self::MODE_TOPBAR_MEMBERVIEW);
779  $this->setTopBarBack($url, $lng->txt('mem_view_close'));
780  }
$url
Definition: shib_logout.php:72
setTopBarBack($a_url, $a_caption=null)
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
$ref_id
Definition: sahs_server.php:39
static getInstance()
Get instance.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateWithBuddySystem()

ilMainMenuGUI::populateWithBuddySystem ( )
protected

Includes all buddy system/user connections related javascript code.

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

References ilBuddySystem\getInstance(), and ilBuddySystemGUI\initializeFrontend().

Referenced by setTemplateVars().

1027  {
1028  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
1029  if(ilBuddySystem::getInstance()->isEnabled())
1030  {
1031  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystemGUI.php';
1033  }
1034  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateWithOnScreenChat()

ilMainMenuGUI::populateWithOnScreenChat ( )
protected

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

References ilOnScreenChatGUI\initializeFrontend().

Referenced by setTemplateVars().

1037  {
1038  require_once 'Services/OnScreenChat/classes/class.ilOnScreenChat.php';
1039  require_once 'Services/OnScreenChat/classes/class.ilOnScreenChatGUI.php';
1040 
1042  }
static initializeFrontend()
Initialize frontend and delivers required javascript files and configuration to the global template...
+ 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 1055 of file class.ilMainMenuGUI.php.

References ilAwarenessGUI\getInstance().

Referenced by setTemplateVars().

1056  {
1057  include_once("./Services/Awareness/classes/class.ilAwarenessGUI.php");
1059 
1060  $this->tpl->setVariable("AWARENESS", $aw->getMainMenuHTML());
1061  }
static getInstance()
Get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderDropDown()

ilMainMenuGUI::renderDropDown (   $a_tpl,
  $a_id 
)

GetDropDownHTML.

Parameters

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

References $html, $ilSetting, $ilUser, $lng, ilObjUserTracking\_enabledLearningProgress(), ilCalendarSettings\_getInstance(), ilBuddySystem\getInstance(), ilAdvancedSelectionListGUI\ICON_ARROW, and Monolog\Handler\mail().

Referenced by renderMainMenuListEntries().

789  {
790  global $lng, $ilSetting, $rbacsystem;
791 
792  $id = strtolower($a_id);
793  $id_up = strtoupper($a_id);
794  $a_tpl->setCurrentBlock("entry_".$id);
795  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
796  $selection = new ilAdvancedSelectionListGUI();
797  if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
798  {
799  $selection->setSelectionHeaderClass("MMActive");
800  $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
801  }
802  else
803  {
804  $selection->setSelectionHeaderClass("MMInactive");
805  }
806 
807  $selection->setSelectionHeaderSpanClass("MMSpan");
808 
809  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::ICON_ARROW);
810  $selection->setItemLinkClass("small");
811  $selection->setUseImages(false);
812 
813  switch ($id)
814  {
815  // desktop drop down
816  case "desktop":
817  $selection->setListTitle($lng->txt("personal_desktop"));
818  $selection->setId("dd_pd");
819 
820  // overview
821  $selection->addItem($lng->txt("overview"), "", "ilias.php?baseClass=ilPersonalDesktopGUI",
822  "", "", "_top");
823 
824  if(!$ilSetting->get("disable_personal_workspace"))
825  {
826  // workspace
827  $selection->addItem($lng->txt("personal_workspace"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace",
828  "", "", "_top");
829  }
830 
831  // profile
832  $selection->addItem($lng->txt("personal_profile"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToProfile",
833  "", "", "_top");
834 
835  // skills
836  $skmg_set = new ilSetting("skmg");
837  if ($skmg_set->get("enable_skmg"))
838  {
839  $selection->addItem($lng->txt("skills"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSkills",
840  "", "", "_top");
841  }
842 
843  // portfolio
844  if ($ilSetting->get('user_portfolios'))
845  {
846  $selection->addItem($lng->txt("portfolio"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToPortfolio",
847  "", "", "_top");
848  }
849 
850  // news
851  if ($ilSetting->get("block_activated_news"))
852  {
853  $selection->addItem($lng->txt("news"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNews",
854  "", "", "_top");
855  }
856 
857  // Learning Progress
858  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
860  {
861  //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
862  $selection->addItem($lng->txt("learning_progress"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToLP",
863  "", "", "_top");
864  }
865 
866  // calendar
867  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
868  $settings = ilCalendarSettings::_getInstance();
869  if($settings->isEnabled())
870  {
871  $selection->addItem($lng->txt("calendar"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToCalendar",
872  "", "", "_top");
873  }
874 
875  // mail
876  if($this->mail)
877  {
878  $selection->addItem($lng->txt('mail'), '', 'ilias.php?baseClass=ilMailGUI', '', '', '_top');
879  }
880 
881  // contacts
882  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
883  if(ilBuddySystem::getInstance()->isEnabled())
884  {
885  $selection->addItem($lng->txt('mail_addressbook'), '', 'ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToContacts', '', '', '_top');
886  }
887 
888  // private notes
889  if (!$this->ilias->getSetting("disable_notes"))
890  {
891  $selection->addItem($lng->txt("notes_and_comments"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNotes",
892  "", "", "_top");
893  }
894 
895  // bookmarks
896  if (!$this->ilias->getSetting("disable_bookmarks"))
897  {
898  $selection->addItem($lng->txt("bookmarks"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToBookmarks",
899  "", "", "_top");
900  }
901 
902  // settings
903  $selection->addItem($lng->txt("personal_settings"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSettings",
904  "", "", "_top");
905 
906  break;
907 
908  // administration
909  case "administration":
910  $selection->setListTitle($lng->txt("administration"));
911  $selection->setId("dd_adm");
912  $selection->setAsynch(true);
913  $selection->setAsynchUrl("ilias.php?baseClass=ilAdministrationGUI&cmd=getDropDown&cmdMode=asynch");
914  //$this->renderEntry($a_tpl, "administration",
915  // $lng->txt("administration"),
916  // $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
917  // $this->target);
918 
919  break;
920 
921  }
922 
923 // $selection->setTriggerEvent("mouseover");
924 // $selection->setAutoHide(true);
925 
926  // bs-patch start
927  global $ilUser;
928  $a_tpl->setVariable("TXT_ADMINISTRATION", $lng->txt("administration"));
929  $a_tpl->parseCurrentBlock();
930  return;
931  // bs-patch end
932 
933  $html = $selection->getHTML();
934  $a_tpl->setVariable($id_up."_DROP_DOWN", $html);
935  $a_tpl->parseCurrentBlock();
936  }
ILIAS Setting Class.
static _getInstance()
get singleton instance
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
static _enabledLearningProgress()
check wether learing progress is enabled or not
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
User interface class for advanced drop-down selection lists.
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderEntry()

ilMainMenuGUI::renderEntry (   $a_tpl,
  $a_id,
  $a_txt,
  $a_script,
  $a_target = "_top" 
)

Render main menu entry.

Parameters

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

References $_GET, $ilCtrl, $ilSetting, $lng, $t, ilObjUserTracking\_enabledLearningProgress(), ilObject\_getIcon(), ilCalendarSettings\_getInstance(), ilLink\_getStaticLink(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), ilObject\_lookupObjId(), ilBadgeHandler\getInstance(), ilBuddySystem\getInstance(), ilAccessKey\getKey(), ilHelp\getMainMenuTooltip(), ilUtil\img(), ilAccessKey\LAST_VISITED, Monolog\Handler\mail(), ilAccessKey\PERSONAL_DESKTOP, and ilUtil\shortenText().

Referenced by renderMainMenuListEntries().

444  {
445  global $lng, $ilNavigationHistory, $ilSetting, $rbacsystem, $ilCtrl;
446 
447  $id = strtolower($a_id);
448  $id_up = strtoupper($a_id);
449  $a_tpl->setCurrentBlock("entry_".$id);
450 
451  include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
452 
453  // repository
454  if ($a_id == "repository")
455  {
456  $gl = new ilGroupedListGUI();
457  $gl->setAsDropDown(true);
458 
459  include_once("./Services/Link/classes/class.ilLink.php");
461 
462  $gl->addEntry($icon." ".$a_txt." - ".$lng->txt("rep_main_page"), ilLink::_getStaticLink(1,'root',true),
463  "_top");
464 
465  $items = $ilNavigationHistory->getItems();
466  reset($items);
467  $cnt = 0;
468  $first = true;
469 
470  foreach($items as $k => $item)
471  {
472  if ($cnt >= 10) break;
473 
474  if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) ||
475  ($item["ref_id"] != $_GET["ref_id"] || !$first)) // do not list current item
476  {
477  if ($cnt == 0)
478  {
479  $gl->addGroupHeader($lng->txt("last_visited"), "ilLVNavEnt");
480  }
481  $obj_id = ilObject::_lookupObjId($item["ref_id"]);
482  $cnt ++;
483  $icon = ilUtil::img(ilObject::_getIcon($obj_id, "tiny"));
484  $ititle = ilUtil::shortenText(strip_tags($item["title"]), 50, true); // #11023
485  $gl->addEntry($icon." ".$ititle, $item["link"], "_top", "", "ilLVNavEnt");
486 
487  }
488  $first = false;
489  }
490 
491  if ($cnt > 0)
492  {
493  $gl->addEntry("» ".$lng->txt("remove_entries"), "#", "",
494  "return il.MainMenu.removeLastVisitedItems('".
495  $ilCtrl->getLinkTargetByClass("ilnavigationhistorygui", "removeEntries", "", true)."');",
496  "ilLVNavEnt");
497  }
498 
499  $a_tpl->setVariable("REP_EN_OV", $gl->getHTML());
500  }
501 
502  // desktop
503  if ($a_id == "desktop")
504  {
505  $gl = new ilGroupedListGUI();
506  $gl->setAsDropDown(true);
507 
508  // overview
509  $gl->addEntry($lng->txt("overview"),
510  "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems",
511  "_top", "", "", "mm_pd_sel_items", ilHelp::getMainMenuTooltip("mm_pd_sel_items"),
512  "left center", "right center", false);
513 
514  // my groups and courses, if both is available
515  if($ilSetting->get('disable_my_offers') == 0 &&
516  $ilSetting->get('disable_my_memberships') == 0)
517  {
518  $gl->addEntry($lng->txt("my_courses_groups"),
519  "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships",
520  "_top", "", "", "mm_pd_crs_grp", ilHelp::getMainMenuTooltip("mm_pd_crs_grp"),
521  "left center", "right center", false);
522  }
523 
524  // bookmarks
525  if (!$this->ilias->getSetting("disable_bookmarks"))
526  {
527  $gl->addEntry($lng->txt("bookmarks"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks",
528  "_top", "", "", "mm_pd_bookm", ilHelp::getMainMenuTooltip("mm_pd_bookm"),
529  "left center", "right center", false);
530  }
531 
532  // private notes
533  if (!$this->ilias->getSetting("disable_notes") || !$ilSetting->get("disable_comments"))
534  {
535  $lng->loadLanguageModule("notes");
536  $t = $lng->txt("notes");
537  $c = "jumpToNotes";
538  if (!$this->ilias->getSetting("disable_notes") && !$ilSetting->get("disable_comments"))
539  {
540  $t = $lng->txt("notes_and_comments");
541  }
542  if ($this->ilias->getSetting("disable_notes"))
543  {
544  $t = $lng->txt("notes_comments");
545  $c = "jumpToComments";
546  }
547  $gl->addEntry($t, "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=".$c,
548  "_top", "", "", "mm_pd_notes", ilHelp::getMainMenuTooltip("mm_pd_notes"),
549  "left center", "right center", false);
550  }
551 
552  // news
553  if ($ilSetting->get("block_activated_news"))
554  {
555  $gl->addEntry($lng->txt("news"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews",
556  "_top", "", "", "mm_pd_news", ilHelp::getMainMenuTooltip("mm_pd_news"),
557  "left center", "right center", false);
558  }
559 
560  // overview is always active
561  $gl->addSeparator();
562 
563  $separator = false;
564 
565  if(!$ilSetting->get("disable_personal_workspace"))
566  {
567  // workspace
568  $gl->addEntry($lng->txt("personal_workspace"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace",
569  "_top", "", "", "mm_pd_wsp", ilHelp::getMainMenuTooltip("mm_pd_wsp"),
570  "left center", "right center", false);
571 
572  $separator = true;
573  }
574 
575  // portfolio
576  if ($ilSetting->get('user_portfolios'))
577  {
578  $gl->addEntry($lng->txt("portfolio"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio",
579  "_top", "", "", "mm_pd_port", ilHelp::getMainMenuTooltip("mm_pd_port"),
580  "left center", "right center", false);
581 
582  $separator = true;
583  }
584 
585  // skills
586  $skmg_set = new ilSetting("skmg");
587  if ($skmg_set->get("enable_skmg"))
588  {
589  $gl->addEntry($lng->txt("skills"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills",
590  "_top", "", "", "mm_pd_skill", ilHelp::getMainMenuTooltip("mm_pd_skill"),
591  "left center", "right center", false);
592 
593  $separator = true;
594  }
595 
596  // Learning Progress
597  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
601  {
602  //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
603  $gl->addEntry($lng->txt("learning_progress"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToLP",
604  "_top", "", "", "mm_pd_lp", ilHelp::getMainMenuTooltip("mm_pd_lp"),
605  "left center", "right center", false);
606 
607  $separator = true;
608  }
609 
610  if($separator)
611  {
612  $gl->addSeparator();
613  }
614 
615  $separator = false;
616 
617  // calendar
618  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
619  $settings = ilCalendarSettings::_getInstance();
620  if($settings->isEnabled())
621  {
622  $gl->addEntry($lng->txt("calendar"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar",
623  "_top", "", "", "mm_pd_cal", ilHelp::getMainMenuTooltip("mm_pd_cal"),
624  "left center", "right center", false);
625 
626  $separator = true;
627  }
628 
629  // mail
630  if($this->mail)
631  {
632  $gl->addEntry($lng->txt('mail'), 'ilias.php?baseClass=ilMailGUI', '_top',
633  "", "", "mm_pd_mail", ilHelp::getMainMenuTooltip("mm_pd_mail"),
634  "left center", "right center", false);
635 
636  $separator = true;
637  }
638 
639  // contacts
640  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
641  if(ilBuddySystem::getInstance()->isEnabled())
642  {
643  $gl->addEntry($lng->txt('mail_addressbook'),
644  'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts', '_top'
645  , "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_contacts"),
646  "left center", "right center", false);
647 
648  $separator = true;
649  }
650 
651  if($separator)
652  {
653  $gl->addSeparator();
654  }
655 
656  require_once 'Services/Badge/classes/class.ilBadgeHandler.php';
657  if(ilBadgeHandler::getInstance()->isActive())
658  {
659  $gl->addEntry($lng->txt('obj_bdga'),
660  'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBadges', '_top'
661  , "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_badges"),
662  "left center", "right center", false);
663 
664  $gl->addSeparator();
665  }
666 
667  // profile
668  $gl->addEntry($lng->txt("personal_profile"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile",
669  "_top", "", "", "mm_pd_profile", ilHelp::getMainMenuTooltip("mm_pd_profile"),
670  "left center", "right center", false);
671 
672  // settings
673  $gl->addEntry($lng->txt("personal_settings"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings",
674  "_top", "", "", "mm_pd_sett", ilHelp::getMainMenuTooltip("mm_pd_sett"),
675  "left center", "right center", false);
676 
677  $a_tpl->setVariable("DESK_CONT_OV", $gl->getHTML());
678  }
679 
680  $a_tpl->setVariable("TXT_".$id_up, $a_txt);
681  $a_tpl->setVariable("SCRIPT_".$id_up, $a_script);
682  $a_tpl->setVariable("TARGET_".$id_up, $a_target);
683  if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
684  {
685  //$a_tpl->setVariable("MM_CLASS", "MMActive");
686  $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
687  }
688  else
689  {
690  //$a_tpl->setVariable("MM_CLASS", "MMInactive");
691  }
692 
693  if($a_id == "repository")
694  {
695  include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
697  {
698  $a_tpl->setVariable("ACC_KEY_REPOSITORY", 'accesskey="'.
700  }
701  }
702  if($a_id == "desktop")
703  {
704  include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
706  {
707  $a_tpl->setVariable("ACC_KEY_DESKTOP", 'accesskey="'.
709  }
710  }
711 
712 
713  $a_tpl->parseCurrentBlock();
714  }
ILIAS Setting Class.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _getInstance()
get singleton instance
$_GET["client_id"]
static getKey($a_func_id, $lang_key="0", $a_ignore_default=false)
Get single access key.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
global $ilCtrl
Definition: ilias.php:18
static _enabledLearningProgress()
check wether learing progress is enabled or not
Grouped list GUI class.
static _lookupObjId($a_id)
redirection script todo: (a better solution should control the processing via a xml file) ...
static getMainMenuTooltip($a_item_id)
Get main menu tooltip.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
static getInstance()
Constructor.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelpButtons()

ilMainMenuGUI::renderHelpButtons ( )

Render help button.

Parameters

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

References $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, ilTooltipGUI\addTooltip(), defined, and getMode().

Referenced by setTemplateVars().

946  {
947  global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser;
948 
949  // screen id
950  if ((defined("OH_REF_ID") && OH_REF_ID > 0) || DEVMODE == 1)
951  {
952  if ($ilHelp->getScreenId() != "")
953  {
954  if($this->getMode() == self::MODE_FULL)
955  {
956  $this->tpl->setCurrentBlock("screen_id");
957  $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId());
958  $this->tpl->parseCurrentBlock();
959  }
960  }
961  }
962 
963  $help_active = false;
964 
965  include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
966  $helpl = new ilGroupedListGUI();
967  $helpl->setAsDropDown(true, true);
968 
969  if ($ilHelp->hasSections())
970  {
971  $help_active = true;
972 
973  $lng->loadLanguageModule("help");
974  //$this->tpl->setCurrentBlock("help_icon");
975 
976  // add javascript needed by help (to do: move to help class)
977  $tpl->addJavascript("./Services/Help/js/ilHelp.js");
978  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
979  $acc = new ilAccordionGUI();
980  $acc->addJavascript();
981  $acc->addCss();
982 
983  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
984  ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "",
985  "bottom center", "top center", false);
986  $helpl->addEntry("<span>&nbsp;</span> ".$lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);");
987  }
988 
989  $module_id = (int) $ilSetting->get("help_module");
990  if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
991  $ilSetting->get("help_mode") != "1")
992  {
993  $help_active = true;
994 
995  $lng->loadLanguageModule("help");
996  $tpl->addJavascript("./Services/Help/js/ilHelp.js");
997 
998  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
999  ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "",
1000  "bottom center", "top center", false);
1001  $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> '.$lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);");
1002  }
1003 
1004  if($help_active)
1005  {
1006  $this->tpl->setCurrentBlock("help");
1007  $this->tpl->setVariable("TXT_HELP", $lng->txt("help"));
1008  $this->tpl->setVariable("HELP_SELECT", $helpl->getHTML());
1009  $this->tpl->parseCurrentBlock();
1010 
1011  // always set ajax url
1012  $ts = $ilCtrl->getTargetScript();
1013  $ilCtrl->setTargetScript("ilias.php");
1014 
1015  $ilHelp->setCtrlPar();
1016  $tpl->addOnLoadCode("il.Help.setAjaxUrl('".
1017  $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
1018  ."');");
1019  $ilCtrl->setTargetScript($ts);
1020  }
1021  }
global $ilCtrl
Definition: ilias.php:18
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.
Grouped list GUI class.
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
Accordion user interface class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderMainMenuListEntries()

ilMainMenuGUI::renderMainMenuListEntries (   $a_tpl,
  $a_call_get = true 
)

desc

Parameters

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

References $GLOBALS, $ilias, $ilSetting, $ilUser, $lng, $nd, $title, _checkAdministrationPermission(), renderDropDown(), and renderEntry().

Referenced by setTemplateVars().

395  {
396  global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
397 
398  // personal desktop
399  if ($GLOBALS['DIC']['ilUser']->getId() != ANONYMOUS_USER_ID)
400  {
401  $this->renderEntry($a_tpl, "desktop",
402  $lng->txt("personal_desktop"), "#");
403  }
404 
405  // repository
406  if($ilAccess->checkAccess('visible','',ROOT_FOLDER_ID))
407  {
408  include_once('./Services/Link/classes/class.ilLink.php');
409  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
410  $title = $nd["title"];
411  if ($title == "ILIAS")
412  {
413  $title = $lng->txt("repository");
414  }
415  if($GLOBALS['DIC']['ilUser']->getId() != ANONYMOUS_USER_ID)
416  {
417  $this->renderEntry($a_tpl, "repository",
418  $title, "#");
419  }
420  }
421 
422 
423  // administration
425  {
426  $this->renderDropDown($a_tpl, "administration");
427  }
428 
429  if ($a_call_get)
430  {
431  return $a_tpl->get();
432  }
433 
434  return "";
435  }
renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target="_top")
Render main menu entry.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$nd
Definition: error.php:11
$ilUser
Definition: imgupload.php:18
renderDropDown($a_tpl, $a_id)
GetDropDownHTML.
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
static _checkAdministrationPermission()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderOnScreenChatMenu()

ilMainMenuGUI::renderOnScreenChatMenu ( )
protected

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

Referenced by setTemplateVars().

1045  {
1046  require_once 'Services/OnScreenChat/classes/class.ilOnScreenChatMenuGUI.php';
1047 
1048  $menu = new ilOnScreenChatMenuGUI();
1049  $this->tpl->setVariable('ONSCREENCHAT', $menu->getMainMenuHTML());
1050  }
Class ilOnScreenChatMenuGUI.
+ Here is the caller graph for this function:

◆ renderOnScreenNotifications()

ilMainMenuGUI::renderOnScreenNotifications ( \ilObjUser  $user,
\ilTemplate  $mainTpl,
\ilLanguage  $lng 
)
protected
Parameters
\ilObjUser$user
\ilTemplate$mainTpl
\ilLanguage$lng

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

References getMode(), and ilObjUser\isAnonymous().

Referenced by setTemplateVars().

1069  {
1070  if ($this->getMode() != self::MODE_TOPBAR_REDUCED && !$user->isAnonymous()) {
1071  $this->tpl->touchBlock('osd_container');
1072 
1073  require_once 'Services/Notifications/classes/class.ilNotificationOSDGUI.php';
1074  $osdGui = new ilNotificationOSDGUI($user, $mainTpl, $lng);
1075  $osdGui->render();
1076  }
1077  }
Class ilNotificationOSDGUI.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderStatusBox()

ilMainMenuGUI::renderStatusBox (   $a_tpl)

Render status box.

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

References $DIC, $ilUser, ilMailGlobalServices\getNumberOfNewMailsByUserId(), and Monolog\Handler\mail().

Referenced by setTemplateVars().

366  {
367  global $ilUser, $DIC;
368  $ui_factory = $DIC->ui()->factory();
369  $ui_renderer = $DIC->ui()->renderer();
370 
371  if ($this->mail) {
372  $new_mails = ilMailGlobalServices::getNumberOfNewMailsByUserId($ilUser->getId());
373 
374  $a_tpl->setCurrentBlock('status_box');
375 
376  $glyph = $ui_factory->glyph()->mail("ilias.php?baseClass=ilMailGUI");
377 
378  if ($new_mails > 0) {
379  $glyph = $glyph->withCounter($ui_factory->counter()->novelty($new_mails));
380  }
381 
382  $a_tpl->setVariable('GLYPH', $ui_renderer->render($glyph));
383  $a_tpl->parseCurrentBlock();
384  }
385  }
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
$ilUser
Definition: imgupload.php:18
static getNumberOfNewMailsByUserId($usr_id)
Determines the number of new mails for the passed user id and stores this information in a local cach...
global $DIC
+ 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"|"mail"|"chat_invitation"|"administration"

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

104  {
105  $this->active = $a_active;
106  }

◆ setLoginTargetPar()

ilMainMenuGUI::setLoginTargetPar (   $a_val)

Set target parameter for login (public sector).

This is used by the main menu

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

132  {
133  $this->login_target_par = $a_val;
134  }

◆ setMode()

ilMainMenuGUI::setMode (   $a_value)

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

Referenced by __construct(), and initMemberView().

71  {
72  $this->mode = (int)$a_value;
73  }
+ Here is the caller graph for this function:

◆ setTemplate()

ilMainMenuGUI::setTemplate ( $tpl)

set output template

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

References $tpl.

112  {
113  echo "ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
114  return;
115  $this->tpl = $tpl;
116  }

◆ setTemplateVars()

ilMainMenuGUI::setTemplateVars ( )

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

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

References $GLOBALS, $html, $ilias, $ilSetting, $ilUser, $lng, ilSearchSettings\_getSearchSettingRefId(), ilRegistrationSettings\_lookupRegistrationType(), array, ilTemplate\buildLoginTarget(), defined, getHeaderURL(), ilUtil\getImagePath(), getLoginTargetPar(), getMode(), ilUtil\getStyleSheetLocation(), IL_COMP_SERVICE, IL_REG_DISABLED, ilUtil\img(), populateWithBuddySystem(), populateWithOnScreenChat(), renderAwareness(), renderHelpButtons(), renderMainMenuListEntries(), renderOnScreenChatMenu(), renderOnScreenNotifications(), and renderStatusBox().

Referenced by getHTML().

174  {
175  global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin;
176 
177  if($this->logo_only)
178  {
179  $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
180  $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
181 
182  // #15759
183  include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
184  $header_top_title = ilObjSystemFolder::_getHeaderTitle();
185  if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title"))
186  {
187  $this->tpl->setCurrentBlock("header_top_title");
188  $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
189  $this->tpl->parseCurrentBlock();
190  }
191 
192  return;
193  }
194 
195  // get user interface plugins
196  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
197 
198  if($this->getMode() != self::MODE_TOPBAR_REDUCED &&
199  $this->getMode() != self::MODE_TOPBAR_MEMBERVIEW)
200  {
201  // search
202  include_once 'Services/Search/classes/class.ilSearchSettings.php';
203  if($rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
204  {
205  include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php';
206  $main_search = new ilMainMenuSearchGUI();
207  $html = "";
208 
209  // user interface plugin slot + default rendering
210  include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
211  $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search",
212  array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search));
213  if (!$uip->replaced())
214  {
215  $html = $main_search->getHTML();
216  }
217  $html = $uip->getHTML($html);
218 
219  if (strlen($html))
220  {
221  $this->tpl->setVariable('SEARCHBOX',$html);
222  }
223  }
224 
225  $this->renderStatusBox($this->tpl);
226 
227  // online help
228  $this->renderHelpButtons();
229 
230  $this->renderOnScreenChatMenu();
231  $this->populateWithBuddySystem();
232  $this->populateWithOnScreenChat();
233  $this->renderAwareness();
234  }
235 
236  if($this->getMode() == self::MODE_FULL)
237  {
238  $mmle_html = "";
239 
240  // user interface plugin slot + default rendering
241  include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
242  $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries",
243  array("main_menu_gui" => $this));
244  if (!$uip->replaced())
245  {
246  $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu");
247  $mmle_html = $this->renderMainMenuListEntries($mmle_tpl);
248  }
249  $mmle_html = $uip->getHTML($mmle_html);
250 
251  $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html);
252  }
253 
254  if($this->getMode() != self::MODE_TOPBAR_MEMBERVIEW)
255  {
256  $link_dir = (defined("ILIAS_MODULE"))
257  ? "../"
258  : "";
259 
260  // login stuff
261  if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID)
262  {
263  include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
265  {
266  $this->tpl->setCurrentBlock("registration_link");
267  $this->tpl->setVariable("TXT_REGISTER",$lng->txt("register"));
268  $this->tpl->setVariable("LINK_REGISTER", $link_dir."register.php?client_id=".rawurlencode(CLIENT_ID)."&lang=".$ilias->account->getCurrentLanguage());
269  $this->tpl->parseCurrentBlock();
270  }
271 
272  // language selection
273  $selection = self::getLanguageSelection();
274  if($selection)
275  {
276  // bs-patch start
277  global $ilUser, $lng;
278  $this->tpl->setVariable("TXT_LANGSELECT", $lng->txt("language"));
279  // bs-patch end
280  $this->tpl->setVariable("LANG_SELECT", $selection);
281  }
282 
283  $this->tpl->setCurrentBlock("userisanonymous");
284  $this->tpl->setVariable("TXT_NOT_LOGGED_IN",$lng->txt("not_logged_in"));
285  $this->tpl->setVariable("TXT_LOGIN",$lng->txt("log_in"));
286 
287  // #13058
288  $target_str = ($this->getLoginTargetPar() != "")
289  ? $this->getLoginTargetPar()
291  $this->tpl->setVariable("LINK_LOGIN",
292  $link_dir."login.php?target=".$target_str."&client_id=".rawurlencode(CLIENT_ID)."&cmd=force_login&lang=".$ilias->account->getCurrentLanguage());
293  $this->tpl->parseCurrentBlock();
294  }
295  else
296  {
297  $this->renderOnScreenNotifications($ilUser, $GLOBALS['tpl'], $lng);
298 
299  $this->tpl->setCurrentBlock("userisloggedin");
300  $this->tpl->setVariable("TXT_LOGIN_AS",$lng->txt("login_as"));
301  $user_img_src = $ilias->account->getPersonalPicturePath("small", true);
302  $user_img_alt = $ilias->account->getFullname();
303  $this->tpl->setVariable("USER_IMG", ilUtil::img($user_img_src, $user_img_alt));
304  $this->tpl->setVariable("USR_LINK_PROFILE", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile");
305  $this->tpl->setVariable("USR_TXT_PROFILE", $lng->txt("personal_profile"));
306  $this->tpl->setVariable("USR_LINK_SETTINGS", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings");
307  $this->tpl->setVariable("USR_TXT_SETTINGS", $lng->txt("personal_settings"));
308  $this->tpl->setVariable("TXT_LOGOUT2",$lng->txt("logout"));
309  $this->tpl->setVariable("LINK_LOGOUT2", $link_dir."logout.php?lang=".$ilias->account->getCurrentLanguage());
310  $this->tpl->setVariable("USERNAME",$ilias->account->getFullname());
311  $this->tpl->setVariable("LOGIN",$ilias->account->getLogin());
312  $this->tpl->setVariable("MATRICULATION",$ilias->account->getMatriculation());
313  $this->tpl->setVariable("EMAIL",$ilias->account->getEmail());
314  $this->tpl->parseCurrentBlock();
315  }
316  }
317  else
318  {
319  // member view info
320  $this->tpl->setVariable("TOPBAR_CLASS", " ilMemberViewMainHeader");
321  $this->tpl->setVariable("MEMBER_VIEW_INFO", $lng->txt("mem_view_long"));
322  }
323 
324  if(!$this->topbar_back_url)
325  {
326  include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
327  $header_top_title = ilObjSystemFolder::_getHeaderTitle();
328  if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title"))
329  {
330  $this->tpl->setCurrentBlock("header_top_title");
331  // php7-workaround alex: added phpversion() to help during development of php7 compatibility
332  $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
333  $this->tpl->parseCurrentBlock();
334  }
335  }
336  else
337  {
338  $this->tpl->setCurrentBlock("header_back_bl");
339  $this->tpl->setVariable("URL_HEADER_BACK", $this->topbar_back_url);
340  $this->tpl->setVariable("TXT_HEADER_BACK", $this->topbar_back_caption
341  ? $this->topbar_back_caption
342  : $lng->txt("back"));
343  $this->tpl->parseCurrentBlock();
344  }
345 
346  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
347 
348  if($this->getMode() == self::MODE_FULL)
349  {
350  // $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
351  $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
352  $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
353  }
354 
355  include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
356 
357  $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
358 
359  $this->tpl->parseCurrentBlock();
360  }
static buildLoginTarget()
Add current object (repository/workspace) as target for login url.
renderOnScreenNotifications(\ilObjUser $user, \ilTemplate $mainTpl, \ilLanguage $lng)
getLoginTargetPar()
Get target parameter for login.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
renderHelpButtons()
Render help button.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
UI interface hook processor.
populateWithBuddySystem()
Includes all buddy system/user connections related javascript code.
renderAwareness()
Render awareness tool.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
$ilUser
Definition: imgupload.php:18
renderMainMenuListEntries($a_tpl, $a_call_get=true)
desc
Create styles array
The data for the language used.
Add a search box to main menu.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
renderStatusBox($a_tpl)
Render status box.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
$html
Definition: example_001.php:87
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTopBarBack()

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

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

Referenced by initMemberView().

81  {
82  $this->topbar_back_url = $a_url;
83  $this->topbar_back_caption = trim($a_caption);
84  }
+ Here is the caller graph for this function:

◆ showLogoOnly()

ilMainMenuGUI::showLogoOnly (   $a_value)

Toggle rendering of main menu, search, user info.

See also
ilImprintGUI
Parameters
bool$a_value

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

1088  {
1089  $this->logo_only = (bool)$a_value;
1090  }

Field Documentation

◆ $ilias

ilMainMenuGUI::$ilias

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

Referenced by __construct(), renderMainMenuListEntries(), and setTemplateVars().

◆ $mail

ilMainMenuGUI::$mail

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

◆ $mode

ilMainMenuGUI::$mode
protected

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

Referenced by getMode().

◆ $start_template

ilMainMenuGUI::$start_template

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

◆ $target

ilMainMenuGUI::$target

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

◆ $topbar_back_caption

ilMainMenuGUI::$topbar_back_caption
protected

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

◆ $topbar_back_url

ilMainMenuGUI::$topbar_back_url
protected

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

◆ $tpl

ilMainMenuGUI::$tpl

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

Referenced by renderHelpButtons(), and setTemplate().

◆ MODE_FULL

const ilMainMenuGUI::MODE_FULL = 1

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

Referenced by ilPersonalWorkspaceGUI\executeCommand().

◆ MODE_TOPBAR_MEMBERVIEW

const ilMainMenuGUI::MODE_TOPBAR_MEMBERVIEW = 4

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

◆ MODE_TOPBAR_ONLY

const ilMainMenuGUI::MODE_TOPBAR_ONLY = 2

◆ MODE_TOPBAR_REDUCED

const ilMainMenuGUI::MODE_TOPBAR_REDUCED = 3

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

Referenced by ilTemplate\setLocator().


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