29         function ilMainMenuGUI($a_target = 
"_top", $a_use_start_template = 
false)
 
   34                 $this->tpl = 
new ilTemplate(
"tpl.main_menu.html", 
true, 
true,
 
   37                 $this->target = $a_target;
 
   38                 $this->start_template = $a_use_start_template;
 
   44                 $this->small = $a_small;
 
   52                 $this->active = $a_active;
 
   60                 echo 
"ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
 
   70                 echo 
"ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
 
   80                 $this->login_target_par = $a_val;
 
   88                 return $this->login_target_par;
 
  100                 include_once 
'Services/Search/classes/class.ilSearchSettings.php';
 
  103                         include_once 
'./Services/Search/classes/class.ilMainMenuSearchGUI.php';
 
  105                         if(strlen($html = $main_search->getHTML()))
 
  107                                 $this->tpl->setVariable(
'SEARCHBOX',$html);
 
  112                 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE, 
"UIComponent", 
"uihk");
 
  113                 $plugin_html = 
false;
 
  114                 foreach ($pl_names as $pl)
 
  117                         $gui_class = $ui_plugin->getUIClassInstance();
 
  118                         $resp = $gui_class->getHTML(
"Services/MainMenu", 
"main_menu_list_entries",
 
  119                                 array(
"main_menu_gui" => $this));
 
  130                         $mmle_tpl = 
new ilTemplate(
"tpl.main_menu_list_entries.html", 
true, 
true, 
"Services/MainMenu");
 
  137                         $mmle_html = $gui_class->modifyHTML($mmle_html, $resp);
 
  140                 $this->tpl->setVariable(
"MAIN_MENU_LIST_ENTRIES", $mmle_html);
 
  142                 $link_dir = (defined(
"ILIAS_MODULE"))
 
  150                         if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
 
  152                                 include_once 
'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
 
  155                                         $this->tpl->setCurrentBlock(
"registration_link");
 
  156                                         $this->tpl->setVariable(
"TXT_REGISTER",$lng->txt(
"register"));
 
  157                                         $this->tpl->setVariable(
"LINK_REGISTER", $link_dir.
"register.php?client_id=".rawurlencode(CLIENT_ID).
"&lang=".$ilias->account->getCurrentLanguage());
 
  158                                         $this->tpl->parseCurrentBlock();
 
  162                                 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
  164                                 $selection->setFormSelectMode(
"change_lang_to", 
"ilLanguageSelection", 
true,
 
  165                                         "#", 
"ilNavHistory", 
"ilNavHistoryForm",
 
  166                                         "_top", $lng->txt(
"ok"), 
"ilLogin");
 
  168                                 $selection->setListTitle($lng->txt(
"language"));
 
  169                                 $selection->setItemLinkClass(
"small");
 
  170                                 $languages = $lng->getInstalledLanguages();
 
  172                                 foreach ($languages as $lang_key)
 
  174                                         $base = substr($_SERVER[
"REQUEST_URI"], strrpos($_SERVER[
"REQUEST_URI"], 
"/") + 1);
 
  175                                         $base = str_replace(
"lang=", 
"", $base);
 
  179                                                 $lang_key, $link, 
"", 
"", 
"_top");
 
  181                                 if (count($languages) > 0)
 
  183                                         $this->tpl->setVariable(
"LANG_SELECT", $selection->getHTML());
 
  186                                 $this->tpl->setCurrentBlock(
"userisanonymous");
 
  187                                 $this->tpl->setVariable(
"TXT_NOT_LOGGED_IN",$lng->txt(
"not_logged_in"));
 
  188                                 $this->tpl->setVariable(
"TXT_LOGIN",$lng->txt(
"log_in"));
 
  195                                 else if (
$_GET[
"ref_id"] != 
"")
 
  197                                         if ($tree->isInTree(
$_GET[
"ref_id"]) && 
$_GET[
"ref_id"] != $tree->getRootId())
 
  201                                                 $target_str = $type.
