ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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...
 
 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 818 of file class.ilMainMenuGUI.php.

819 {
820 global $rbacsystem;
821
822 //if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
823 if($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID))
824 {
825 return true;
826 }
827 return false;
828 }

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

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

References ilUserUtil\getStartingPointAsUrl().

+ Here is the call graph for this function:

◆ getHTML()

ilMainMenuGUI::getHTML ( )

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

831 {
832 // this is a workaround for bugs like 14016
833 // the main menu does not need the YUI connection, but many other
834 // features since they rely on il.Util.sendAjaxGetRequestToUrl (see Services/Javascript)
835 // which still uses YUI. This should be migrated to jQuery with a future major release
836 include_once "Services/YUI/classes/class.ilYuiUtil.php";
837 ilYUIUtil::initConnection();
838
839 $this->setTemplateVars();
840
841 return $this->tpl->get();
842 }

◆ 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
global $ilUser
Definition: imgupload.php:15

References $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 798 of file class.ilMainMenuGUI.php.

799 {
800 global $ilias;
801
802 $script = "./".$a_script;
803
804 //if ($this->start_template == true)
805 //{
806 //if(is_file("./templates/".$ilias->account->skin."/tpl.start.html"))
807 //{
808 // $script = "./start.php?script=".rawurlencode($script);
809 //}
810 //}
811 if (defined("ILIAS_MODULE"))
812 {
813 $script = ".".$script;
814 }
815 return $script;
816 }

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

849 {
850 global $lng;
851
852 include_once './Services/Container/classes/class.ilMemberViewSettings.php';
853 $ref_id = ilMemberViewSettings::getInstance()->getCurrentRefId();
854
855 if(!$ref_id)
856 {
857 return FALSE;
858 }
859
860 include_once './Services/Link/classes/class.ilLink.php';
861 $url = ilLink::_getLink(
862 $ref_id,
864 array('mv' => 0));
865
866 $this->setMode(self::MODE_TOPBAR_MEMBERVIEW);
867 $this->setTopBarBack($url, $lng->txt('mem_view_close'));
868 }
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, 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:

◆ renderDropDown()

ilMainMenuGUI::renderDropDown (   $a_tpl,
  $a_id 
)

GetDropDownHTML.

Parameters

return

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

