ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilMainMenuGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
6
14{
20 var $ilias;
21 var $tpl;
24 var $mail; // [bool]
25
26 protected $mode; // [int]
27 protected $topbar_back_url; // [stringt]
28 protected $topbar_back_caption; // [string]
29
30 const MODE_FULL = 1;
34
40 function __construct($a_target = "_top", $a_use_start_template = false)
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 }
69
70 public function setMode($a_value)
71 {
72 $this->mode = (int)$a_value;
73 }
74
75 public function getMode()
76 {
77 return $this->mode;
78 }
79
80 public function setTopBarBack($a_url, $a_caption = null)
81 {
82 $this->topbar_back_url = $a_url;
83 $this->topbar_back_caption = trim($a_caption);
84 }
85
86 public function getSpacerClass()
87 {
88 switch($this->getMode())
89 {
93 return "ilFixedTopSpacerBarOnly";
94
95 case self::MODE_FULL:
96 return "ilFixedTopSpacer";
97 }
98 }
99
103 function setActive($a_active)
104 {
105 $this->active = $a_active;
106 }
107
111 function setTemplate(&$tpl)
112 {
113 echo "ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
114 return;
115 $this->tpl = $tpl;
116 }
117
121 function getTemplate()
122 {
123 echo "ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
124 return;
125 }
126
131 public function setLoginTargetPar($a_val)
132 {
133 $this->login_target_par = $a_val;
134 }
135
139 public function getLoginTargetPar()
140 {
141 return $this->login_target_par;
142 }
143
144 static function getLanguageSelection($a_in_topbar = false)
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 }
169
174 {
175 global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin;
176
177 if($this->logo_only)
178 {
179 $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
180 $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
181
182 // #15759
183 include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
184 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
185 if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title"))
186 {
187 $this->tpl->setCurrentBlock("header_top_title");
188 $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
189 $this->tpl->parseCurrentBlock();
190 }
191
192 return;
193 }
194
195 // get user interface plugins
196 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
197
198 if($this->getMode() != self::MODE_TOPBAR_REDUCED &&
199 $this->getMode() != self::MODE_TOPBAR_MEMBERVIEW)
200 {
201 // search
202 include_once 'Services/Search/classes/class.ilSearchSettings.php';
203 if($rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
204 {
205 include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php';
206 $main_search = new ilMainMenuSearchGUI();
207 $html = "";
208
209 // user interface plugin slot + default rendering
210 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
211 $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search",
212 array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search));
213 if (!$uip->replaced())
214 {
215 $html = $main_search->getHTML();
216 }
217 $html = $uip->getHTML($html);
218
219 if (strlen($html))
220 {
221 $this->tpl->setVariable('SEARCHBOX',$html);
222 }
223 }
224
225 $this->renderStatusBox($this->tpl);
226
227 // online help
228 $this->renderHelpButtons();
229
230 $this->renderOnScreenChatMenu();
233 $this->renderAwareness();
234 }
235
236 if($this->getMode() == self::MODE_FULL)
237 {
238 $mmle_html = "";
239
240 // user interface plugin slot + default rendering
241 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
242 $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries",
243 array("main_menu_gui" => $this));
244 if (!$uip->replaced())
245 {
246 $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu");
247 $mmle_html = $this->renderMainMenuListEntries($mmle_tpl);
248 }
249 $mmle_html = $uip->getHTML($mmle_html);
250
251 $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html);
252 }
253
254 if($this->getMode() != self::MODE_TOPBAR_MEMBERVIEW)
255 {
256 $link_dir = (defined("ILIAS_MODULE"))
257 ? "../"
258 : "";
259
260 // login stuff
261 if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID)
262 {
263 include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
265 {
266 $this->tpl->setCurrentBlock("registration_link");
267 $this->tpl->setVariable("TXT_REGISTER",$lng->txt("register"));
268 $this->tpl->setVariable("LINK_REGISTER", $link_dir."register.php?client_id=".rawurlencode(CLIENT_ID)."&lang=".$ilias->account->getCurrentLanguage());
269 $this->tpl->parseCurrentBlock();
270 }
271
272 // language selection
273 $selection = self::getLanguageSelection();
274 if($selection)
275 {
276 // bs-patch start
277 global $ilUser, $lng;
278 $this->tpl->setVariable("TXT_LANGSELECT", $lng->txt("language"));
279 // bs-patch end
280 $this->tpl->setVariable("LANG_SELECT", $selection);
281 }
282
283 $this->tpl->setCurrentBlock("userisanonymous");
284 $this->tpl->setVariable("TXT_NOT_LOGGED_IN",$lng->txt("not_logged_in"));
285 $this->tpl->setVariable("TXT_LOGIN",$lng->txt("log_in"));
286
287 // #13058
288 $target_str = ($this->getLoginTargetPar() != "")
289 ? $this->getLoginTargetPar()
291 $this->tpl->setVariable("LINK_LOGIN",
292 $link_dir."login.php?target=".$target_str."&client_id=".rawurlencode(CLIENT_ID)."&cmd=force_login&lang=".$ilias->account->getCurrentLanguage());
293 $this->tpl->parseCurrentBlock();
294 }
295 else
296 {
297 $this->renderOnScreenNotifications($ilUser, $GLOBALS['tpl'], $lng);
298
299 $this->tpl->setCurrentBlock("userisloggedin");
300 $this->tpl->setVariable("TXT_LOGIN_AS",$lng->txt("login_as"));
301 $user_img_src = $ilias->account->getPersonalPicturePath("small", true);
302 $user_img_alt = $ilias->account->getFullname();
303 $this->tpl->setVariable("USER_IMG", ilUtil::img($user_img_src, $user_img_alt));
304 $this->tpl->setVariable("USR_LINK_PROFILE", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile");
305 $this->tpl->setVariable("USR_TXT_PROFILE", $lng->txt("personal_profile"));
306 $this->tpl->setVariable("USR_LINK_SETTINGS", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings");
307 $this->tpl->setVariable("USR_TXT_SETTINGS", $lng->txt("personal_settings"));
308 $this->tpl->setVariable("TXT_LOGOUT2",$lng->txt("logout"));
309 $this->tpl->setVariable("LINK_LOGOUT2", $link_dir."logout.php?lang=".$ilias->account->getCurrentLanguage());
310 $this->tpl->setVariable("USERNAME",$ilias->account->getFullname());
311 $this->tpl->setVariable("LOGIN",$ilias->account->getLogin());
312 $this->tpl->setVariable("MATRICULATION",$ilias->account->getMatriculation());
313 $this->tpl->setVariable("EMAIL",$ilias->account->getEmail());
314 $this->tpl->parseCurrentBlock();
315 }
316 }
317 else
318 {
319 // member view info
320 $this->tpl->setVariable("TOPBAR_CLASS", " ilMemberViewMainHeader");
321 $this->tpl->setVariable("MEMBER_VIEW_INFO", $lng->txt("mem_view_long"));
322 }
323
324 if(!$this->topbar_back_url)
325 {
326 include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
327 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
328 if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title"))
329 {
330 $this->tpl->setCurrentBlock("header_top_title");
331 // php7-workaround alex: added phpversion() to help during development of php7 compatibility
332 $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
333 $this->tpl->parseCurrentBlock();
334 }
335 }
336 else
337 {
338 $this->tpl->setCurrentBlock("header_back_bl");
339 $this->tpl->setVariable("URL_HEADER_BACK", $this->topbar_back_url);
340 $this->tpl->setVariable("TXT_HEADER_BACK", $this->topbar_back_caption
341 ? $this->topbar_back_caption
342 : $lng->txt("back"));
343 $this->tpl->parseCurrentBlock();
344 }
345
346 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
347
348 if($this->getMode() == self::MODE_FULL)
349 {
350 // $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
351 $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
352 $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
353 }
354
355 include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
356
357 $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
358
359 $this->tpl->parseCurrentBlock();
360 }
361
365 public function renderStatusBox($a_tpl)
366 {
367 global $ilUser, $DIC;
368 $ui_factory = $DIC->ui()->factory();
369 $ui_renderer = $DIC->ui()->renderer();
370
371 if ($this->mail) {
373
374 $a_tpl->setCurrentBlock('status_box');
375
376 $glyph = $ui_factory->glyph()->mail("ilias.php?baseClass=ilMailGUI");
377
378 if ($new_mails > 0) {
379 $glyph = $glyph->withCounter($ui_factory->counter()->novelty($new_mails));
380 }
381
382 $a_tpl->setVariable('GLYPH', $ui_renderer->render($glyph));
383 $a_tpl->parseCurrentBlock();
384 }
385 }
386
387
394 function renderMainMenuListEntries($a_tpl, $a_call_get = true)
395 {
396 global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
397
398 // personal desktop
399 if ($GLOBALS['DIC']['ilUser']->getId() != ANONYMOUS_USER_ID)
400 {
401 $this->renderEntry($a_tpl, "desktop",
402 $lng->txt("personal_desktop"), "#");
403 }
404
405 // repository
406 if($ilAccess->checkAccess('visible','',ROOT_FOLDER_ID))
407 {
408 include_once('./Services/Link/classes/class.ilLink.php');
409 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
410 $title = $nd["title"];
411 if ($title == "ILIAS")
412 {
413 $title = $lng->txt("repository");
414 }
415 if($GLOBALS['DIC']['ilUser']->getId() != ANONYMOUS_USER_ID)
416 {
417 $this->renderEntry($a_tpl, "repository",
418 $title, "#");
419 }
420 }
421
422
423 // administration
425 {
426 $this->renderDropDown($a_tpl, "administration");
427 }
428
429 if ($a_call_get)
430 {
431 return $a_tpl->get();
432 }
433
434 return "";
435 }
436
443 function renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target = "_top")
444 {
445 global $lng, $ilNavigationHistory, $ilSetting, $rbacsystem, $ilCtrl;
446
447 $id = strtolower($a_id);
448 $id_up = strtoupper($a_id);
449 $a_tpl->setCurrentBlock("entry_".$id);
450
451 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
452
453 // repository
454 if ($a_id == "repository")
455 {
456 $gl = new ilGroupedListGUI();
457 $gl->setAsDropDown(true);
458
459 include_once("./Services/Link/classes/class.ilLink.php");
461
462 $gl->addEntry($icon." ".$a_txt." - ".$lng->txt("rep_main_page"), ilLink::_getStaticLink(1,'root',true),
463 "_top");
464
465 $items = $ilNavigationHistory->getItems();
466 reset($items);
467 $cnt = 0;
468 $first = true;
469
470 foreach($items as $k => $item)
471 {
472 if ($cnt >= 10) break;
473
474 if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) ||
475 ($item["ref_id"] != $_GET["ref_id"] || !$first)) // do not list current item
476 {
477 if ($cnt == 0)
478 {
479 $gl->addGroupHeader($lng->txt("last_visited"), "ilLVNavEnt");
480 }
481 $obj_id = ilObject::_lookupObjId($item["ref_id"]);
482 $cnt ++;
483 $icon = ilUtil::img(ilObject::_getIcon($obj_id, "tiny"));
484 $ititle = ilUtil::shortenText(strip_tags($item["title"]), 50, true); // #11023
485 $gl->addEntry($icon." ".$ititle, $item["link"], "_top", "", "ilLVNavEnt");
486
487 }
488 $first = false;
489 }
490
491 if ($cnt > 0)
492 {
493 $gl->addEntry("» ".$lng->txt("remove_entries"), "#", "",
494 "return il.MainMenu.removeLastVisitedItems('".
495 $ilCtrl->getLinkTargetByClass("ilnavigationhistorygui", "removeEntries", "", true)."');",
496 "ilLVNavEnt");
497 }
498
499 $a_tpl->setVariable("REP_EN_OV", $gl->getHTML());
500 }
501
502 // desktop
503 if ($a_id == "desktop")
504 {
505 $gl = new ilGroupedListGUI();
506 $gl->setAsDropDown(true);
507
508 // overview
509 $gl->addEntry($lng->txt("overview"),
510 "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems",
511 "_top", "", "", "mm_pd_sel_items", ilHelp::getMainMenuTooltip("mm_pd_sel_items"),
512 "left center", "right center", false);
513
514 // my groups and courses, if both is available
515 if($ilSetting->get('disable_my_offers') == 0 &&
516 $ilSetting->get('disable_my_memberships') == 0)
517 {
518 $gl->addEntry($lng->txt("my_courses_groups"),
519 "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships",
520 "_top", "", "", "mm_pd_crs_grp", ilHelp::getMainMenuTooltip("mm_pd_crs_grp"),
521 "left center", "right center", false);
522 }
523
524 // bookmarks
525 if (!$this->ilias->getSetting("disable_bookmarks"))
526 {
527 $gl->addEntry($lng->txt("bookmarks"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks",
528 "_top", "", "", "mm_pd_bookm", ilHelp::getMainMenuTooltip("mm_pd_bookm"),
529 "left center", "right center", false);
530 }
531
532 // private notes
533 if (!$this->ilias->getSetting("disable_notes") || !$ilSetting->get("disable_comments"))
534 {
535 $lng->loadLanguageModule("notes");
536 $t = $lng->txt("notes");
537 $c = "jumpToNotes";
538 if (!$this->ilias->getSetting("disable_notes") && !$ilSetting->get("disable_comments"))
539 {
540 $t = $lng->txt("notes_and_comments");
541 }
542 if ($this->ilias->getSetting("disable_notes"))
543 {
544 $t = $lng->txt("notes_comments");
545 $c = "jumpToComments";
546 }
547 $gl->addEntry($t, "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=".$c,
548 "_top", "", "", "mm_pd_notes", ilHelp::getMainMenuTooltip("mm_pd_notes"),
549 "left center", "right center", false);
550 }
551
552 // news
553 if ($ilSetting->get("block_activated_news"))
554 {
555 $gl->addEntry($lng->txt("news"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews",
556 "_top", "", "", "mm_pd_news", ilHelp::getMainMenuTooltip("mm_pd_news"),
557 "left center", "right center", false);
558 }
559
560 // overview is always active
561 $gl->addSeparator();
562
563 $separator = false;
564
565 if(!$ilSetting->get("disable_personal_workspace"))
566 {
567 // workspace
568 $gl->addEntry($lng->txt("personal_workspace"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace",
569 "_top", "", "", "mm_pd_wsp", ilHelp::getMainMenuTooltip("mm_pd_wsp"),
570 "left center", "right center", false);
571
572 $separator = true;
573 }
574
575 // portfolio
576 if ($ilSetting->get('user_portfolios'))
577 {
578 $gl->addEntry($lng->txt("portfolio"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio",
579 "_top", "", "", "mm_pd_port", ilHelp::getMainMenuTooltip("mm_pd_port"),
580 "left center", "right center", false);
581
582 $separator = true;
583 }
584
585 // skills
586 $skmg_set = new ilSetting("skmg");
587 if ($skmg_set->get("enable_skmg"))
588 {
589 $gl->addEntry($lng->txt("skills"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills",
590 "_top", "", "", "mm_pd_skill", ilHelp::getMainMenuTooltip("mm_pd_skill"),
591 "left center", "right center", false);
592
593 $separator = true;
594 }
595
596 // Learning Progress
597 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
601 {
602 //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
603 $gl->addEntry($lng->txt("learning_progress"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToLP",
604 "_top", "", "", "mm_pd_lp", ilHelp::getMainMenuTooltip("mm_pd_lp"),
605 "left center", "right center", false);
606
607 $separator = true;
608 }
609
610 if($separator)
611 {
612 $gl->addSeparator();
613 }
614
615 $separator = false;
616
617 // calendar
618 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
620 if($settings->isEnabled())
621 {
622 $gl->addEntry($lng->txt("calendar"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar",
623 "_top", "", "", "mm_pd_cal", ilHelp::getMainMenuTooltip("mm_pd_cal"),
624 "left center", "right center", false);
625
626 $separator = true;
627 }
628
629 // mail
630 if($this->mail)
631 {
632 $gl->addEntry($lng->txt('mail'), 'ilias.php?baseClass=ilMailGUI', '_top',
633 "", "", "mm_pd_mail", ilHelp::getMainMenuTooltip("mm_pd_mail"),
634 "left center", "right center", false);
635
636 $separator = true;
637 }
638
639 // contacts
640 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
641 if(ilBuddySystem::getInstance()->isEnabled())
642 {
643 $gl->addEntry($lng->txt('mail_addressbook'),
644 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts', '_top'
645 , "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_contacts"),
646 "left center", "right center", false);
647
648 $separator = true;
649 }
650
651 if($separator)
652 {
653 $gl->addSeparator();
654 }
655
656 require_once 'Services/Badge/classes/class.ilBadgeHandler.php';
657 if(ilBadgeHandler::getInstance()->isActive())
658 {
659 $gl->addEntry($lng->txt('obj_bdga'),
660 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBadges', '_top'
661 , "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_badges"),
662 "left center", "right center", false);
663
664 $gl->addSeparator();
665 }
666
667 // profile
668 $gl->addEntry($lng->txt("personal_profile"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile",
669 "_top", "", "", "mm_pd_profile", ilHelp::getMainMenuTooltip("mm_pd_profile"),
670 "left center", "right center", false);
671
672 // settings
673 $gl->addEntry($lng->txt("personal_settings"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings",
674 "_top", "", "", "mm_pd_sett", ilHelp::getMainMenuTooltip("mm_pd_sett"),
675 "left center", "right center", false);
676
677 $a_tpl->setVariable("DESK_CONT_OV", $gl->getHTML());
678 }
679
680 $a_tpl->setVariable("TXT_".$id_up, $a_txt);
681 $a_tpl->setVariable("SCRIPT_".$id_up, $a_script);
682 $a_tpl->setVariable("TARGET_".$id_up, $a_target);
683 if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
684 {
685 //$a_tpl->setVariable("MM_CLASS", "MMActive");
686 $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
687 }
688 else
689 {
690 //$a_tpl->setVariable("MM_CLASS", "MMInactive");
691 }
692
693 if($a_id == "repository")
694 {
695 include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
697 {
698 $a_tpl->setVariable("ACC_KEY_REPOSITORY", 'accesskey="'.
700 }
701 }
702 if($a_id == "desktop")
703 {
704 include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
706 {
707 $a_tpl->setVariable("ACC_KEY_DESKTOP", 'accesskey="'.
709 }
710 }
711
712
713 $a_tpl->parseCurrentBlock();
714 }
715
716
720 function getScriptTarget($a_script)
721 {
722 $script = "./".$a_script;
723 if (defined("ILIAS_MODULE"))
724 {
725 $script = ".".$script;
726 }
727 return $script;
728 }
729
731 {
732 global $rbacsystem;
733
734 //if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
735 if($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID))
736 {
737 return true;
738 }
739 return false;
740 }
741
742 function getHTML()
743 {
744 // this is a workaround for bugs like 14016
745 // the main menu does not need the YUI connection, but many other
746 // features since they rely on il.Util.sendAjaxGetRequestToUrl (see Services/Javascript)
747 // which still uses YUI. This should be migrated to jQuery with a future major release
748 include_once "Services/YUI/classes/class.ilYuiUtil.php";
749 ilYUIUtil::initConnection();
750
751 $this->setTemplateVars();
752
753 return $this->tpl->get();
754 }
755
760 protected function initMemberView()
761 {
762 global $lng;
763
764 include_once './Services/Container/classes/class.ilMemberViewSettings.php';
765 $ref_id = ilMemberViewSettings::getInstance()->getCurrentRefId();
766
767 if(!$ref_id)
768 {
769 return FALSE;
770 }
771
772 include_once './Services/Link/classes/class.ilLink.php';
774 $ref_id,
776 array('mv' => 0));
777
778 $this->setMode(self::MODE_TOPBAR_MEMBERVIEW);
779 $this->setTopBarBack($url, $lng->txt('mem_view_close'));
780 }
781
788 function renderDropDown($a_tpl, $a_id)
789 {
790 global $lng, $ilSetting, $rbacsystem;
791
792 $id = strtolower($a_id);
793 $id_up = strtoupper($a_id);
794 $a_tpl->setCurrentBlock("entry_".$id);
795 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
796 $selection = new ilAdvancedSelectionListGUI();
797 if ($this->active == $a_id || ($this->active == "" && $a_id == "repository"))
798 {
799 $selection->setSelectionHeaderClass("MMActive");
800 $a_tpl->setVariable("SEL", '<span class="ilAccHidden">('.$lng->txt("stat_selected").')</span>');
801 }
802 else
803 {
804 $selection->setSelectionHeaderClass("MMInactive");
805 }
806
807 $selection->setSelectionHeaderSpanClass("MMSpan");
808
809 $selection->setHeaderIcon(ilAdvancedSelectionListGUI::ICON_ARROW);
810 $selection->setItemLinkClass("small");
811 $selection->setUseImages(false);
812
813 switch ($id)
814 {
815 // desktop drop down
816 case "desktop":
817 $selection->setListTitle($lng->txt("personal_desktop"));
818 $selection->setId("dd_pd");
819
820 // overview
821 $selection->addItem($lng->txt("overview"), "", "ilias.php?baseClass=ilPersonalDesktopGUI",
822 "", "", "_top");
823
824 if(!$ilSetting->get("disable_personal_workspace"))
825 {
826 // workspace
827 $selection->addItem($lng->txt("personal_workspace"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace",
828 "", "", "_top");
829 }
830
831 // profile
832 $selection->addItem($lng->txt("personal_profile"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToProfile",
833 "", "", "_top");
834
835 // skills
836 $skmg_set = new ilSetting("skmg");
837 if ($skmg_set->get("enable_skmg"))
838 {
839 $selection->addItem($lng->txt("skills"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSkills",
840 "", "", "_top");
841 }
842
843 // portfolio
844 if ($ilSetting->get('user_portfolios'))
845 {
846 $selection->addItem($lng->txt("portfolio"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToPortfolio",
847 "", "", "_top");
848 }
849
850 // news
851 if ($ilSetting->get("block_activated_news"))
852 {
853 $selection->addItem($lng->txt("news"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNews",
854 "", "", "_top");
855 }
856
857 // Learning Progress
858 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
860 {
861 //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
862 $selection->addItem($lng->txt("learning_progress"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToLP",
863 "", "", "_top");
864 }
865
866 // calendar
867 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
869 if($settings->isEnabled())
870 {
871 $selection->addItem($lng->txt("calendar"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToCalendar",
872 "", "", "_top");
873 }
874
875 // mail
876 if($this->mail)
877 {
878 $selection->addItem($lng->txt('mail'), '', 'ilias.php?baseClass=ilMailGUI', '', '', '_top');
879 }
880
881 // contacts
882 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
883 if(ilBuddySystem::getInstance()->isEnabled())
884 {
885 $selection->addItem($lng->txt('mail_addressbook'), '', 'ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToContacts', '', '', '_top');
886 }
887
888 // private notes
889 if (!$this->ilias->getSetting("disable_notes"))
890 {
891 $selection->addItem($lng->txt("notes_and_comments"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNotes",
892 "", "", "_top");
893 }
894
895 // bookmarks
896 if (!$this->ilias->getSetting("disable_bookmarks"))
897 {
898 $selection->addItem($lng->txt("bookmarks"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToBookmarks",
899 "", "", "_top");
900 }
901
902 // settings
903 $selection->addItem($lng->txt("personal_settings"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSettings",
904 "", "", "_top");
905
906 break;
907
908 // administration
909 case "administration":
910 $selection->setListTitle($lng->txt("administration"));
911 $selection->setId("dd_adm");
912 $selection->setAsynch(true);
913 $selection->setAsynchUrl("ilias.php?baseClass=ilAdministrationGUI&cmd=getDropDown&cmdMode=asynch");
914 //$this->renderEntry($a_tpl, "administration",
915 // $lng->txt("administration"),
916 // $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
917 // $this->target);
918
919 break;
920
921 }
922
923// $selection->setTriggerEvent("mouseover");
924// $selection->setAutoHide(true);
925
926 // bs-patch start
927 global $ilUser;
928 $a_tpl->setVariable("TXT_ADMINISTRATION", $lng->txt("administration"));
929 $a_tpl->parseCurrentBlock();
930 return;
931 // bs-patch end
932
933 $html = $selection->getHTML();
934 $a_tpl->setVariable($id_up."_DROP_DOWN", $html);
935 $a_tpl->parseCurrentBlock();
936 }
937
938
946 {
947 global $ilHelp, $lng, $ilCtrl, $tpl, $ilSetting, $ilUser;
948
949 // screen id
950 if ((defined("OH_REF_ID") && OH_REF_ID > 0) || DEVMODE == 1)
951 {
952 if ($ilHelp->getScreenId() != "")
953 {
954 if($this->getMode() == self::MODE_FULL)
955 {
956 $this->tpl->setCurrentBlock("screen_id");
957 $this->tpl->setVariable("SCREEN_ID", $ilHelp->getScreenId());
958 $this->tpl->parseCurrentBlock();
959 }
960 }
961 }
962
963 $help_active = false;
964
965 include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
966 $helpl = new ilGroupedListGUI();
967 $helpl->setAsDropDown(true, true);
968
969 if ($ilHelp->hasSections())
970 {
971 $help_active = true;
972
973 $lng->loadLanguageModule("help");
974 //$this->tpl->setCurrentBlock("help_icon");
975
976 // add javascript needed by help (to do: move to help class)
977 $tpl->addJavascript("./Services/Help/js/ilHelp.js");
978 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
979 $acc = new ilAccordionGUI();
980 $acc->addJavascript();
981 $acc->addCss();
982
983 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
984 ilTooltipGUI::addTooltip("help_tr", $lng->txt("help_open_online_help"), "",
985 "bottom center", "top center", false);
986 $helpl->addEntry("<span>&nbsp;</span> ".$lng->txt("help_topcis"), "#", "", "il.Help.listHelp(event, false);");
987 }
988
989 $module_id = (int) $ilSetting->get("help_module");
990 if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
991 $ilSetting->get("help_mode") != "1")
992 {
993 $help_active = true;
994
995 $lng->loadLanguageModule("help");
996 $tpl->addJavascript("./Services/Help/js/ilHelp.js");
997
998 include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
999 ilTooltipGUI::addTooltip("help_tt", $lng->txt("help_toggle_tooltips"), "",
1000 "bottom center", "top center", false);
1001 $helpl->addEntry('<span id="help_tt_switch_on" class="glyphicon glyphicon-ok"></span> '.$lng->txt("help_tooltips"), "#", "", "return il.Help.switchTooltips(event);");
1002 }
1003
1004 if($help_active)
1005 {
1006 $this->tpl->setCurrentBlock("help");
1007 $this->tpl->setVariable("TXT_HELP", $lng->txt("help"));
1008 $this->tpl->setVariable("HELP_SELECT", $helpl->getHTML());
1009 $this->tpl->parseCurrentBlock();
1010
1011 // always set ajax url
1012 $ts = $ilCtrl->getTargetScript();
1013 $ilCtrl->setTargetScript("ilias.php");
1014
1015 $ilHelp->setCtrlPar();
1016 $tpl->addOnLoadCode("il.Help.setAjaxUrl('".
1017 $ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
1018 ."');");
1019 $ilCtrl->setTargetScript($ts);
1020 }
1021 }
1022
1026 protected function populateWithBuddySystem()
1027 {
1028 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
1029 if(ilBuddySystem::getInstance()->isEnabled())
1030 {
1031 require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystemGUI.php';
1033 }
1034 }
1035
1036 protected function populateWithOnScreenChat()
1037 {
1038 require_once 'Services/OnScreenChat/classes/class.ilOnScreenChat.php';
1039 require_once 'Services/OnScreenChat/classes/class.ilOnScreenChatGUI.php';
1040
1042 }
1043
1044 protected function renderOnScreenChatMenu()
1045 {
1046 require_once 'Services/OnScreenChat/classes/class.ilOnScreenChatMenuGUI.php';
1047
1048 $menu = new ilOnScreenChatMenuGUI();
1049 $this->tpl->setVariable('ONSCREENCHAT', $menu->getMainMenuHTML());
1050 }
1051
1056 {
1057 include_once("./Services/Awareness/classes/class.ilAwarenessGUI.php");
1059
1060 $this->tpl->setVariable("AWARENESS", $aw->getMainMenuHTML());
1061 }
1062
1068 protected function renderOnScreenNotifications(\ilObjUser $user, \ilTemplate $mainTpl, \ilLanguage $lng)
1069 {
1070 if ($this->getMode() != self::MODE_TOPBAR_REDUCED && !$user->isAnonymous()) {
1071 $this->tpl->touchBlock('osd_container');
1072
1073 require_once 'Services/Notifications/classes/class.ilNotificationOSDGUI.php';
1074 $osdGui = new ilNotificationOSDGUI($user, $mainTpl, $lng);
1075 $osdGui->render();
1076 }
1077 }
1078
1079
1087 function showLogoOnly($a_value)
1088 {
1089 $this->logo_only = (bool)$a_value;
1090 }
1091
1092 protected function getHeaderURL()
1093 {
1094 include_once './Services/User/classes/class.ilUserUtil.php';
1096
1097 if(!$url)
1098 {
1099 $url = "./goto.php?target=root_1";
1100 }
1101
1102 return $url;
1103 }
1104}
1105
1106?>
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_SERVICE
static getKey($a_func_id, $lang_key="0", $a_ignore_default=false)
Get single access key.
Accordion user interface class.
User interface class for advanced drop-down selection lists.
static getInstance()
Get instance.
static getInstance()
Constructor.
static _getInstance()
get singleton instance
Grouped list GUI class.
static getMainMenuTooltip($a_item_id)
Get main menu tooltip.
language handling
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static getNumberOfNewMailsByUserId($usr_id)
Determines the number of new mails for the passed user id and stores this information in a local cach...
Handles display of the main menu.
populateWithBuddySystem()
Includes all buddy system/user connections related javascript code.
setTopBarBack($a_url, $a_caption=null)
renderOnScreenNotifications(\ilObjUser $user, \ilTemplate $mainTpl, \ilLanguage $lng)
setTemplate(&$tpl)
set output template
setTemplateVars()
set all template variables (images, scripts, target frames, ...)
getTemplate()
get output template
renderDropDown($a_tpl, $a_id)
GetDropDownHTML.
getLoginTargetPar()
Get target parameter for login.
__construct($a_target="_top", $a_use_start_template=false)
renderMainMenuListEntries($a_tpl, $a_call_get=true)
desc
showLogoOnly($a_value)
Toggle rendering of main menu, search, user info.
renderAwareness()
Render awareness tool.
static getLanguageSelection($a_in_topbar=false)
renderStatusBox($a_tpl)
Render status box.
renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target="_top")
Render main menu entry.
static _checkAdministrationPermission()
renderHelpButtons()
Render help button.
getScriptTarget($a_script)
generates complete script target (private)
initMemberView()
Init member view @global type $lng.
setLoginTargetPar($a_val)
Set target parameter for login (public sector).
Add a search box to main menu.
static getInstance()
Get instance.
Class ilNotificationOSDGUI.
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _lookupObjId($a_id)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _lookupType($a_id, $a_reference=false)
lookup object type
static initializeFrontend()
Initialize frontend and delivers required javascript files and configuration to the global template.
Class ilOnScreenChatMenuGUI.
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
ILIAS Setting Class.
special template class to simplify handling of ITX/PEAR
static buildLoginTarget()
Add current object (repository/workspace) as target for login url.
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.
UI interface hook processor.
static getStartingPointAsUrl()
Get current starting point setting as URL.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$languages
Definition: cssgen2.php:34
$nd
Definition: error.php:11
$html
Definition: example_001.php:87
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
redirection script todo: (a better solution should control the processing via a xml file)
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
global $lng
Definition: privfeed.php:17
global $ilSetting
Definition: privfeed.php:17
$ref_id
Definition: sahs_server.php:39
$url
Definition: shib_logout.php:72
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $DIC
$ilUser
Definition: imgupload.php:18