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())
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->setVariable(
"MATRICULATION",$ilias->account->getMatriculation());
216 $this->tpl->setVariable(
"TXT_LOGIN",$lng->txt(
"login"));
217 $this->tpl->setVariable(
"LOGIN",$ilias->account->getLogin());
218 $this->tpl->parseCurrentBlock();
224 $this->tpl->setVariable(
"TXT_LOGOUT", $lng->txt(
"logout"));
227 include_once(
"./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
238 $this->tpl->setVariable(
"TXT_MAIN_MENU", $lng->txt(
"main_menu"));
240 $this->tpl->parseCurrentBlock();
254 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
257 $lng->txt(
"personal_desktop"),
263 include_once(
'classes/class.ilLink.php');
264 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
268 $title = $lng->txt(
"repository");
276 include_once
'Services/Search/classes/class.ilSearchSettings.php';
286 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
288 include_once
"Services/Mail/classes/class.ilMail.php";
291 if($rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId()))
298 $add =
" ".sprintf($lng->txt(
"cnt_new"), $new_mails);
302 $lng->txt(
"mail").$add,
310 if(IS_PAYMENT_ENABLED)
312 $a_tpl->setCurrentBlock(
'shopbutton');
313 $a_tpl->setVariable(
'SCRIPT_SHOP', $this->
getScriptTarget(
'ilias.php?baseClass=ilShopController&cmd=clearFilter'));
314 $a_tpl->setVariable(
'TARGET_SHOP', $this->target);
316 include_once
'Services/Payment/classes/class.ilPaymentShoppingCart.php';
318 $items = $objShoppingCart->getEntries();
320 $a_tpl->setVariable(
'TXT_SHOP', $lng->txt(
'shop'));
323 if(count($items) > 0 )
326 $a_tpl->setVariable(
'SCRIPT_SHOPPINGCART', $this->
getScriptTarget(
'ilias.php?baseClass=ilShopController&cmd=redirect&redirect_class=ilshopshoppingcartgui'));
327 $a_tpl->setVariable(
'TARGET_SHOPPINGCART', $this->target);
328 $a_tpl->setVariable(
'TXT_SHOPPINGCART',
'('.count($items).
')');
329 if($this->active ==
'shop')
331 $a_tpl->setVariable(
'MM_CLASS_SHOPPINGCART',
'MMActive');
335 $a_tpl->setVariable(
'MM_CLASS_SHOPPINGCART',
'MMInactive');
339 if($this->active ==
'shop')
341 $a_tpl->setVariable(
'MM_CLASS',
'MMActive');
342 $a_tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
343 if(count($items) > 0 )
345 $a_tpl->setVariable(
'STYLE_SHOP',
'style="margin-right: 5px;"');
350 $a_tpl->setVariable(
'MM_CLASS',
'MMInactive');
351 if(count($items) > 0 )
353 $a_tpl->setVariable(
'STYLE_SHOP',
'style="margin-right: 5px;"');
356 $a_tpl->parseCurrentBlock();
364 $lng->txt(
"administration"),
371 require_once(
"Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
377 $a_tpl->setCurrentBlock(
"nav_history");
378 $a_tpl->setVariable(
"TXT_LAST_VISITED", $lng->txt(
"last_visited"));
379 $a_tpl->setVariable(
"NAVIGATION_HISTORY", $nav_html);
380 $a_tpl->parseCurrentBlock();
386 return $a_tpl->get();
398 function renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target =
"_top")
402 $id = strtolower($a_id);
403 $id_up = strtoupper($a_id);
404 $a_tpl->setCurrentBlock(
"entry_".$id);
405 $a_tpl->setVariable(
"TXT_".$id_up, $a_txt);
406 $a_tpl->setVariable(
"SCRIPT_".$id_up, $a_script);
407 $a_tpl->setVariable(
"TARGET_".$id_up, $a_target);
408 if ($this->active == $a_id || ($this->active ==
"" && $a_id ==
"repository"))
410 $a_tpl->setVariable(
"MM_CLASS",
"MMActive");
411 $a_tpl->setVariable(
"SEL",
'<span class="ilAccHidden">('.$lng->txt(
"stat_selected").
')</span>');
415 $a_tpl->setVariable(
"MM_CLASS",
"MMInactive");
417 $a_tpl->parseCurrentBlock();
428 $script =
"./".$a_script;
437 if (defined(
"ILIAS_MODULE"))
439 $script =
".".$script;
448 if($rbacsystem->checkAccess(
"visible,read", SYSTEM_FOLDER_ID))
457 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
467 return $this->tpl->get();
474 $this->tpl =
new ilTemplate(
'tpl.member_view_main_menu.html',
true,
true,
'Services/MainMenu');
476 $this->tpl->setVariable(
'TXT_MM_HEADER',$lng->txt(
'mem_view_long'));
477 $this->tpl->setVariable(
'TXT_MM_CLOSE_PREVIEW',$lng->txt(
'mem_view_close'));
480 include_once
'./classes/class.ilLink.php';
482 $this->tpl->setVariable(
485 (
int)
$_GET[
'ref_id'],
489 return $this->tpl->get();