ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMainMenuGUI Class Reference

Handles display of the main menu. More...

+ Collaboration diagram for ilMainMenuGUI:

Public Member Functions

 ilMainMenuGUI ($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...
 
 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...
 
 _checkAdministrationPermission ()
 
 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)
 

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 @global type $lng. More...
 
 populateWithBuddySystem ()
 Includes all buddy system/user connections related javascript code. More...
 
 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.

Member Function Documentation

◆ _checkAdministrationPermission()

ilMainMenuGUI::_checkAdministrationPermission ( )

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

799 {
800 global $rbacsystem;
801
802 //if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
803 if($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID))
804 {
805 return true;
806 }
807 return false;
808 }

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

+ Here is the caller graph for this function:

◆ getHeaderURL()

ilMainMenuGUI::getHeaderURL ( )
protected

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

1136 {
1137 include_once './Services/User/classes/class.ilUserUtil.php';
1139
1140 if(!$url)
1141 {
1142 $url = "./goto.php?target=root_1";
1143 }
1144
1145 return $url;
1146 }
static getStartingPointAsUrl()
Get current starting point setting as URL.
$url
Definition: shib_logout.php:72

References $url, and ilUserUtil\getStartingPointAsUrl().

+ Here is the call graph for this function:

◆ getHTML()

ilMainMenuGUI::getHTML ( )

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

811 {
812 // this is a workaround for bugs like 14016
813 // the main menu does not need the YUI connection, but many other
814 // features since they rely on il.Util.sendAjaxGetRequestToUrl (see Services/Javascript)
815 // which still uses YUI. This should be migrated to jQuery with a future major release
816 include_once "Services/YUI/classes/class.ilYuiUtil.php";
817 ilYUIUtil::initConnection();
818
819 $this->setTemplateVars();
820
821 return $this->tpl->get();
822 }

◆ getLanguageSelection()

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

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

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);
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 }
Grouped list GUI class.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
global $lng
Definition: privfeed.php:40
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $ilUser
Definition: imgupload.php:15

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

Referenced by ilStartUpGUI\getLanguageSelection().

+ 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.

140 {
141 return $this->login_target_par;
142 }

◆ getMode()

ilMainMenuGUI::getMode ( )

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

76 {
77 return $this->mode;
78 }

References $mode.

Referenced by getSpacerClass(), and renderHelpButtons().

+ Here is the caller graph for this function:

◆ getScriptTarget()

ilMainMenuGUI::getScriptTarget (   $a_script)

generates complete script target (private)

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

779 {
780 global $ilias;
781
782 $script = "./".$a_script;
783
784 //if ($this->start_template == true)
785 //{
786 //if(is_file("./templates/".$ilias->account->skin."/tpl.start.html"))
787 //{
788 // $script = "./start.php?script=".rawurlencode($script);
789 //}
790 //}
791 if (defined("ILIAS_MODULE"))
792 {
793 $script = ".".$script;
794 }
795 return $script;
796 }

References $ilias.

◆ getSpacerClass()

ilMainMenuGUI::getSpacerClass ( )

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

87 {
88 switch($this->getMode())
89 {
93 return "ilFixedTopSpacerBarOnly";
94
95 case self::MODE_FULL:
96 return "ilFixedTopSpacer";
97 }
98 }

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

+ 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 }

◆ ilMainMenuGUI()

ilMainMenuGUI::ilMainMenuGUI (   $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.

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 }
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
initMemberView()
Init member view @global type $lng.
static getInstance()
Get instance.
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file)

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

+ Here is the call graph for this function:

◆ initMemberView()

ilMainMenuGUI::initMemberView ( )
protected

Init member view @global type $lng.

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

829 {
830 global $lng;
831
832 include_once './Services/Container/classes/class.ilMemberViewSettings.php';
833 $ref_id = ilMemberViewSettings::getInstance()->getCurrentRefId();
834
835 if(!$ref_id)
836 {
837 return FALSE;
838 }
839
840 include_once './Services/Link/classes/class.ilLink.php';
842 $ref_id,
844 array('mv' => 0));
845
846 $this->setMode(self::MODE_TOPBAR_MEMBERVIEW);
847 $this->setTopBarBack($url, $lng->txt('mem_view_close'));
848 }
setTopBarBack($a_url, $a_caption=null)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
$ref_id
Definition: sahs_server.php:39

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

Referenced by ilMainMenuGUI().

+ 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 1102 of file class.ilMainMenuGUI.php.