877 {
878 global $lng, $ilSetting, $rbacsystem;
879
880 $id = strtolower($a_id);
881 $id_up = strtoupper($a_id);
882 $a_tpl->setCurrentBlock("entry_".$id);
883 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
884 $selection = new ilAdvancedSelectionListGUI();
885 if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
886 {
887 $selection->setSelectionHeaderClass("MMActive");
888 $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
889 }
890 else
891 {
892 $selection->setSelectionHeaderClass("MMInactive");
893 }
894
895 $selection->setSelectionHeaderSpanClass("MMSpan");
896
897 $selection->setHeaderIcon(ilAdvancedSelectionListGUI::ICON_ARROW);
898 $selection->setItemLinkClass("small");
899 $selection->setUseImages(false);
900
901 switch ($id)
902 {
903 // desktop drop down
904 case "desktop":
905 $selection->setListTitle($lng->txt("personal_desktop"));
906 $selection->setId("dd_pd");
907
908 // overview
909 $selection->addItem($lng->txt("overview"), "", "ilias.php?baseClass=ilPersonalDesktopGUI",
910 "", "", "_top");
911
912 if(!$ilSetting->get("disable_personal_workspace"))
913 {
914 // workspace
915 $selection->addItem($lng->txt("personal_workspace"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace",
916 "", "", "_top");
917 }
918
919 // profile
920 $selection->addItem($lng->txt("personal_profile"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToProfile",
921 "", "", "_top");
922
923 // skills
924 $skmg_set = new ilSetting("skmg");
925 if ($skmg_set->get("enable_skmg"))
926 {
927 $selection->addItem($lng->txt("skills"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSkills",
928 "", "", "_top");
929 }
930
931 // portfolio
932 if ($ilSetting->get('user_portfolios'))
933 {
934 $selection->addItem($lng->txt("portfolio"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToPortfolio",
935 "", "", "_top");
936 }
937
938 // news
939 if ($ilSetting->get("block_activated_news"))
940 {
941 $selection->addItem($lng->txt("news"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNews",
942 "", "", "_top");
943 }
944
945 // Learning Progress
946 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
948 {
949 //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
950 $selection->addItem($lng->txt("learning_progress"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToLP",
951 "", "", "_top");
952 }
953
954 // calendar
955 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
957 if($settings->isEnabled())
958 {
959 $selection->addItem($lng->txt("calendar"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToCalendar",
960 "", "", "_top");
961 }
962
963 // mail
964 if($this->mail)
965 {
966 $selection->addItem($lng->txt('mail'), '', 'ilias.php?baseClass=ilMailGUI', '', '', '_top');
967 }
968
969 // contacts
970 if (!$this->ilias->getSetting('disable_contacts') &&
971 ($this->ilias->getSetting('disable_contacts_require_mail') ||
972 $rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId())))
973 {
974 $selection->addItem($lng->txt('mail_addressbook'), '', 'ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToContacts', '', '', '_top');
975 }
976
977 // private notes
978 if (!$this->ilias->getSetting("disable_notes"))
979 {
980 $selection->addItem($lng->txt("notes_and_comments"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNotes",
981 "", "", "_top");
982 }
983
984 // bookmarks
985 if (!$this->ilias->getSetting("disable_bookmarks"))
986 {
987 $selection->addItem($lng->txt("bookmarks"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToBookmarks",
988 "", "", "_top");
989 }
990
991 // settings
992 $selection->addItem($lng->txt("personal_settings"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSettings",
993 "", "", "_top");
994
995 break;
996
997 // shop
998 case 'shop':
999 $selection->setListTitle($lng->txt("shop"));
1000 $selection->setId("dd_shp");
1001 $selection->addItem($lng->txt("shop"), "", "ilias.php?baseClass=ilShopController&cmd=firstpage",
1002 "", "", "_top");
1003 break;
1004
1005 // administration
1006 case "administration":
1007 $selection->setListTitle($lng->txt("administration"));
1008 $selection->setId("dd_adm");
1009 $selection->setAsynch(true);
1010 $selection->setAsynchUrl("ilias.php?baseClass=ilAdministrationGUI&cmd=getDropDown&cmdMode=asynch");
1011 //$this->renderEntry($a_tpl, "administration",
1012 // $lng->txt("administration"),
1013 // $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
1014 // $this->target);
1015
1016 break;
1017
1018 }
1019
1020// $selection->setTriggerEvent("mouseover");
1021// $selection->setAutoHide(true);
1022
1023 // bs-patch start
1024 global $ilUser;
1025 $a_tpl->setVariable("TXT_ADMINISTRATION", $lng->txt("administration"));
1026 $a_tpl->parseCurrentBlock();
1027 return;
1028 // bs-patch end
1029
1030 $html = $selection->getHTML();
1031 $a_tpl->setVariable($id_up."_DROP_DOWN", $html);
1032 $a_tpl->parseCurrentBlock();
1033 }
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.
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, $ilUser, $lng, ilObjUserTracking\_enabledLearningProgress(), ilCalendarSettings\_getInstance(), ilMailGlobalServices\getMailObjectRefId(), 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 515 of file class.ilMainMenuGUI.php.

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

1043 {
1044 global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser;
1045
1046 // screen id
1047 if (defined("OH_REF_ID") && OH_REF_ID > 0)
1048 {
1049 if ($ilHelp->getScreenId() != "")
1050 {
1051 if($this->getMode() == self::MODE_FULL)
1052 {
1053 $this->tpl->setCurrentBlock("screen_id");
1054 $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId());
1055 $this->tpl->parseCurrentBlock();
1056 }
1057 }
1058 }
1059
1060 $help_active = false;
1061
1062 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
1063 $helpl = new ilGroupedListGUI();
1064 $helpl->setAsDropDown(true, true);
1065
1066 if ($ilHelp->hasSections())
1067 {
1068 $help_active = true;
1069
1070 $lng->loadLanguageModule("help");
1071 //$this->tpl->setCurrentBlock("help_icon");
1072
1073 // add javascript needed by help (to do: move to help class)
1074 $tpl->addJavascript("./Services/Help/js/ilHelp.js");
1075 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
1076 $acc = new ilAccordionGUI();
1077 $acc->addJavascript();
1078 $acc->addCss();
1079
1080 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1081 ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "",
1082 "bottom center", "top center", false);
1083 $helpl->addEntry("<span>&nbsp;</span> ".$lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);");
1084 }
1085
1086 $module_id = (int) $ilSetting->get("help_module");
1087 if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
1088 $ilSetting->get("help_mode") != "1")
1089 {
1090 $help_active = true;
1091
1092 $lng->loadLanguageModule("help");
1093 $tpl->addJavascript("./Services/Help/js/ilHelp.js");
1094
1095 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1096 ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "",
1097 "bottom center", "top center", false);
1098 $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> '.$lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);");
1099 }
1100
1101 if($help_active)
1102 {
1103 $this->tpl->setCurrentBlock("help");
1104 $this->tpl->setVariable("TXT_HELP", $lng->txt("help"));
1105 $this->tpl->setVariable("HELP_SELECT", $helpl->getHTML());
1106 $this->tpl->parseCurrentBlock();
1107
1108 // always set ajax url
1109 $ts = $ilCtrl->getTargetScript();
1110 $ilCtrl->setTargetScript("ilias.php");
1111
1112 $ilHelp->setCtrlPar();
1113 $tpl->addOnLoadCode("il.Help.setAjaxUrl('".
1114 $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
1115 ."');");
1116 $ilCtrl->setTargetScript($ts);
1117 }
1118 }
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 459 of file class.ilMainMenuGUI.php.

460 {
461 global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
462
463 // personal desktop
464 if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID)
465 {
466 $this->renderEntry($a_tpl, "desktop",
467 $lng->txt("personal_desktop"), "#");
468 }
469
470 // repository
471 if($ilAccess->checkAccess('visible','',ROOT_FOLDER_ID))
472 {
473 include_once('./Services/Link/classes/class.ilLink.php');
474 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
475 $title = $nd["title"];
476 if ($title == "ILIAS")
477 {
478 $title = $lng->txt("repository");
479 }
480 if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID || IS_PAYMENT_ENABLED)
481 {
482 $this->renderEntry($a_tpl, "repository",
483 $title, "#");
484 }
485 }
486
487
488 // webshop
489 if(IS_PAYMENT_ENABLED)
490 {
491 $title = $lng->txt("shop");
492 $this->renderEntry($a_tpl, "shop", $title, "#" );
493 }
494
495 // administration
497 {
498 $this->renderDropDown($a_tpl, "administration");
499 }
500
501 if ($a_call_get)
502 {
503 return $a_tpl->get();
504 }
505
506 return "";
507 }
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:9
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

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

422 {
423 global $ilUser, $lng;
424
425 $box = false;
426
427 // new mails?
428 if($this->mail)
429 {
431 if($new_mails > 0)
432 {
433 $a_tpl->setCurrentBlock('status_text');
434 $a_tpl->setVariable('STATUS_TXT', $new_mails);
435 $a_tpl->parseCurrentBlock();
436 }
437 $a_tpl->setCurrentBlock('status_item');
438 $a_tpl->setVariable('STATUS_IMG', ilUtil::getImagePath('icon_mail.svg'));
439 $a_tpl->setVariable('STATUS_IMG_ALT', $lng->txt("mail"));
440 $a_tpl->setVariable('STATUS_HREF', 'ilias.php?baseClass=ilMailGUI');
441 $a_tpl->parseCurrentBlock();
442 $box = true;
443 }
444
445 if ($box)
446 {
447 $a_tpl->setCurrentBlock("status_box");
448 $a_tpl->parseCurrentBlock();
449 }
450 }
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 1128 of file class.ilMainMenuGUI.php.

1129 {
1130 $this->logo_only = (bool)$a_value;
1131 }

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: