ILIAS  release_4-4 Revision
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)
 
 setSmallMode ($a_small)
 
 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
 

Protected Member Functions

 getMemberViewHTML ()
 
 getHeaderURL ()
 

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

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

785  {
786  global $rbacsystem;
787 
788  //if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
789  if($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID))
790  {
791  return true;
792  }
793  return false;
794  }
+ Here is the caller graph for this function:

◆ getHeaderURL()

ilMainMenuGUI::getHeaderURL ( )
protected

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

References ilUserUtil\getStartingPointAsUrl().

Referenced by getLanguageSelection().

1091  {
1092  include_once './Services/User/classes/class.ilUserUtil.php';
1094 
1095  if(!$url)
1096  {
1097  $url = "./goto.php?target=root_1";
1098  }
1099 
1100  return $url;
1101  }
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 796 of file class.ilMainMenuGUI.php.

References ilMemberViewSettings\getInstance(), and getMemberViewHTML().

797  {
798  // this is a workaround for bugs like 14016 or 16020
799  // the main menu does not need the YUI connection, but many other
800  // features since they rely on il.Util.sendAjaxGetRequestToUrl (see Services/Javascript)
801  // which still uses YUI. This should be migrated to jQuery with a future major release
802  include_once "Services/YUI/classes/class.ilYuiUtil.php";
803  ilYUIUtil::initConnection();
804 
805  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
807 
808  if($set->isActive())
809  {
810  return $this->getMemberViewHTML();
811  }
812 
813 
814  $this->setTemplateVars();
815 
816  return $this->tpl->get();
817  }
static getInstance()
Get instance.
+ Here is the call graph for this function:

◆ getLanguageSelection()

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

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

References $_SESSION, $ilias, $ilSetting, $ilUser, $lng, $tpl, ilObjSystemFolder\_getHeaderTitle(), ilSearchSettings\_getSearchSettingRefId(), ilRegistrationSettings\_lookupRegistrationType(), ilUtil\appendUrlParameterString(), ilTemplate\buildLoginTarget(), ilAdvancedSelectionListGUI\DOWN_ARROW_TOPBAR, getHeaderURL(), ilUtil\getImagePath(), getLoginTargetPar(), ilNotificationOSDHandler\getNotificationsForUser(), ilUtil\getStyleSheetLocation(), IL_COMP_SERVICE, IL_REG_DISABLED, iljQueryUtil\initjQuery(), ilPlayerUtil\initMediaElementJs(), renderHelpButtons(), renderMainMenuListEntries(), and renderStatusBox().

Referenced by ilTemplate\setTopBar().

102  {
103  global $lng;
104 
105  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
106  $selection = new ilAdvancedSelectionListGUI();
107  $selection->setFormSelectMode("change_lang_to", "ilLanguageSelection", true,
108  "#", "ilNavHistory", "ilNavHistoryForm",
109  "", $lng->txt("ok"), "ilLogin");
110  //$selection->setListTitle($lng->txt("choose_language"));
111  $selection->setListTitle($lng->txt("language"));
112  $selection->setItemLinkClass("small");
113 
114  if($a_in_topbar)
115  {
116  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_TOPBAR);
117  }
118 
119  $languages = $lng->getInstalledLanguages();
120  if(sizeof($languages) > 1) // #11237
121  {
122  foreach ($languages as $lang_key)
123  {
124  $base = substr($_SERVER["REQUEST_URI"], strrpos($_SERVER["REQUEST_URI"], "/") + 1);
125  $base = preg_replace("/&*lang=[a-z]{2}&*/", "", $base);
126  $link = ilUtil::appendUrlParameterString($base,
127  "lang=".$lang_key);
128  $link = str_replace("?&", "?", $link);
129  $selection->addItem($lng->_lookupEntry($lang_key, "meta", "meta_l_".$lang_key),
130  $lang_key, $link, "", "", "");
131  }
132  return $selection->getHTML();
133  }
134  }
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
User interface class for advanced drop-down selection lists.
global $lng
Definition: privfeed.php:40
+ 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 96 of file class.ilMainMenuGUI.php.

Referenced by getLanguageSelection().