"_".
$_GET[
"ref_id"];
 
  204                                 $this->tpl->setVariable(
"LINK_LOGIN",
 
  205                                         $link_dir.
"login.php?target=".$target_str.
"&client_id=".rawurlencode(CLIENT_ID).
"&cmd=force_login&lang=".$ilias->account->getCurrentLanguage());
 
  206                                 $this->tpl->parseCurrentBlock();
 
  210                                 $this->tpl->setCurrentBlock(
"userisloggedin");
 
  211                                 $this->tpl->setVariable(
"TXT_LOGIN_AS",$lng->txt(
"login_as"));
 
  212                                 $this->tpl->setVariable(
"TXT_LOGOUT2",$lng->txt(
"logout"));
 
  213                                 $this->tpl->setVariable(
"LINK_LOGOUT2", $link_dir.
"logout.php?lang=".$ilias->account->getCurrentLanguage());
 
  214                                 $this->tpl->setVariable(
"USERNAME",$ilias->account->getFullname());
 
  215                                 $this->tpl->parseCurrentBlock();
 
  221                         $this->tpl->setVariable(
"TXT_LOGOUT", $lng->txt(
"logout"));
 
  224                         include_once(
"./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
 
  235                 $this->tpl->setVariable(
"TXT_MAIN_MENU", $lng->txt(
"main_menu"));
 
  237                 $this->tpl->parseCurrentBlock();
 
  251                 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
 
  254                                 $lng->txt(
"personal_desktop"),
 
  260                 include_once(
'classes/class.ilLink.php');
 
  261                 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
 
  265                         $title = $lng->txt(
"repository");
 
  273                 include_once 
'Services/Search/classes/class.ilSearchSettings.php';
 
  283                 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
 
  285                         include_once 
"Services/Mail/classes/class.ilMail.php";
 
  288                         if($rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId()))
 
  295                                         $add = 
" ".sprintf($lng->txt(
"cnt_new"), $new_mails);
 
  299                                         $lng->txt(
"mail").$add,
 
  307                 if(IS_PAYMENT_ENABLED)
 
  309                         $a_tpl->setCurrentBlock(
'shopbutton');
 
  310                         $a_tpl->setVariable(
'SCRIPT_SHOP', $this->
getScriptTarget(
'ilias.php?baseClass=ilShopController&cmd=clearFilter'));
 
  311                         $a_tpl->setVariable(
'TARGET_SHOP', $this->target);
 
  313                         include_once 
