function &executeCommand()
 {
     global $rbacsystem, $ilUser;
     // Check for incomplete profile
     if ($ilUser->getProfileIncomplete()) {
         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
     }
     // check whether password of user have to be changed
     // due to first login or password of user is expired
     if ($ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired()) {
         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
     }
     include_once 'Services/Search/classes/class.ilSearchSettings.php';
     // Check hacks
     if (!$rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
     switch ($forward_class) {
         case 'illucenesearchgui':
             $this->setLastClass('illucenesearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
             break;
         case 'illuceneadvancedsearchgui':
             $this->setLastClass('illuceneadvancedsearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneAdvancedSearchGUI());
             break;
         case 'iladvancedsearchgui':
             // Remember last class
             $this->setLastClass('iladvancedsearchgui');
             include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
             $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
             break;
         case 'ilsearchgui':
             // Remember last class
             $this->setLastClass('ilsearchgui');
         default:
             include_once 'Services/Search/classes/class.ilSearchGUI.php';
             $search_gui = new ilSearchGUI();
             $this->ctrl->forwardCommand($search_gui);
             break;
     }
     $this->tpl->show();
     return true;
 }
 function &executeCommand()
 {
     global $rbacsystem;
     include_once 'Services/Search/classes/class.ilSearchSettings.php';
     // Check hacks
     if (!$rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
     switch ($forward_class) {
         case 'illucenesearchgui':
             $this->setLastClass('illucenesearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
             break;
         case 'illuceneadvancedsearchgui':
             $this->setLastClass('illuceneadvancedsearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneAdvancedSearchGUI());
             break;
         case 'illuceneusersearchgui':
             $this->setLastClass('illuceneusersearchgui');
             include_once './Services/Search/classes/Lucene/class.ilLuceneUserSearchGUI.php';
             $this->ctrl->forwardCommand(new ilLuceneUserSearchGUI());
             break;
         case 'iladvancedsearchgui':
             // Remember last class
             $this->setLastClass('iladvancedsearchgui');
             include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
             $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
             break;
         case 'ilsearchgui':
             // Remember last class
             $this->setLastClass('ilsearchgui');
         default:
             include_once 'Services/Search/classes/class.ilSearchGUI.php';
             $search_gui = new ilSearchGUI();
             $this->ctrl->forwardCommand($search_gui);
             break;
     }
     $this->tpl->show();
     return true;
 }
 /**
  * set all template variables (images, scripts, target frames, ...)
  */
 function setTemplateVars()
 {
     global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin;
     if ($this->logo_only) {
         $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
         return;
     }
     // get user interface plugins
     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
     if ($this->getMode() != self::MODE_TOPBAR_REDUCED && $this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
         // search
         include_once 'Services/Search/classes/class.ilSearchSettings.php';
         if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
             include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php';
             $main_search = new ilMainMenuSearchGUI();
             $html = "";
             // user interface plugin slot + default rendering
             include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php";
             $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search", array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search));
             if (!$uip->replaced()) {
                 $html = $main_search->getHTML();
             }
             $html = $uip->getHTML($html);
             if (strlen($html)) {
                 $this->tpl->setVariable('SEARCHBOX', $html);
             }
         }
         $this->renderStatusBox($this->tpl);
         // online help
         $this->renderHelpButtons();
     }
     if ($this->getMode() == self::MODE_FULL) {
         $mmle_html = "";
         // user interface plugin slot + default rendering
         include_once "./Services/UIComponent/classes/class.ilUIHookProcessor.php";
         $uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries", array("main_menu_gui" => $this));
         if (!$uip->replaced()) {
             $mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu");
             $mmle_html = $this->renderMainMenuListEntries($mmle_tpl);
         }
         $mmle_html = $uip->getHTML($mmle_html);
         $this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html);
     }
     if ($this->getMode() != self::MODE_TOPBAR_MEMBERVIEW) {
         $link_dir = defined("ILIAS_MODULE") ? "../" : "";
         // login stuff
         if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
             include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
             if (ilRegistrationSettings::_lookupRegistrationType() != IL_REG_DISABLED) {
                 $this->tpl->setCurrentBlock("registration_link");
                 $this->tpl->setVariable("TXT_REGISTER", $lng->txt("register"));
                 $this->tpl->setVariable("LINK_REGISTER", $link_dir . "register.php?client_id=" . rawurlencode(CLIENT_ID) . "&lang=" . $ilias->account->getCurrentLanguage());
                 $this->tpl->parseCurrentBlock();
             }
             // language selection
             $selection = self::getLanguageSelection();
             if ($selection) {
                 // bs-patch start
                 global $ilUser, $lng;
                 $this->tpl->setVariable("TXT_LANGSELECT", $lng->txt("language"));
                 // bs-patch end
                 $this->tpl->setVariable("LANG_SELECT", $selection);
             }
             $this->tpl->setCurrentBlock("userisanonymous");
             $this->tpl->setVariable("TXT_NOT_LOGGED_IN", $lng->txt("not_logged_in"));
             $this->tpl->setVariable("TXT_LOGIN", $lng->txt("log_in"));
             // #13058
             $target_str = $this->getLoginTargetPar() != "" ? $this->getLoginTargetPar() : ilTemplate::buildLoginTarget();
             $this->tpl->setVariable("LINK_LOGIN", $link_dir . "login.php?target=" . $target_str . "&client_id=" . rawurlencode(CLIENT_ID) . "&cmd=force_login&lang=" . $ilias->account->getCurrentLanguage());
             $this->tpl->parseCurrentBlock();
         } else {
             if ($this->getMode() != self::MODE_TOPBAR_REDUCED) {
                 $notificationSettings = new ilSetting('notifications');
                 $chatSettings = new ilSetting('chatroom');
                 /**
                  * @var $tpl ilTemplate
                  */
                 global $tpl;
                 if ($chatSettings->get('chat_enabled') && $notificationSettings->get('enable_osd')) {
                     $this->tpl->touchBlock('osd_enabled');
                     $this->tpl->touchBlock('osd_container');
                     include_once "Services/jQuery/classes/class.iljQueryUtil.php";
                     iljQueryUtil::initjQuery();
                     include_once 'Services/MediaObjects/classes/class.ilPlayerUtil.php';
                     ilPlayerUtil::initMediaElementJs();
                     $tpl->addJavaScript('Services/Notifications/templates/default/notifications.js');
                     $tpl->addCSS('Services/Notifications/templates/default/osd.css');
                     require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
                     require_once 'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
                     $notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId());
                     $this->tpl->setVariable('NOTIFICATION_CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $lng->txt('close'))));
                     $this->tpl->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications));
                     $this->tpl->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '5');
                     $this->tpl->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') && $ilUser->getPref('chat_play_invitation_sound') ? 'true' : 'false');
                     foreach ($notifications as $notification) {
                         if ($notification['type'] == 'osd_maint') {
                             continue;
                         }
                         $this->tpl->setCurrentBlock('osd_notification_item');
                         $this->tpl->setVariable('NOTIFICATION_ICON_PATH', $notification['data']->iconPath);
                         $this->tpl->setVariable('NOTIFICATION_TITLE', $notification['data']->title);
                         $this->tpl->setVariable('NOTIFICATION_LINK', $notification['data']->link);
                         $this->tpl->setVariable('NOTIFICATION_LINKTARGET', $notification['data']->linktarget);
                         $this->tpl->setVariable('NOTIFICATION_ID', $notification['notification_osd_id']);
                         $this->tpl->setVariable('NOTIFICATION_SHORT_DESCRIPTION', $notification['data']->shortDescription);
                         $this->tpl->parseCurrentBlock();
                     }
                 }
             }
             $this->tpl->setCurrentBlock("userisloggedin");
             $this->tpl->setVariable("TXT_LOGIN_AS", $lng->txt("login_as"));
             $user_img_src = $ilias->account->getPersonalPicturePath("small", true);
             $user_img_alt = $ilias->account->getFullname();
             $this->tpl->setVariable("USER_IMG", ilUtil::img($user_img_src, $user_img_alt));
             $this->tpl->setVariable("USR_LINK_PROFILE", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile");
             $this->tpl->setVariable("USR_TXT_PROFILE", $lng->txt("personal_profile"));
             $this->tpl->setVariable("USR_LINK_SETTINGS", "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings");
             $this->tpl->setVariable("USR_TXT_SETTINGS", $lng->txt("personal_settings"));
             $this->tpl->setVariable("TXT_LOGOUT2", $lng->txt("logout"));
             $this->tpl->setVariable("LINK_LOGOUT2", $link_dir . "logout.php?lang=" . $ilias->account->getCurrentLanguage());
             $this->tpl->setVariable("USERNAME", $ilias->account->getFullname());
             $this->tpl->setVariable("LOGIN", $ilias->account->getLogin());
             $this->tpl->setVariable("MATRICULATION", $ilias->account->getMatriculation());
             $this->tpl->setVariable("EMAIL", $ilias->account->getEmail());
             $this->tpl->parseCurrentBlock();
         }
     } else {
         // member view info
         $this->tpl->setVariable("TOPBAR_CLASS", " ilMemberViewMainHeader");
         $this->tpl->setVariable("MEMBER_VIEW_INFO", $lng->txt("mem_view_long"));
     }
     if (!$this->topbar_back_url) {
         include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
         $header_top_title = ilObjSystemFolder::_getHeaderTitle();
         if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title")) {
             $this->tpl->setCurrentBlock("header_top_title");
             $this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
             $this->tpl->parseCurrentBlock();
         }
     } else {
         $this->tpl->setCurrentBlock("header_back_bl");
         $this->tpl->setVariable("URL_HEADER_BACK", $this->topbar_back_url);
         $this->tpl->setVariable("TXT_HEADER_BACK", $this->topbar_back_caption ? $this->topbar_back_caption : $lng->txt("back"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     if ($this->getMode() == self::MODE_FULL) {
         // $this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
         $this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
         $this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
     }
     include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
     // set link to return to desktop, not depending on a specific position in the hierarchy
     //$this->tpl->setVariable("SCRIPT_START", $this->getScriptTarget("start.php"));
     /*
     else
     {
     	$this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
     	$this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.svg"));
     }
     */
     $this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
     $this->tpl->parseCurrentBlock();
 }
 /**
  * desc
  *
  * @param
  * @return
  */
 function renderMainMenuListEntries($a_tpl, $a_call_get = true)
 {
     global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
     // personal desktop
     if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID) {
         /*$this->renderEntry($a_tpl, "desktop",
         		$lng->txt("personal_desktop"),
         		$this->getScriptTarget("ilias.php?baseClass=ilPersonalDesktopGUI"),
         		$this->target);*/
         //			$this->renderDropDown($a_tpl, "desktop");
         $this->renderEntry($a_tpl, "desktop", $lng->txt("personal_desktop"), "#");
         include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
         $ov = new ilOverlayGUI("mm_desk_ov");
         $ov->setTrigger("mm_desk_tr");
         $ov->setAnchor("mm_desk_tr");
         $ov->setAutoHide(false);
         $ov->add();
     }
     // repository
     if ($ilAccess->checkAccess('visible', '', ROOT_FOLDER_ID)) {
         include_once './Services/Link/classes/class.ilLink.php';
         $nd = $tree->getNodeData(ROOT_FOLDER_ID);
         $title = $nd["title"];
         if ($title == "ILIAS") {
             $title = $lng->txt("repository");
         }
         //$this->renderEntry($a_tpl, "repository",
         //	$title,
         //	ilLink::_getStaticLink(1,'root',true),
         //	$this->target);
         if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID || IS_PAYMENT_ENABLED) {
             $this->renderEntry($a_tpl, "repository", $title, "#");
             include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
             $ov = new ilOverlayGUI("mm_rep_ov");
             $ov->setTrigger("mm_rep_tr");
             $ov->setAnchor("mm_rep_tr");
             $ov->setAutoHide(false);
             $ov->add();
         }
     }
     // search
     include_once 'Services/Search/classes/class.ilSearchSettings.php';
     if ($rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
         /*			$this->renderEntry($a_tpl, "search",
         				$lng->txt("search"),
         				$this->getScriptTarget('ilias.php?baseClass=ilSearchController'),
         				$this->target); */
     }
     // webshop
     if (IS_PAYMENT_ENABLED) {
         $title = $lng->txt("shop");
         $this->renderEntry($a_tpl, "shop", $title, "#");
         include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
         $ov = new ilOverlayGUI("mm_shop_ov");
         $ov->setTrigger("mm_shop_tr");
         $ov->setAnchor("mm_shop_tr");
         $ov->setAutoHide(false);
         $ov->add();
     }
     // administration
     if (ilMainMenuGUI::_checkAdministrationPermission()) {
         //$this->renderEntry($a_tpl, "administration",
         //	$lng->txt("administration"),
         //	$this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
         //	$this->target);
         $this->renderDropDown($a_tpl, "administration");
     }
     // navigation history
     /*		require_once("Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
     		$nav_hist = new ilNavigationHistoryGUI();
     		$nav_html = $nav_hist->getHTML();
     		if ($nav_html != "")
     		{
     
     			$a_tpl->setCurrentBlock("nav_history");
     			$a_tpl->setVariable("TXT_LAST_VISITED", $lng->txt("last_visited"));
     			$a_tpl->setVariable("NAVIGATION_HISTORY", $nav_html);
     			$a_tpl->parseCurrentBlock();
     		}*/
     if ($a_call_get) {
         return $a_tpl->get();
     }
     return "";
 }