97  {
98  return $this->login_target_par;
99  }
+ Here is the caller graph for this function:

◆ getMemberViewHTML()

ilMainMenuGUI::getMemberViewHTML ( )
protected

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

References $_GET, $lng, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilUtil\getImagePath().

Referenced by getHTML().

820  {
821  global $lng;
822 
823  $this->tpl = new ilTemplate('tpl.member_view_main_menu.html',true,true,'Services/MainMenu');
824 
825  $this->tpl->setVariable('TXT_MM_HEADER',$lng->txt('mem_view_long'));
826  $this->tpl->setVariable('TXT_MM_CLOSE_PREVIEW',$lng->txt('mem_view_close'));
827  $this->tpl->setVariable('MM_CLOSE_IMG',ilUtil::getImagePath('cancel.png'));
828 
829  include_once './Services/Link/classes/class.ilLink.php';
830 
831  $this->tpl->setVariable(
832  'HREF_CLOSE_MM',
834  (int) $_GET['ref_id'],
835  ilObject::_lookupType(ilObject::_lookupObjId((int) $_GET['ref_id'])),
836  array('mv' => 0)));
837 
838  return $this->tpl->get();
839  }
$_GET["client_id"]
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static _lookupType($a_id, $a_reference=false)
lookup object type
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScriptTarget()

ilMainMenuGUI::getScriptTarget (   $a_script)

generates complete script target (private)

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

References $ilias.

765  {
766  global $ilias;
767 
768  $script = "./".$a_script;
769 
770  //if ($this->start_template == true)
771  //{
772  //if(is_file("./templates/".$ilias->account->skin."/tpl.start.html"))
773  //{
774  // $script = "./start.php?script=".rawurlencode($script);
775  //}
776  //}
777  if (defined("ILIAS_MODULE"))
778  {
779  $script = ".".$script;
780  }
781  return $script;
782  }

◆ getTemplate()

ilMainMenuGUI::getTemplate ( )

get output template

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

79  {
80  echo "ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
81  return;
82  }

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

References $ilias, $ilUser, and ilMailGlobalServices\getMailObjectRefId().

32  {
33  global $ilias, $rbacsystem, $ilUser;
34 
35  $this->tpl = new ilTemplate("tpl.main_menu.html", true, true,
36  "Services/MainMenu");
37  $this->ilias =& $ilias;
38  $this->target = $a_target;
39  $this->start_template = $a_use_start_template;
40  $this->small = false;
41 
42  $this->mail = false;
43  if($ilUser->getId() != ANONYMOUS_USER_ID)
44  {
45  if($rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))
46  {
47  $this->mail = true;
48  }
49  }
50  }
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilUser
Definition: imgupload.php:15
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:

◆ renderDropDown()

ilMainMenuGUI::renderDropDown (   $a_tpl,
  $a_id 
)

GetDropDownHTML.

Parameters

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

References $ilSetting, $lng, ilObjUserTracking\_enabledLearningProgress(), ilCalendarSettings\_getInstance(), ilAdvancedSelectionListGUI\DOWN_ARROW_LIGHT, and ilMailGlobalServices\getMailObjectRefId().

Referenced by renderMainMenuListEntries().

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

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

Referenced by renderMainMenuListEntries().

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

◆ renderHelpButtons()

ilMainMenuGUI::renderHelpButtons ( )

Render help button.

Parameters

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

References $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, ilTooltipGUI\addTooltip(), and ilUtil\getImagePath().

Referenced by getLanguageSelection().

1007  {
1008  global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser;
1009 
1010  // screen id
1011  if (defined("OH_REF_ID") && OH_REF_ID > 0)
1012  {
1013  if ($ilHelp->getScreenId() != "")
1014  {
1015  $this->tpl->setCurrentBlock("screen_id");
1016  $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId());
1017  $this->tpl->parseCurrentBlock();
1018  }
1019  }
1020 
1021  $help_active = false;
1022 
1023  if ($ilHelp->hasSections())
1024  {
1025  $help_active = true;
1026 
1027  $lng->loadLanguageModule("help");
1028  $this->tpl->setCurrentBlock("help_icon");
1029 
1030  // add javascript needed by help (to do: move to help class)
1031  $tpl->addJavascript("./Services/Help/js/ilHelp.js");
1032  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
1033  $acc = new ilAccordionGUI();
1034  $acc->addJavascript();
1035  $acc->addCss();
1036 
1037  $this->tpl->setVariable("IMG_HELP", ilUtil::getImagePath("icon_help.png"));
1038  $this->tpl->parseCurrentBlock();
1039 
1040  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1041  ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "",
1042  "bottom center", "top center", false);
1043  }
1044 
1045  $module_id = (int) $ilSetting->get("help_module");
1046  if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
1047  $ilSetting->get("help_mode") != "1")
1048  {
1049  $help_active = true;
1050 
1051  $lng->loadLanguageModule("help");
1052  $tpl->addJavascript("./Services/Help/js/ilHelp.js");
1053  $this->tpl->setCurrentBlock("help_tt_icon");
1054  $this->tpl->setVariable("IMG_TT_ON", ilUtil::getImagePath("icon_tt.png"));
1055  $this->tpl->setVariable("IMG_TT_OFF", ilUtil::getImagePath("icon_tt_off.png"));
1056  $this->tpl->parseCurrentBlock();
1057 
1058  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
1059  ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "",
1060  "bottom center", "top center", false);
1061  }
1062 
1063  if($help_active)
1064  {
1065  // always set ajax url
1066  $ts = $ilCtrl->getTargetScript();
1067  $ilCtrl->setTargetScript("ilias.php");
1068 
1069  $ilHelp->setCtrlPar();
1070  $tpl->addOnLoadCode("il.Help.setAjaxUrl('".
1071  $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
1072  ."');");
1073  $ilCtrl->setTargetScript($ts);
1074  }
1075  }
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.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
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 367 of file class.ilMainMenuGUI.php.

References $_SESSION, $ilias, $ilSetting, $ilUser, $lng, _checkAdministrationPermission(), ilSearchSettings\_getSearchSettingRefId(), renderDropDown(), and renderEntry().

Referenced by getLanguageSelection().

368  {
369  global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
370 
371  // personal desktop
372  if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID)
373  {
374  /*$this->renderEntry($a_tpl, "desktop",
375  $lng->txt("personal_desktop"),
376  $this->getScriptTarget("ilias.php?baseClass=ilPersonalDesktopGUI"),
377  $this->target);*/
378 // $this->renderDropDown($a_tpl, "desktop");
379  $this->renderEntry($a_tpl, "desktop",
380  $lng->txt("personal_desktop"), "#");
381 
382  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
383  $ov = new ilOverlayGUI("mm_desk_ov");
384  $ov->setTrigger("mm_desk_tr");
385  $ov->setAnchor("mm_desk_tr");
386  $ov->setAutoHide(false);
387  $ov->add();
388 
389  }
390 
391  // repository
392  if($ilAccess->checkAccess('visible','',ROOT_FOLDER_ID))
393  {
394  include_once('./Services/Link/classes/class.ilLink.php');
395  $nd = $tree->getNodeData(ROOT_FOLDER_ID);
396  $title = $nd["title"];
397  if ($title == "ILIAS")
398  {
399  $title = $lng->txt("repository");
400  }
401  //$this->renderEntry($a_tpl, "repository",
402  // $title,
403  // ilLink::_getStaticLink(1,'root',true),
404  // $this->target);
405  if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID || IS_PAYMENT_ENABLED)
406  {
407  $this->renderEntry($a_tpl, "repository",
408  $title, "#");
409  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
410  $ov = new ilOverlayGUI("mm_rep_ov");
411  $ov->setTrigger("mm_rep_tr");
412  $ov->setAnchor("mm_rep_tr");
413  $ov->setAutoHide(false);
414  $ov->add();
415  }
416  }
417 
418  // search
419  include_once 'Services/Search/classes/class.ilSearchSettings.php';
420  if($rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
421  {
422 /* $this->renderEntry($a_tpl, "search",
423  $lng->txt("search"),
424  $this->getScriptTarget('ilias.php?baseClass=ilSearchController'),
425  $this->target); */
426  }
427 
428  // webshop
429  if(IS_PAYMENT_ENABLED)
430  {
431  $title = $lng->txt("shop");
432  $this->renderEntry($a_tpl, "shop", $title, "#" );
433  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
434  $ov = new ilOverlayGUI("mm_shop_ov");
435  $ov->setTrigger("mm_shop_tr");
436  $ov->setAnchor("mm_shop_tr");
437  $ov->setAutoHide(false);
438  $ov->add();
439  }
440 
441  // administration
443  {
444  //$this->renderEntry($a_tpl, "administration",
445  // $lng->txt("administration"),
446  // $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
447  // $this->target);
448  $this->renderDropDown($a_tpl, "administration");
449  }
450 
451 
452  // navigation history
453 /* require_once("Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
454  $nav_hist = new ilNavigationHistoryGUI();
455  $nav_html = $nav_hist->getHTML();
456  if ($nav_html != "")
457  {
458 
459  $a_tpl->setCurrentBlock("nav_history");
460  $a_tpl->setVariable("TXT_LAST_VISITED", $lng->txt("last_visited"));
461  $a_tpl->setVariable("NAVIGATION_HISTORY", $nav_html);
462  $a_tpl->parseCurrentBlock();
463  }*/
464 
465 
466  if ($a_call_get)
467  {
468  return $a_tpl->get();
469  }
470 
471  return "";
472  }
< 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']
renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target="_top")
Render main menu entry.
This is a utility class for the yui overlays.
global $ilUser
Definition: imgupload.php:15
renderDropDown($a_tpl, $a_id)
GetDropDownHTML.
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
_getSearchSettingRefId()
Read the ref_id of Search Settings object.
+ 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 329 of file class.ilMainMenuGUI.php.

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