1103 {
1104 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
1105 if(ilBuddySystem::getInstance()->isEnabled())
1106 {
1107 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystemGUI.php';
1108 ilBuddySystemGUI::initializeFrontend();
1109 }
1110 }

References ilBuddySystem\getInstance().

+ Here is the call graph for this function:

◆ renderAwareness()

ilMainMenuGUI::renderAwareness ( )

Render awareness tool.

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

1116 {
1117 include_once("./Services/Awareness/classes/class.ilAwarenessGUI.php");
1119
1120 $this->tpl->setVariable("AWARENESS", $aw->getMainMenuHTML());
1121 }
static getInstance()
Get instance.

References ilAwarenessGUI\getInstance().

+ Here is the call graph for this function:

◆ renderDropDown()

ilMainMenuGUI::renderDropDown (   $a_tpl,
  $a_id 
)

GetDropDownHTML.

Parameters

return

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

857 {
858 global $lng, $ilSetting, $rbacsystem;
859
860 $id = strtolower($a_id);
861 $id_up = strtoupper($a_id);
862 $a_tpl->setCurrentBlock("entry_".$id);
863 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
864 $selection = new ilAdvancedSelectionListGUI();
865 if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
866 {
867 $selection->setSelectionHeaderClass("MMActive");
868 $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
869 }
870 else
871 {
872 $selection->setSelectionHeaderClass("MMInactive");
873 }
874
875 $selection->setSelectionHeaderSpanClass("MMSpan");
876
877 $selection->setHeaderIcon(ilAdvancedSelectionListGUI::ICON_ARROW);
878 $selection->setItemLinkClass("small");
879 $selection->setUseImages(false);
880
881 switch ($id)
882 {
883 // desktop drop down
884 case "desktop":
885 $selection->setListTitle($lng->txt("personal_desktop"));
886 $selection->setId("dd_pd");
887
888 // overview
889 $selection->addItem($lng->txt("overview"), "", "ilias.php?baseClass=ilPersonalDesktopGUI",
890 "", "", "_top");
891
892 if(!$ilSetting->get("disable_personal_workspace"))
893 {
894 // workspace
895 $selection->addItem($lng->txt("personal_workspace"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace",
896 "", "", "_top");
897 }
898
899 // profile
900 $selection->addItem($lng->txt("personal_profile"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToProfile",
901 "", "", "_top");
902
903 // skills
904 $skmg_set = new ilSetting("skmg");
905 if ($skmg_set->get("enable_skmg"))
906 {
907 $selection->addItem($lng->txt("skills"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSkills",
908 "", "", "_top");
909 }
910
911 // portfolio
912 if ($ilSetting->get('user_portfolios'))
913 {
914 $selection->addItem($lng->txt("portfolio"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToPortfolio",
915 "", "", "_top");
916 }
917
918 // news
919 if ($ilSetting->get("block_activated_news"))
920 {
921 $selection->addItem($lng->txt("news"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNews",
922 "", "", "_top");
923 }
924
925 // Learning Progress
926 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
928 {
929 //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
930 $selection->addItem($lng->txt("learning_progress"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToLP",
931 "", "", "_top");
932 }
933
934 // calendar
935 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
937 if($settings->isEnabled())
938 {
939 $selection->addItem($lng->txt("calendar"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToCalendar",
940 "", "", "_top");
941 }
942
943 // mail
944 if($this->mail)
945 {
946 $selection->addItem($lng->txt('mail'), '', 'ilias.php?baseClass=ilMailGUI', '', '', '_top');
947 }
948
949 // contacts
950 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
951 if(ilBuddySystem::getInstance()->isEnabled())
952 {
953 $selection->addItem($lng->txt('mail_addressbook'), '', 'ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToContacts', '', '', '_top');
954 }
955
956 // private notes
957 if (!$this->ilias->getSetting("disable_notes"))
958 {
959 $selection->addItem($lng->txt("notes_and_comments"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNotes",
960 "", "", "_top");
961 }
962
963 // bookmarks
964 if (!$this->ilias->getSetting("disable_bookmarks"))
965 {
966 $selection->addItem($lng->txt("bookmarks"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToBookmarks",
967 "", "", "_top");
968 }
969
970 // settings
971 $selection->addItem($lng->txt("personal_settings"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSettings",
972 "", "", "_top");
973
974 break;
975
976 // shop
977 case 'shop':
978 $selection->setListTitle($lng->txt("shop"));
979 $selection->setId("dd_shp");
980 $selection->addItem($lng->txt("shop"), "", "ilias.php?baseClass=ilShopController&cmd=firstpage",
981 "", "", "_top");
982 break;
983
984 // administration
985 case "administration":
986 $selection->setListTitle($lng->txt("administration"));
987 $selection->setId("dd_adm");
988 $selection->setAsynch(true);
989 $selection->setAsynchUrl("ilias.php?baseClass=ilAdministrationGUI&cmd=getDropDown&cmdMode=asynch");
990 //$this->renderEntry($a_tpl, "administration",
991 // $lng->txt("administration"),
992 // $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
993 // $this->target);
994
995 break;
996
997 }
998
999// $selection->setTriggerEvent("mouseover");
1000// $selection->setAutoHide(true);
1001
1002 // bs-patch start
1003 global $ilUser;
1004 $a_tpl->setVariable("TXT_ADMINISTRATION", $lng->txt("administration"));
1005 $a_tpl->parseCurrentBlock();
1006 return;
1007 // bs-patch end
1008
1009 $html = $selection->getHTML();
1010 $a_tpl->setVariable($id_up."_DROP_DOWN", $html);
1011 $a_tpl->parseCurrentBlock();
1012 }
User interface class for advanced drop-down selection lists.
static _getInstance()
get singleton instance
static _enabledLearningProgress()
check wether learing progress is enabled or not
ILIAS Setting Class.
$html
Definition: example_001.php:87
global $ilSetting
Definition: privfeed.php:40

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

Referenced by renderMainMenuListEntries().

+ 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

return

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

497 {
498 global $lng, $ilNavigationHistory, $ilSetting, $rbacsystem, $ilCtrl;
499
500 $id = strtolower($a_id);
501 $id_up = strtoupper($a_id);
502 $a_tpl->setCurrentBlock("entry_".$id);
503
504 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
505
506 // repository
507 if ($a_id == "repository")
508 {
509 $gl = new ilGroupedListGUI();
510 $gl->setAsDropDown(true);
511
512 include_once("./Services/Link/classes/class.ilLink.php");
514
515 $gl->addEntry($icon." ".$a_txt." - ".$lng->txt("rep_main_page"), ilLink::_getStaticLink(1,'root',true),
516 "_top");
517
518 $items = $ilNavigationHistory->getItems();
519 reset($items);
520 $cnt = 0;
521 $first = true;
522
523 foreach($items as $k => $item)
524 {
525 if ($cnt >= 10) break;
526
527 if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) ||
528 ($item["ref_id"] != $_GET["ref_id"] || !$first)) // do not list current item
529 {
530 if ($cnt == 0)
531 {
532 $gl->addGroupHeader($lng->txt("last_visited"), "ilLVNavEnt");
533 }
534 $obj_id = ilObject::_lookupObjId($item["ref_id"]);
535 $cnt ++;
536 $icon = ilUtil::img(ilObject::_getIcon($obj_id, "tiny"));
537 $ititle = ilUtil::shortenText(strip_tags($item["title"]), 50, true); // #11023
538 $gl->addEntry($icon." ".$ititle, $item["link"], "_top", "", "ilLVNavEnt");
539
540 }
541 $first = false;
542 }
543
544 if ($cnt > 0)
545 {
546 $gl->addEntry("» ".$lng->txt("remove_entries"), "#", "",
547 "return il.MainMenu.removeLastVisitedItems('".
548 $ilCtrl->getLinkTargetByClass("ilnavigationhistorygui", "removeEntries", "", true)."');",
549 "ilLVNavEnt");
550 }
551
552 $a_tpl->setVariable("REP_EN_OV", $gl->getHTML());
553 }
554
555 // desktop
556 if ($a_id == "desktop")
557 {
558 $gl = new ilGroupedListGUI();
559 $gl->setAsDropDown(true);
560
561 // overview
562 $gl->addEntry($lng->txt("overview"),
563 "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems",
564 "_top", "", "", "mm_pd_sel_items", ilHelp::getMainMenuTooltip("mm_pd_sel_items"),
565 "left center", "right center", false);
566
567 // my groups and courses, if both is available
568 if($ilSetting->get('disable_my_offers') == 0 &&
569 $ilSetting->get('disable_my_memberships') == 0)
570 {
571 $gl->addEntry($lng->txt("my_courses_groups"),
572 "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships",
573 "_top", "", "", "mm_pd_crs_grp", ilHelp::getMainMenuTooltip("mm_pd_crs_grp"),
574 "left center", "right center", false);
575 }
576
577 // bookmarks
578 if (!$this->ilias->getSetting("disable_bookmarks"))
579 {
580 $gl->addEntry($lng->txt("bookmarks"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks",
581 "_top", "", "", "mm_pd_bookm", ilHelp::getMainMenuTooltip("mm_pd_bookm"),
582 "left center", "right center", false);
583 }
584
585 // private notes
586 if (!$this->ilias->getSetting("disable_notes"))
587 {
588 $gl->addEntry($lng->txt("notes_and_comments"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNotes",
589 "_top", "", "", "mm_pd_notes", ilHelp::getMainMenuTooltip("mm_pd_notes"),
590 "left center", "right center", false);
591 }
592
593 // news
594 if ($ilSetting->get("block_activated_news"))
595 {
596 $gl->addEntry($lng->txt("news"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews",
597 "_top", "", "", "mm_pd_news", ilHelp::getMainMenuTooltip("mm_pd_news"),
598 "left center", "right center", false);
599 }
600
601 // overview is always active
602 $gl->addSeparator();
603
604 $separator = false;
605
606 if(!$ilSetting->get("disable_personal_workspace"))
607 {
608 // workspace
609 $gl->addEntry($lng->txt("personal_workspace"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace",
610 "_top", "", "", "mm_pd_wsp", ilHelp::getMainMenuTooltip("mm_pd_wsp"),
611 "left center", "right center", false);
612
613 $separator = true;
614 }
615
616 // portfolio
617 if ($ilSetting->get('user_portfolios'))
618 {
619 $gl->addEntry($lng->txt("portfolio"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio",
620 "_top", "", "", "mm_pd_port", ilHelp::getMainMenuTooltip("mm_pd_port"),
621 "left center", "right center", false);
622
623 $separator = true;
624 }
625
626 // skills
627 $skmg_set = new ilSetting("skmg");
628 if ($skmg_set->get("enable_skmg"))
629 {
630 $gl->addEntry($lng->txt("skills"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills",
631 "_top", "", "", "mm_pd_skill", ilHelp::getMainMenuTooltip("mm_pd_skill"),
632 "left center", "right center", false);
633
634 $separator = true;
635 }
636
637 // Learning Progress
638 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
642 {
643 //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
644 $gl->addEntry($lng->txt("learning_progress"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToLP",
645 "_top", "", "", "mm_pd_lp", ilHelp::getMainMenuTooltip("mm_pd_lp"),
646 "left center", "right center", false);
647
648 $separator = true;
649 }
650
651 if($separator)
652 {
653 $gl->addSeparator();
654 }
655
656 $separator = false;
657
658 // calendar
659 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
661 if($settings->isEnabled())
662 {
663 $gl->addEntry($lng->txt("calendar"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar",
664 "_top", "", "", "mm_pd_cal", ilHelp::getMainMenuTooltip("mm_pd_cal"),
665 "left center", "right center", false);
666
667 $separator = true;
668 }
669
670 // mail
671 if($this->mail)
672 {
673 $gl->addEntry($lng->txt('mail'), 'ilias.php?baseClass=ilMailGUI', '_top',
674 "", "", "mm_pd_mail", ilHelp::getMainMenuTooltip("mm_pd_mail"),
675 "left center", "right center", false);
676
677 $separator = true;
678 }
679
680 // contacts
681 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
682 if(ilBuddySystem::getInstance()->isEnabled())
683 {
684 $gl->addEntry($lng->txt('mail_addressbook'),
685 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts', '_top'
686 , "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_contacts"),
687 "left center", "right center", false);
688
689 $separator = true;
690 }
691
692 if($separator)
693 {
694 $gl->addSeparator();
695 }
696
697 // profile
698 $gl->addEntry($lng->txt("personal_profile"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile",
699 "_top", "", "", "mm_pd_profile", ilHelp::getMainMenuTooltip("mm_pd_profile"),
700 "left center", "right center", false);
701
702 // settings
703 $gl->addEntry($lng->txt("personal_settings"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings",
704 "_top", "", "", "mm_pd_sett", ilHelp::getMainMenuTooltip("mm_pd_sett"),
705 "left center", "right center", false);
706
707 $a_tpl->setVariable("DESK_CONT_OV", $gl->getHTML());
708 }
709
710 if(IS_PAYMENT_ENABLED)
711 {
712 // shop
713 if ($a_id == "shop")
714 {
715 $gl = new ilGroupedListGUI();
716 $gl->setAsDropDown(true);
717
718 // shop_content
719 $gl->addEntry($lng->txt("content"),
720 "ilias.php?baseClass=ilShopController&cmd=firstpage",
721 "_top");
722
723 // shoppingcart
724 include_once 'Services/Payment/classes/class.ilPaymentShoppingCart.php';
725 global $ilUser;
726 $objShoppingCart = new ilPaymentShoppingCart($ilUser);
727 $items = $objShoppingCart->getEntries();
728
729 if(count($items) > 0 )
730 {
731 $gl->addEntry($lng->txt("shoppingcart").' ('.count($items).')',
732 "ilias.php?baseClass=ilShopController&cmdClass=ilshopshoppingcartgui",
733 "_top");
734 }
735 $a_tpl->setVariable("SHOP_CONT_OV", $gl->getHTML());
736 }
737 }
738 $a_tpl->setVariable("TXT_".$id_up, $a_txt);
739 $a_tpl->setVariable("SCRIPT_".$id_up, $a_script);
740 $a_tpl->setVariable("TARGET_".$id_up, $a_target);
741 if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
742 {
743 //$a_tpl->setVariable("MM_CLASS", "MMActive");
744 $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
745 }
746 else
747 {
748 //$a_tpl->setVariable("MM_CLASS", "MMInactive");
749 }
750
751 if($a_id == "repository")
752 {
753 include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
755 {
756 $a_tpl->setVariable("ACC_KEY_REPOSITORY", 'accesskey="'.
758 }
759 }
760 if($a_id == "desktop")
761 {
762 include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
764 {
765 $a_tpl->setVariable("ACC_KEY_DESKTOP", 'accesskey="'.
767 }
768 }
769
770
771 $a_tpl->parseCurrentBlock();
772 }
$_GET["client_id"]
static getKey($a_func_id, $lang_key="0", $a_ignore_default=false)
Get single access key.
static getMainMenuTooltip($a_item_id)
Get main menu tooltip.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
global $ilCtrl
Definition: ilias.php:18
$separator

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

Referenced by renderMainMenuListEntries().

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

◆ renderHelpButtons()

ilMainMenuGUI::renderHelpButtons ( )

Render help button.

Parameters

return

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

1022 {
1023 global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser;
1024
1025 // screen id
1026 if ((defined("OH_REF_ID") && OH_REF_ID > 0) || DEVMODE == 1)
1027 {
1028 if ($ilHelp->getScreenId() != "")
1029 {
1030 if($this->getMode() == self::MODE_FULL)
1031 {
1032 $this->tpl->setCurrentBlock("screen_id");
1033 $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId());
1034 $this->tpl->parseCurrentBlock();
1035 }
1036 }
1037 }
1038
1039 $help_active = false;
1040
1041 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
1042 $helpl = new ilGroupedListGUI();
1043 $helpl->setAsDropDown(true, true);
1044
1045 if ($ilHelp->hasSections())
1046 {
1047 $help_active = true;
1048
1049 $lng->loadLanguageModule("help");
1050 //$this->tpl->setCurrentBlock("help_icon");
1051
1052 // add javascript needed by help (to do: move to help class)
1053 $tpl->addJavascript("./Services/Help/js/ilHelp.js");
1054 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
1055 $acc = new ilAccordionGUI();
1056 $acc->addJavascript();
1057 $acc->addCss();
1058
1059 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1060 ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "",
1061 "bottom center", "top center", false);
1062 $helpl->addEntry("<span>&nbsp;</span> ".$lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);");
1063 }
1064
1065 $module_id = (int) $ilSetting->get("help_module");
1066 if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
1067 $ilSetting->get("help_mode") != "1")
1068 {
1069 $help_active = true;
1070
1071 $lng->loadLanguageModule("help");
1072 $tpl->addJavascript("./Services/Help/js/ilHelp.js");
1073
1074 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1075 ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "",
1076 "bottom center", "top center", false);
1077 $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> '.$lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);");
1078 }
1079
1080 if($help_active)
1081 {
1082 $this->tpl->setCurrentBlock("help");
1083 $this->tpl->setVariable("TXT_HELP", $lng->txt("help"));
1084 $this->tpl->setVariable("HELP_SELECT", $helpl->getHTML());
1085 $this->tpl->parseCurrentBlock();
1086
1087 // always set ajax url
1088 $ts = $ilCtrl->getTargetScript();
1089 $ilCtrl->setTargetScript("ilias.php");
1090
1091 $ilHelp->setCtrlPar();
1092 $tpl->addOnLoadCode("il.Help.setAjaxUrl('".
1093 $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
1094 ."');");
1095 $ilCtrl->setTargetScript($ts);
1096 }
1097 }
Accordion user interface class.
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 $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, ilTooltipGUI\addTooltip(), and getMode().

+ Here is the call graph for this function:

◆ renderMainMenuListEntries()

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

desc

Parameters

return

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

441 {
442 global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
443
444 // personal desktop
445 if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID)
446 {
447 $this->renderEntry($a_tpl, "desktop",
448 $lng->txt("personal_desktop"), "#");
449 }
450
451 // repository
452 if($ilAccess->checkAccess('visible','',ROOT_FOLDER_ID))
453 {
454 include_once('./Services/Link/classes/class.ilLink.php');
455 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
456 $title = $nd["title"];
457 if ($title == "ILIAS")
458 {
459 $title = $lng->txt("repository");
460 }
461 if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID || IS_PAYMENT_ENABLED)
462 {
463 $this->renderEntry($a_tpl, "repository",
464 $title, "#");
465 }
466 }
467
468
469 // webshop
470 if(IS_PAYMENT_ENABLED)
471 {
472 $title = $lng->txt("shop");
473 $this->renderEntry($a_tpl, "shop", $title, "#" );
474 }
475
476 // administration
478 {
479 $this->renderDropDown($a_tpl, "administration");
480 }
481
482 if ($a_call_get)
483 {
484 return $a_tpl->get();
485 }
486
487 return "";
488 }
$_SESSION["AccountId"]
renderDropDown($a_tpl, $a_id)
GetDropDownHTML.
renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target="_top")
Render main menu entry.
$nd
Definition: error.php:11

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

+ Here is the call graph for this function:

◆ renderStatusBox()

ilMainMenuGUI::renderStatusBox (   $a_tpl)

Render status box.

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

403 {
404 global $ilUser, $lng;
405
406 $box = false;
407
408 // new mails?
409 if($this->mail)
410 {
412 if($new_mails > 0)
413 {
414 $a_tpl->setCurrentBlock('status_text');
415 $a_tpl->setVariable('STATUS_TXT', $new_mails);
416 $a_tpl->parseCurrentBlock();
417 }
418 $a_tpl->setCurrentBlock('status_item');
419 $a_tpl->setVariable('STATUS_IMG', ilUtil::getImagePath('icon_mail.svg'));
420 $a_tpl->setVariable('STATUS_IMG_ALT', $lng->txt("mail"));
421 $a_tpl->setVariable('STATUS_HREF', 'ilias.php?baseClass=ilMailGUI');
422 $a_tpl->parseCurrentBlock();
423 $box = true;
424 }
425
426 if ($box)
427 {
428 $a_tpl->setCurrentBlock("status_box");
429 $a_tpl->parseCurrentBlock();
430 }
431 }
static getNumberOfNewMailsByUserId($usr_id)
Determines the number of new mails for the passed user id and stores this information in a local cach...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $ilUser, $lng, ilUtil\getImagePath(), and ilMailGlobalServices\getNumberOfNewMailsByUserId().

+ Here is the call 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.

71 {
72 $this->mode = (int)$a_value;
73 }

Referenced by ilMainMenuGUI(), and initMemberView().

+ Here is the caller graph for this function:

◆ setTemplate()

ilMainMenuGUI::setTemplate ( $tpl)

set output template

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

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

References $tpl.

◆ setTopBarBack()

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

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

81 {
82 $this->topbar_back_url = $a_url;
83 $this->topbar_back_caption = trim($a_caption);
84 }

Referenced by initMemberView().

+ 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 1130 of file class.ilMainMenuGUI.php.

1131 {
1132 $this->logo_only = (bool)$a_value;
1133 }

Field Documentation

◆ $ilias

ilMainMenuGUI::$ilias

◆ $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

◆ MODE_TOPBAR_MEMBERVIEW

const ilMainMenuGUI::MODE_TOPBAR_MEMBERVIEW = 4

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

Referenced by getSpacerClass().

◆ 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 getSpacerClass(), and ilTemplate\setLocator().


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