当前位置: 首页>>代码示例>>PHP>>正文


PHP ilTemplate::buildLoginTarget方法代码示例

本文整理汇总了PHP中ilTemplate::buildLoginTarget方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTemplate::buildLoginTarget方法的具体用法?PHP ilTemplate::buildLoginTarget怎么用?PHP ilTemplate::buildLoginTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilTemplate的用法示例。


在下文中一共展示了ilTemplate::buildLoginTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setTemplateVars

 /**
  * 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') {
//.........这里部分代码省略.........
开发者ID:JKN-INC,项目名称:SHELBY-ILIAS,代码行数:101,代码来源:class.ilMainMenuGUI.php


注:本文中的ilTemplate::buildLoginTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。