'Services/Payment/classes/class.ilPaymentShoppingCart.php';
 
  315                         $items = $objShoppingCart->getEntries();
 
  317                         $a_tpl->setVariable(
'TXT_SHOP', $lng->txt(
'shop'));
 
  320                         if(count($items) > 0 )
 
  323                                 $a_tpl->setVariable(
'SCRIPT_SHOPPINGCART', $this->
getScriptTarget(
'ilias.php?baseClass=ilShopController&cmd=redirect&redirect_class=ilshopshoppingcartgui'));
 
  324                                 $a_tpl->setVariable(
'TARGET_SHOPPINGCART', $this->target);
 
  325                                 $a_tpl->setVariable(
'TXT_SHOPPINGCART', 
'('.count($items).
')');
 
  326                                 if($this->active == 
'shop')
 
  328                                         $a_tpl->setVariable(
'MM_CLASS_SHOPPINGCART', 
'MMActive');
 
  332                                         $a_tpl->setVariable(
'MM_CLASS_SHOPPINGCART', 
'MMInactive');
 
  336                         if($this->active == 
'shop')
 
  338                                 $a_tpl->setVariable(
'MM_CLASS', 
'MMActive');
 
  339                                 $a_tpl->setVariable(
"SEL", 
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
 
  340                                 if(count($items) > 0 )
 
  342                                         $a_tpl->setVariable(
'STYLE_SHOP', 
'style="margin-right: 5px;"');
 
  347                                 $a_tpl->setVariable(
'MM_CLASS', 
'MMInactive');
 
  348                                 if(count($items) > 0 )
 
  350                                         $a_tpl->setVariable(
'STYLE_SHOP', 
'style="margin-right: 5px;"');
 
  353                         $a_tpl->parseCurrentBlock();
 
  361                                 $lng->txt(
"administration"),
 
  368                 require_once(
"Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
 
  374                         $a_tpl->setCurrentBlock(
"nav_history");
 
  375                         $a_tpl->setVariable(
"TXT_LAST_VISITED", $lng->txt(
"last_visited"));
 
  376                         $a_tpl->setVariable(
"NAVIGATION_HISTORY", $nav_html);
 
  377                         $a_tpl->parseCurrentBlock();
 
  382                 if ($ilSetting->get(
'chat_message_notify_status') == 1 && 
$_REQUEST[
'baseClass'] != 
'ilChatPresentationGUI' && $ilUser->getPref(
'chat_message_notify_status') == 1) {
 
  383                         include_once 
'Modules/Chat/classes/class.ilChatMessageNotifyGUI.php';
 
  385                         $html = $msg_notify->getHtml();
 
  387                                 $a_tpl->setCurrentBlock(
"chat_lastmsg");
 
  388                                 $a_tpl->setVariable(
'CHAT_LAST_MESSAGE', $html);
 
  389                                 $a_tpl->parseCurrentBlock();
 
  395                 include_once 
'Modules/Chat/classes/class.ilChatInvitationGUI.php';
 
  397                 $chat_invitation_html = $chat_invitation_gui->getHTML();
 
  398                 if(trim($chat_invitation_html) != 
'')
 
  400                         $a_tpl->setCurrentBlock(
'chatbutton');
 
  401                         $a_tpl->setVariable(
'CHAT_INVITATIONS', $chat_invitation_html);
 
  402                         $a_tpl->parseCurrentBlock();
 
  407                         return $a_tpl->get();
 
  419         function renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target = 
"_top")
 
  423                 $id = strtolower($a_id);
 
  424                 $id_up = strtoupper($a_id);
 
  425                 $a_tpl->setCurrentBlock(
"entry_".$id);
 
  426                 $a_tpl->setVariable(
"TXT_".$id_up, $a_txt);
 
  427                 $a_tpl->setVariable(
"SCRIPT_".$id_up, $a_script);
 
  428                 $a_tpl->setVariable(
"TARGET_".$id_up, $a_target);
 
  429                 if ($this->active == $a_id || ($this->active == 
"" && $a_id == 
"repository"))
 
  431                         $a_tpl->setVariable(
"MM_CLASS", 
"MMActive");
 
  432                         $a_tpl->setVariable(
"SEL", 
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
 
  436                         $a_tpl->setVariable(
"MM_CLASS", 
"MMInactive");
 
  438                 $a_tpl->parseCurrentBlock();
 
  449                 $script = 
"./".$a_script;
 
  458                 if (defined(
"ILIAS_MODULE"))
 
  460                         $script = 
".".$script;
 
  469                 if($rbacsystem->checkAccess(
"visible,read", SYSTEM_FOLDER_ID))
 
  478                 include_once 
'./Services/Container/classes/class.ilMemberViewSettings.php';
 
  488                 return $this->tpl->get();
 
  495                 $this->tpl = 
new ilTemplate(
'tpl.member_view_main_menu.html',
true,
true,
'Services/MainMenu');
 
  497                 $this->tpl->setVariable(
'TXT_MM_HEADER',$lng->txt(
'mem_view_long'));
 
  498                 $this->tpl->setVariable(
'TXT_MM_CLOSE_PREVIEW',$lng->txt(
'mem_view_close'));
 
  501                 include_once 
'./classes/class.ilLink.php';
 
  503                 $this->tpl->setVariable(
 
  506                                 (
int) 
$_GET[
'ref_id'],
 
  510                 return $this->tpl->get();