Referenced by getLanguageSelection().

330  {
331  global $ilUser, $lng;
332 
333  $box = false;
334 
335  // new mails?
336  if($this->mail)
337  {
338  $new_mails = ilMailGlobalServices::getNumberOfNewMailsByUserId($ilUser->getId());
339  if($new_mails > 0)
340  {
341  $a_tpl->setCurrentBlock('status_text');
342  $a_tpl->setVariable('STATUS_TXT', $new_mails);
343  $a_tpl->parseCurrentBlock();
344  }
345  $a_tpl->setCurrentBlock('status_item');
346  $a_tpl->setVariable('STATUS_IMG', ilUtil::getImagePath('icon_mail_s.png'));
347  $a_tpl->setVariable('STATUS_IMG_ALT', $lng->txt("mail"));
348  $a_tpl->setVariable('STATUS_HREF', 'ilias.php?baseClass=ilMailGUI');
349  $a_tpl->parseCurrentBlock();
350  $box = true;
351  }
352 
353  if ($box)
354  {
355  $a_tpl->setCurrentBlock("status_box");
356  $a_tpl->parseCurrentBlock();
357  }
358  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
static getNumberOfNewMailsByUserId($usr_id)
Determines the number of new mails for the passed user id and stores this information in a local cach...
+ 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 60 of file class.ilMainMenuGUI.php.

61  {
62  $this->active = $a_active;
63  }

◆ setLoginTargetPar()

ilMainMenuGUI::setLoginTargetPar (   $a_val)

Set target parameter for login (public sector).

This is used by the main menu

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

89  {
90  $this->login_target_par = $a_val;
91  }

◆ setSmallMode()

ilMainMenuGUI::setSmallMode (   $a_small)

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

53  {
54  $this->small = $a_small;
55  }

◆ setTemplate()

ilMainMenuGUI::setTemplate ( $tpl)

set output template

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

References $tpl.

69  {
70  echo "ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
71  return;
72  $this->tpl =& $tpl;
73  }

◆ showLogoOnly()

ilMainMenuGUI::showLogoOnly (   $a_value)

Toggle rendering of main menu, search, user info.

See also
ilImprintGUI
Parameters
bool$a_value

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

1086  {
1087  $this->logo_only = (bool)$a_value;
1088  }

Field Documentation

◆ $ilias

ilMainMenuGUI::$ilias

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

◆ $tpl

ilMainMenuGUI::$tpl

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

Referenced by getLanguageSelection(), renderHelpButtons(), and setTemplate().


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