49 function ilMainMenuGUI($a_target =
"_top", $a_use_start_template =
false)
54 $this->tpl =
new ilTemplate(
"tpl.main_menu.html",
true,
true,
57 $this->target = $a_target;
58 $this->start_template = $a_use_start_template;
64 $this->small = $a_small;
72 $this->active = $a_active;
80 echo
"ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
90 echo
"ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
99 echo
"ilMainMenu->addMenuBlick is deprecated. Use getHTML instead.";
101 $this->tpl->addBlockFile($a_var, $a_block,
"tpl.main_buttons.html");
113 require_once(
"Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
120 $this->tpl->setCurrentBlock(
"nav_history");
121 $this->tpl->setVariable(
"TXT_LAST_VISITED", $lng->txt(
"last_visited"));
122 $this->tpl->setVariable(
"NAVIGATION_HISTORY", $nav_html);
123 $this->tpl->parseCurrentBlock();
129 $this->tpl->setCurrentBlock(
"userisadmin");
132 $this->tpl->setVariable(
"TXT_ADMINISTRATION", $lng->txt(
"administration"));
133 $this->tpl->setVariable(
"SCRIPT_ADMIN", $this->
getScriptTarget(
"ilias.php?baseClass=ilAdministrationGUI"));
134 $this->tpl->setVariable(
"TARGET_ADMIN", $this->target);
135 if ($this->active ==
"administration")
137 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
138 $this->tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
142 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
144 $this->tpl->parseCurrentBlock();
148 include_once
'Services/Search/classes/class.ilSearchSettings.php';
151 $this->tpl->setCurrentBlock(
"searchbutton");
152 $this->tpl->setVariable(
"SCRIPT_SEARCH",$this->
getScriptTarget(
'ilias.php?baseClass=ilSearchController'));
153 $this->tpl->setVariable(
"TARGET_SEARCH",$this->target);
154 $this->tpl->setVariable(
"TXT_SEARCH", $lng->txt(
"search"));
155 if ($this->active ==
"search")
157 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
158 $this->tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
162 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
164 $this->tpl->parseCurrentBlock();
166 include_once
'./Services/Search/classes/class.ilMainMenuSearchGUI.php';
168 if(strlen($html = $main_search->getHTML()))
170 $this->tpl->setVariable(
'SEARCHBOX',$html);
176 include_once
'payment/classes/class.ilGeneralSettings.php';
179 $this->tpl->setCurrentBlock(
'shopbutton');
180 $this->tpl->setVariable(
'SCRIPT_SHOP', $this->
getScriptTarget(
'ilias.php?baseClass=ilShopController&cmd=clearFilter'));
181 $this->tpl->setVariable(
'TARGET_SHOP', $this->target);
183 include_once
'payment/classes/class.ilPaymentShoppingCart.php';
185 $items = $objShoppingCart->getEntries();
187 $this->tpl->setVariable(
'TXT_SHOP', $lng->txt(
'shop').(count($items) > 0 ?
' ('.count($items).
')' :
''));
189 if($this->active ==
'shop')
191 $this->tpl->setVariable(
'MM_CLASS',
'MMActive');
192 $this->tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
196 $this->tpl->setVariable(
'MM_CLASS',
'MMInactive');
198 $this->tpl->parseCurrentBlock();
211 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
213 $this->tpl->setCurrentBlock(
"desktopbutton");
216 $this->tpl->setVariable(
"TXT_PERSONAL_DESKTOP", $lng->txt(
"personal_desktop"));
217 #$this->tpl->setVariable("SCRIPT_DESK", $this->getScriptTarget("ilias.php?baseClass=ilPersonalDesktopGUI&PDHistory=1"));
218 $this->tpl->setVariable(
"SCRIPT_DESK", $this->
getScriptTarget(
"ilias.php?baseClass=ilPersonalDesktopGUI"));
219 $this->tpl->setVariable(
"TARGET_DESK", $this->target);
220 if ($this->active ==
"desktop")
222 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
223 $this->tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
227 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
229 $this->tpl->parseCurrentBlock();
231 include_once
"Services/Mail/classes/class.ilMail.php";
235 if( $rbacsystem->checkAccess(
'mail_visible', $mail->getMailObjectReferenceId()) )
237 $link =
"ilias.php?baseClass=ilMailGUI";
243 $add =
" ".sprintf($lng->txt(
"cnt_new"), $new_mails);
246 $this->tpl->setCurrentBlock(
"mailbutton");
249 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail").$add);
251 $this->tpl->setVariable(
"TARGET_MAIL", $this->target);
252 if ($this->active ==
"mail")
254 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
255 $this->tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
259 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
261 $this->tpl->parseCurrentBlock();
266 if ($ilSetting->get(
'chat_message_notify_status') == 1 && $_REQUEST[
'baseClass'] !=
'ilChatPresentationGUI' && $ilUser->getPref(
'chat_message_notify_status') == 1) {
267 include_once
'Modules/Chat/classes/class.ilChatMessageNotifyGUI.php';
269 $html = $msg_notify->getHtml();
271 $this->tpl->setCurrentBlock(
"chat_lastmsg");
272 $this->tpl->setVariable(
'CHAT_LAST_MESSAGE', $html);
273 $this->tpl->parseCurrentBlock();
279 include_once
'Modules/Chat/classes/class.ilChatInvitationGUI.php';
281 $chat_invitation_html = $chat_invitation_gui->getHTML();
282 if(trim($chat_invitation_html) !=
'')
284 $this->tpl->setCurrentBlock(
'chatbutton');
285 $this->tpl->setVariable(
'CHAT_INVITATIONS', $chat_invitation_html);
286 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
"rep_button");
291 # $this->tpl->setVariable("SCRIPT_CATALOG",'goto__target__root_1__client__ilias38.html');
292 # #$this->getScriptTarget("repository.php?cmd=frameset&getlast=true"));
294 include_once(
'classes/class.ilLink.php');
296 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
300 $title = $lng->txt(
"repository");
302 $this->tpl->setVariable(
"TXT_CATALOG",
$title);
303 if ($this->active ==
"repository" || $this->active ==
"")
305 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
306 $this->tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
310 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
313 $this->tpl->setVariable(
"TARGET", $this->target);
314 $this->tpl->parseCurrentBlock();
317 $link_dir = (defined(
"ILIAS_MODULE"))
325 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
327 include_once
'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
330 $this->tpl->setCurrentBlock(
"registration_link");
331 $this->tpl->setVariable(
"TXT_REGISTER",$lng->txt(
"register"));
332 $this->tpl->setVariable(
"LINK_REGISTER", $link_dir.
"register.php?client_id=".rawurlencode(CLIENT_ID).
"&lang=".$ilias->account->getCurrentLanguage());
333 $this->tpl->parseCurrentBlock();
337 include_once(
"./Services/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
339 $selection->setFormSelectMode(
"change_lang_to",
"ilLanguageSelection",
true,
340 "#",
"ilNavHistory",
"ilNavHistoryForm",
341 "_top", $lng->txt(
"ok"),
"ilLogin");
343 $selection->setListTitle($lng->txt(
"language"));
344 $selection->setItemLinkClass(
"small");
345 $languages = $lng->getInstalledLanguages();
347 foreach ($languages as $lang_key)
349 $base = substr($_SERVER[
"REQUEST_URI"], strrpos($_SERVER[
"REQUEST_URI"],
"/") + 1);
350 $base = str_replace(
"lang=",
"", $base);
354 $lang_key, $link,
"",
"",
"_top");
356 if (count($languages) > 0)
358 $this->tpl->setVariable(
"LANG_SELECT", $selection->getHTML());
361 $this->tpl->setCurrentBlock(
"userisanonymous");
362 $this->tpl->setVariable(
"TXT_NOT_LOGGED_IN",$lng->txt(
"not_logged_in"));
363 $this->tpl->setVariable(
"TXT_LOGIN",$lng->txt(
"log_in"));
366 if (
$_GET[
"ref_id"] !=
"")
368 if ($tree->isInTree(
$_GET[
"ref_id"]) &&
$_GET[
"ref_id"] != $tree->getRootId())
375 $this->tpl->setVariable(
"LINK_LOGIN",
376 $link_dir.
"login.php?target=".$target_str.
"&client_id=".rawurlencode(CLIENT_ID).
"&cmd=force_login&lang=".$ilias->account->getCurrentLanguage());
377 $this->tpl->parseCurrentBlock();
381 $this->tpl->setCurrentBlock(
"userisloggedin");
382 $this->tpl->setVariable(
"TXT_LOGIN_AS",$lng->txt(
"login_as"));
383 $this->tpl->setVariable(
"TXT_LOGOUT2",$lng->txt(
"logout"));
384 $this->tpl->setVariable(
"LINK_LOGOUT2", $link_dir.
"logout.php?lang=".$ilias->account->getCurrentLanguage());
385 $this->tpl->setVariable(
"USERNAME",$ilias->account->getFullname());
386 $this->tpl->parseCurrentBlock();
392 $this->tpl->setVariable(
"TXT_LOGOUT", $lng->txt(
"logout"));
395 include_once(
"./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
406 $this->tpl->setVariable(
"TXT_MAIN_MENU", $lng->txt(
"main_menu"));
408 $this->tpl->parseCurrentBlock();
418 $script =
"./".$a_script;
427 if (defined(
"ILIAS_MODULE"))
429 $script =
".".$script;
438 if($rbacsystem->checkAccess(
"visible,read", SYSTEM_FOLDER_ID))
449 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
459 return $this->tpl->get();
466 $this->tpl =
new ilTemplate(
'tpl.member_view_main_menu.html',
true,
true,
'Services/MainMenu');
468 $this->tpl->setVariable(
'TXT_MM_HEADER',$lng->txt(
'mem_view_long'));
469 $this->tpl->setVariable(
'TXT_MM_CLOSE_PREVIEW',$lng->txt(
'mem_view_close'));
472 include_once
'./classes/class.ilLink.php';
474 $this->tpl->setVariable(
477 (
int)
$_GET[
'ref_id'],
481 return $this->tpl->get();