49 function ilMainMenuGUI($a_target =
"_top", $a_use_start_template =
false)
54 $this->tpl =
new ilTemplate(
"tpl.main_buttons.html",
true,
true);
56 $this->target = $a_target;
57 $this->start_template = $a_use_start_template;
63 $this->small = $a_small;
71 $this->active = $a_active;
79 echo
"ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
89 echo
"ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
98 echo
"ilMainMenu->addMenuBlick is deprecated. Use getHTML instead.";
100 $this->tpl->addBlockFile($a_var, $a_block,
"tpl.main_buttons.html");
108 global $rbacsystem,
$lng,
$ilias, $tree, $ilUser;
112 require_once(
"Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
119 $this->tpl->setCurrentBlock(
"nav_history");
120 $this->tpl->setVariable(
"NAVIGATION_HISTORY", $nav_html);
121 $this->tpl->parseCurrentBlock();
127 $this->tpl->setCurrentBlock(
"userisadmin");
130 $this->tpl->setVariable(
"TXT_ADMINISTRATION", $lng->txt(
"administration"));
131 $this->tpl->setVariable(
"SCRIPT_ADMIN", $this->
getScriptTarget(
"ilias.php?baseClass=ilAdministrationGUI"));
132 $this->tpl->setVariable(
"TARGET_ADMIN", $this->target);
133 if ($this->active ==
"administration")
135 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
139 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
141 $this->tpl->parseCurrentBlock();
145 include_once
'Services/Search/classes/class.ilSearchSettings.php';
148 $this->tpl->setCurrentBlock(
"searchbutton");
149 $this->tpl->setVariable(
"SCRIPT_SEARCH",$this->
getScriptTarget(
'ilias.php?baseClass=ilSearchController'));
150 $this->tpl->setVariable(
"TARGET_SEARCH",$this->target);
151 $this->tpl->setVariable(
"TXT_SEARCH", $lng->txt(
"search"));
152 if ($this->active ==
"search")
154 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
158 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
160 $this->tpl->parseCurrentBlock();
165 include_once
'payment/classes/class.ilGeneralSettings.php';
168 $this->tpl->setCurrentBlock(
'shopbutton');
169 $this->tpl->setVariable(
'SCRIPT_SHOP', $this->
getScriptTarget(
'ilias.php?baseClass=ilShopController&cmd=clearFilter'));
170 $this->tpl->setVariable(
'TARGET_SHOP', $this->target);
172 include_once
'payment/classes/class.ilPaymentShoppingCart.php';
174 $items = $objShoppingCart->getEntries();
176 $this->tpl->setVariable(
'TXT_SHOP', $lng->txt(
'shop').(count($items) > 0 ?
' ('.count($items).
')' :
''));
178 if($this->active ==
'shop')
180 $this->tpl->setVariable(
'MM_CLASS',
'MMActive');
184 $this->tpl->setVariable(
'MM_CLASS',
'MMInactive');
186 $this->tpl->parseCurrentBlock();
199 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
201 $this->tpl->setCurrentBlock(
"desktopbutton");
204 $this->tpl->setVariable(
"TXT_PERSONAL_DESKTOP", $lng->txt(
"personal_desktop"));
205 $this->tpl->setVariable(
"SCRIPT_DESK", $this->
getScriptTarget(
"ilias.php?baseClass=ilPersonalDesktopGUI&PDHistory=1"));
206 $this->tpl->setVariable(
"TARGET_DESK", $this->target);
207 if ($this->active ==
"desktop")
209 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
213 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
215 $this->tpl->parseCurrentBlock();
217 include_once
"Services/Mail/classes/class.ilMail.php";
221 if($rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId()))
223 #$link = "mail_frameset.php";
224 $link =
"ilias.php?baseClass=ilMailGUI";
230 $folder_id = $mbox->getInboxFolder();
235 $add =
" ".sprintf($lng->txt(
"cnt_new"),
239 $this->tpl->setCurrentBlock(
"mailbutton");
242 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail").$add);
244 $this->tpl->setVariable(
"TARGET_MAIL", $this->target);
245 if ($this->active ==
"mail")
247 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
251 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
253 $this->tpl->parseCurrentBlock();
258 include_once
'Modules/Chat/classes/class.ilChatInvitationGUI.php';
260 $chat_invitation_html = $chat_invitation_gui->getHTML();
261 if(trim($chat_invitation_html) !=
'')
263 $this->tpl->setCurrentBlock(
'chatbutton');
264 $this->tpl->setVariable(
'CHAT_INVITATIONS', $chat_invitation_html);
265 $this->tpl->parseCurrentBlock();
269 $this->tpl->setCurrentBlock(
"rep_button");
270 # $this->tpl->setVariable("SCRIPT_CATALOG",'goto__target__root_1__client__ilias38.html');
271 # #$this->getScriptTarget("repository.php?cmd=frameset&getlast=true"));
273 include_once(
'classes/class.ilLink.php');
275 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
279 $title = $lng->txt(
"repository");
281 $this->tpl->setVariable(
"TXT_CATALOG",
$title);
282 if ($this->active ==
"repository" || $this->active ==
"")
284 $this->tpl->setVariable(
"MM_CLASS",
"MMActive");
288 $this->tpl->setVariable(
"MM_CLASS",
"MMInactive");
291 $this->tpl->setVariable(
"TARGET", $this->target);
292 $this->tpl->parseCurrentBlock();
295 $link_dir = (defined(
"ILIAS_MODULE"))
303 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
305 include_once
'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
308 $this->tpl->setCurrentBlock(
"registration_link");
309 $this->tpl->setVariable(
"TXT_REGISTER",$lng->txt(
"register"));
310 $this->tpl->setVariable(
"LINK_REGISTER", $link_dir.
"register.php?client_id=".rawurlencode(CLIENT_ID).
"&lang=".$ilias->account->getCurrentLanguage());
311 $this->tpl->parseCurrentBlock();
314 $languages = $lng->getInstalledLanguages();
316 foreach ($languages as $lang_key)
318 $this->tpl->setCurrentBlock(
"languages");
319 $this->tpl->setVariable(
"LANG_KEY", $lang_key);
320 $this->tpl->setVariable(
"LANG_NAME",
322 $this->tpl->parseCurrentBlock();
325 $this->tpl->setVariable(
"TXT_OK", $lng->txt(
"ok"));
327 $this->tpl->setVariable(
"LANG_FORM_ACTION",
"#");
328 $this->tpl->setVariable(
"TXT_CHOOSE_LANGUAGE", $lng->txt(
"choose_language"));
330 $this->tpl->setCurrentBlock(
"userisanonymous");
331 $this->tpl->setVariable(
"TXT_NOT_LOGGED_IN",$lng->txt(
"not_logged_in"));
332 $this->tpl->setVariable(
"TXT_LOGIN",$lng->txt(
"log_in"));
335 if (
$_GET[
"ref_id"] !=
"")
337 if ($tree->isInTree(
$_GET[
"ref_id"]) &&
$_GET[
"ref_id"] != $tree->getRootId())
341 $target_str = $type.
"_".
$_GET[
"ref_id"];
344 $this->tpl->setVariable(
"LINK_LOGIN",
345 $link_dir.
"login.php?target=".$target_str.
"&client_id=".rawurlencode(CLIENT_ID).
"&cmd=force_login&lang=".$ilias->account->getCurrentLanguage());
346 $this->tpl->parseCurrentBlock();
350 $this->tpl->setCurrentBlock(
"userisloggedin");
351 $this->tpl->setVariable(
"TXT_LOGIN_AS",$lng->txt(
"login_as"));
352 $this->tpl->setVariable(
"TXT_LOGOUT2",$lng->txt(
"logout"));
353 $this->tpl->setVariable(
"LINK_LOGOUT2", $link_dir.
"logout.php?lang=".$ilias->account->getCurrentLanguage());
354 $this->tpl->setVariable(
"USERNAME",$ilias->account->getFullname());
355 $this->tpl->parseCurrentBlock();
361 $this->tpl->setVariable(
"TXT_LOGOUT", $lng->txt(
"logout"));
365 include_once(
"./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
372 $this->tpl->parseCurrentBlock();
382 $script =
"./".$a_script;
391 if (defined(
"ILIAS_MODULE"))
393 $script =
".".$script;
402 if($rbacsystem->checkAccess(
"visible,read", SYSTEM_FOLDER_ID))
414 return $this->tpl->get();