Example #1
0
	function EndContent()
	{
		if ($this->bContentStarted)
		{
			echo '</form>'."\r\n";

			$hkInstance = CHotKeys::getInstance();
			$Execs = $hkInstance->GetCodeByClassName("CDialog");
			echo $hkInstance->PrintJSExecs($Execs, "", true, true);

			if ($this->bContentBuffered)
			{
?></div><script type="text/javascript">BX.ready(function() {<?php 
echo $this->jsPopup;
?>
.SwapContent(BX('<?echo $this->cont_id?>'))});</script><?
			}

			if (!defined('FX_PUBLIC_MODE') || FX_PUBLIC_MODE == false)
			{
?><script type="text/javascript"><?echo "BX.adminFormTools.modifyFormElements(".$this->jsPopup.".DIV);"?></script><?
			}

			$this->bContentStarted = false;
		}
	}
Example #2
0
 public static function GetInstance()
 {
     global $USER;
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
         self::$codes = new CHotKeysCode();
         self::$optUse = COption::GetOptionString('main', "use_hot_keys", "Y") == "Y";
         self::$ExpImpFileName = "hk_export_" . $_SERVER['HTTP_HOST'] . ".srl";
         self::$cacheId = "b_hot_keys" . $USER->GetID() . LANGUAGE_ID;
         if (self::$optUse) {
             self::$instance->LoadToCache();
         }
     }
     return self::$instance;
 }
Example #3
0
    function GetPanelHtml()
    {
        global $USER, $APPLICATION, $adminPage;
        if ($APPLICATION->ShowPanel === false || !$USER->IsAuthorized() && $APPLICATION->ShowPanel !== true) {
            return "";
        }
        CTopPanel::InitPanelIcons();
        $arPanelButtons =& $APPLICATION->arPanelButtons;
        $bShowPanel = false;
        foreach ($arPanelButtons as $arValue) {
            if (trim($arValue["HREF"]) != "" || is_array($arValue["MENU"]) && !empty($arValue["MENU"])) {
                //we have at least one button to show
                $bShowPanel = true;
                break;
            }
        }
        if ($bShowPanel == false) {
            $bShowPanel = self::IsShownForUser();
        }
        if ($bShowPanel == false && $APPLICATION->ShowPanel !== true) {
            return "";
        }
        $APPLICATION->PanelShowed = true;
        if (isset($_GET["back_url_admin"]) && $_GET["back_url_admin"] != "" && strpos($_GET["back_url_admin"], "/") === 0) {
            $_SESSION["BACK_URL_ADMIN"] = $_GET["back_url_admin"];
        }
        $aUserOpt = CUserOptions::GetOption("admin_panel", "settings");
        $aUserOptGlobal = CUserOptions::GetOption("global", "settings");
        $toggleModeSet = false;
        if (isset($_GET["freetrix_include_areas"]) && $_GET["freetrix_include_areas"] != "") {
            $APPLICATION->SetShowIncludeAreas($_GET["freetrix_include_areas"] == "Y");
            $toggleModeSet = true;
        }
        $params = DeleteParam(array("freetrix_include_areas", "freetrix_show_mode", "back_url_admin"));
        $href = $APPLICATION->GetCurPage();
        $hrefEnc = htmlspecialcharsbx($href);
        $toggleModeDynamic = $aUserOptGlobal['panel_dynamic_mode'] == 'Y';
        $toggleMode = $toggleModeDynamic && !$toggleModeSet ? $aUserOpt['edit'] == 'on' : $APPLICATION->GetShowIncludeAreas() == 'Y';
        //Save if changed
        $old_edit = $aUserOpt['edit'];
        $aUserOpt['edit'] = $toggleMode ? 'on' : 'off';
        if ($old_edit !== $aUserOpt['edit']) {
            CUserOptions::SetOption('admin_panel', 'settings', $aUserOpt);
        }
        $toggleModeLink = $hrefEnc . '?freetrix_include_areas=' . ($toggleMode ? 'N' : 'Y') . ($params != "" ? "&amp;" . htmlspecialcharsbx($params) : "");
        $result = CTopPanel::ShowPanelScripts(true);
        $result .= '
	<!--[if lte IE 7]>
	<style type="text/css">#bx-panel {display:none !important;}</style>
	<div id="bx-panel-error">' . GetMessage("top_panel_browser") . '</div><![endif]-->
	<script type="text/javascript">BX.admin.dynamic_mode=' . ($toggleModeDynamic ? 'true' : 'false') . '; BX.admin.dynamic_mode_show_borders = ' . ($toggleMode ? 'true' : 'false') . ';</script>
	<div style="display:none; overflow:hidden;" id="bx-panel-back"></div>
	<div id="bx-panel"' . ($aUserOpt["collapsed"] == "on" ? ' class="bx-panel-folded"' : '') . '>
		<div id="bx-panel-top">
			<div id="bx-panel-top-gutter"></div>
			<div id="bx-panel-tabs">
	';
        $result .= '
				<a id="bx-panel-menu" href="" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_start_menu_tooltip_title'), GetMessage('top_panel_start_menu_tooltip')) . '><span id="bx-panel-menu-icon"></span><span id="bx-panel-menu-text">' . GetMessage("top_panel_menu") . '</span></a><a id="bx-panel-view-tab"><span>' . GetMessage("top_panel_site") . '</span></a><a id="bx-panel-admin-tab" href="' . (isset($_SESSION["BACK_URL_ADMIN"]) && $_SESSION["BACK_URL_ADMIN"] != "" ? htmlspecialcharsbx($_SESSION["BACK_URL_ADMIN"]) . (strpos($_SESSION["BACK_URL_ADMIN"], "?") !== false ? "&amp;" : "?") : '/freetrix/admin/index.php?lang=' . LANGUAGE_ID . '&amp;') . 'back_url_pub=' . urlencode($href . ($params != "" ? "?" . $params : "")) . '"><span>' . GetMessage("top_panel_admin") . '</span></a>';
        $back_url = CUtil::JSUrlEscape(CUtil::addslashes($href . ($params != "" ? "?" . $params : "")));
        $arStartMenuParams = array('DIV' => 'bx-panel-menu', 'ACTIVE_CLASS' => 'bx-pressed', 'MENU_URL' => '/freetrix/admin/get_start_menu.php?lang=' . LANGUAGE_ID . '&back_url_pub=' . urlencode($back_url) . '&' . freetrix_sessid_get(), 'MENU_PRELOAD' => $aUserOptGlobal["start_menu_preload"] == 'Y');
        $result .= '<script type="text/javascript">BX.message({MENU_ENABLE_TOOLTIP: ' . ($aUserOptGlobal['start_menu_title'] != 'N' ? 'true' : 'false') . '}); new BX.COpener(' . CUtil::PhpToJsObject($arStartMenuParams) . ');</script>';
        $hkInstance = CHotKeys::getInstance();
        $Execs = $hkInstance->GetCodeByClassName("top_panel_menu", GetMessage("top_panel_menu"));
        $result .= $hkInstance->PrintJSExecs($Execs);
        $Execs = $hkInstance->GetCodeByClassName("top_panel_admin", GetMessage("top_panel_admin"));
        $result .= $hkInstance->PrintJSExecs($Execs);
        if ($USER->CanDoOperation("cache_control")) {
            $result .= '<a id="bx-panel-clear-cache" href="" onclick="BX.clearCache(); return false;"><span id="bx-panel-clear-cache-icon"></span><span id="bx-panel-clear-cache-text">' . GetMessage("top_panel_cache_new_tooltip_title") . '</span></a>';
        }
        $result .= '
			</div>
			<div id="bx-panel-userinfo">
	';
        $bCanProfile = $USER->CanDoOperation('view_own_profile') || $USER->CanDoOperation('edit_own_profile');
        $userName = CUser::FormatName(CSite::GetNameFormat(false), array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetSecondName(), "LOGIN" => $USER->GetLogin()), $bUseLogin = true, $bHTMLSpec = true);
        if ($bCanProfile) {
            $result .= '<a href="/freetrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $USER->GetID() . '" id="bx-panel-user" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_profile_tooltip')) . '><span id="bx-panel-user-icon"></span><span id="bx-panel-user-text">' . $userName . '</span></a>';
        } else {
            $result .= '<a id="bx-panel-user"><span id="bx-panel-user-icon"></span><span id="bx-panel-user-text">' . $userName . '</span></a>';
        }
        $result .= '<a href="' . $hrefEnc . '?logout=yes' . htmlspecialcharsbx(($s = DeleteParam(array("logout"))) == "" ? "" : "&" . $s) . '" id="bx-panel-logout" ' . CTopPanel::AddAttrHint(GetMessage('top_panel_logout_tooltip') . $hkInstance->GetTitle("bx-panel-logout", true)) . '>' . GetMessage("top_panel_logout") . '</a>';
        $toggleCaptionOn = '<span id="bx-panel-toggle-caption-mode-on">' . GetMessage("top_panel_on") . '</span>';
        $toggleCaptionOff = '<span id="bx-panel-toggle-caption-mode-off">' . GetMessage("top_panel_off") . '</span>';
        $toggleCaptions = $toggleMode ? $toggleCaptionOn . $toggleCaptionOff : $toggleCaptionOff . $toggleCaptionOn;
        $toogle = '<a href="' . $toggleModeLink . '" id="bx-panel-toggle" class="bx-panel-toggle' . ($toggleMode ? '-on' : '-off') . '"' . ($toggleModeDynamic ? '' : ' ' . CTopPanel::AddAttrHint(GetMessage("top_panel_edit_mode_new_tooltip_title"), GetMessage('top_panel_toggle_tooltip') . $hkInstance->GetTitle("bx-panel-small-toggle", true))) . '><span id="bx-panel-switcher-gutter-left"></span><span id="bx-panel-toggle-indicator"><span id="bx-panel-toggle-icon"></span><span id="bx-panel-toggle-icon-overlay"></span></span><span class="bx-panel-break"></span><span id="bx-panel-toggle-caption">' . GetMessage("top_panel_edit_mode_new") . '</span><span class="bx-panel-break"></span><span id="bx-panel-toggle-caption-mode">' . $toggleCaptions . '</span><span id="bx-panel-switcher-gutter-right"></span></a>';
        if ($aUserOpt["collapsed"] == "on") {
            $result .= $toogle;
        }
        $result .= '<a href="" id="bx-panel-expander" ' . CTopPanel::AddAttrHint(GetMessage("top_panel_expand_tooltip_title"), GetMessage("top_panel_expand_tooltip") . $hkInstance->GetTitle("bx-panel-expander", true)) . '><span id="bx-panel-expander-text">' . GetMessage("top_panel_expand") . '</span><span id="bx-panel-expander-arrow"></span></a>';
        if ($hkInstance->IsActive()) {
            $result .= '<a id="bx-panel-hotkeys" href="javascript:void(0)" onclick="BXHotKeys.ShowSettings();" ' . CTopPanel::AddAttrHint(GetMessage("HK_PANEL_TITLE") . $hkInstance->GetTitle("bx-panel-hotkeys", true)) . '></a>';
        }
        $result .= '<a href="javascript:void(0)" id="bx-panel-pin"' . ($aUserOpt['fix'] == 'on' ? ' class="bx-panel-pin-fixed"' : '') . ' ' . CTopPanel::AddAttrHint(GetMessage('top_panel_pin_tooltip')) . '></a>';
        $Execs = $hkInstance->GetCodeByClassName("bx-panel-logout", GetMessage('top_panel_logout_tooltip'));
        $result .= $hkInstance->PrintJSExecs($Execs);
        $Execs = $hkInstance->GetCodeByClassName("bx-panel-small-toggle", GetMessage("top_panel_edit_mode_new_tooltip_title"), 'location.href="' . $href . '?freetrix_include_areas=' . ($toggleMode ? 'N' : 'Y') . ($params != "" ? "&" . $params : "") . '";');
        $result .= $hkInstance->PrintJSExecs($Execs);
        $Execs = $hkInstance->GetCodeByClassName("bx-panel-expander", GetMessage("top_panel_expand_tooltip_title") . "/" . GetMessage("top_panel_collapse_tooltip_title"));
        $result .= $hkInstance->PrintJSExecs($Execs);
        $result .= '
			</div>
		</div>
	';
        /* BUTTONS */
        $result .= '<div id="bx-panel-site-toolbar"><div id="bx-panel-buttons-gutter"></div><div id="bx-panel-switcher">';
        if ($aUserOpt["collapsed"] != "on") {
            $result .= $toogle;
        }
        $result .= '<a href="" id="bx-panel-hider" ' . CTopPanel::AddAttrHint(GetMessage("top_panel_collapse_tooltip_title"), GetMessage("top_panel_collapse_tooltip") . $hkInstance->GetTitle("bx-panel-expander", true)) . '>' . GetMessage("top_panel_collapse") . '<span id="bx-panel-hider-arrow"></span></a>';
        $result .= '</div><div id="bx-panel-buttons"><div id="bx-panel-buttons-inner">';
        $main_sort = "";
        $last_btn_type = '';
        $last_btn_small_cnt = 0;
        $groupId = -1;
        $result .= '<span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">';
        sortByColumn($arPanelButtons, array("MAIN_SORT" => SORT_ASC, "SORT" => SORT_ASC));
        foreach ($arPanelButtons as $key => $arButton) {
            $result .= $hkInstance->PrintTPButton($arButton);
            if ($main_sort != $arButton["MAIN_SORT"] && $main_sort != "") {
                $result .= '</span><span class="bx-panel-button-separator"></span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">';
                $last_btn_small_cnt = 0;
            }
            if (!isset($arButton['TYPE']) || $arButton['TYPE'] != 'BIG') {
                $arButton['TYPE'] = 'SMALL';
            }
            //very old behaviour
            if (is_set($arButton, "SRC_0")) {
                $arButton["SRC"] = $arButton["SRC_0"];
            }
            $arButton['HREF'] = isset($arButton['HREF']) ? trim($arButton['HREF']) : '';
            $bHasAction = $arButton['HREF'] != '';
            if (array_key_exists("RESORT_MENU", $arButton) && $arButton["RESORT_MENU"] === true && is_array($arButton['MENU']) && !empty($arButton['MENU'])) {
                sortByColumn($arButton['MENU'], "SORT", '', PHP_INT_MAX);
            }
            $bHasMenu = is_array($arButton['MENU']) && count($arButton['MENU']) > 0;
            if ($bHasMenu && !$bHasAction) {
                foreach ($arButton['MENU'] as $arItem) {
                    if (isset($arItem['DEFAULT']) && $arItem['DEFAULT']) {
                        $arButton['HREF'] = $arItem['HREF'];
                        $bHasAction = true;
                    }
                }
            }
            if ($last_btn_type != '' && $arButton['TYPE'] != $last_btn_type && $main_sort == $arButton["MAIN_SORT"]) {
                $result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">';
                $last_btn_small_cnt = 0;
            }
            if ($bHasAction && substr(strtolower($arButton['HREF']), 0, 11) == 'javascript:') {
                $arButton['ONCLICK'] = substr($arButton['HREF'], 11);
                $arButton['HREF'] = 'javascript:void(0)';
            }
            if ($arButton['HINT']) {
                if (isset($arButton['HINT']['ID']) && $arButton['HINT']['ID']) {
                    $hintOptions = CUtil::GetPopupOptions($arButton['HINT']['ID']);
                    if ($hintOptions['display'] == 'off') {
                        unset($arButton['HINT']);
                    }
                }
                if ($arButton['HINT']) {
                    unset($arButton['ALT']);
                }
                if ($bHasMenu && (!isset($arButton['HINT_MENU']) || !$arButton['HINT_MENU'])) {
                    $arButton['HINT']['TARGET'] = 'parent';
                }
            }
            $title = isset($arButton['ALT']) ? htmlspecialcharsbx($arButton['ALT']) : '';
            $onClick = isset($arButton['ONCLICK']) ? htmlspecialcharsbx($arButton['ONCLICK']) : '';
            $onClickJs = isset($arButton['ONCLICK']) ? CUtil::JSEscape($arButton['ONCLICK']) : '';
            $hintMenu = isset($arButton['HINT_MENU']) ? CUtil::PhpToJsObject($arButton['HINT_MENU']) : '';
            switch ($arButton['TYPE']) {
                case 'SMALL':
                    if ($last_btn_small_cnt >= 3 && $main_sort == $arButton["MAIN_SORT"]) {
                        $result .= '</span><span class="bx-panel-button-group" data-group-id="' . ++$groupId . '">';
                        $last_btn_small_cnt = 0;
                    } elseif ($last_btn_small_cnt > 0) {
                        $result .= '<span class="bx-panel-break"></span>';
                    }
                    $result .= '<span class="bx-panel-small-button"><span class="bx-panel-small-button-inner">';
                    $button_icon = '<span class="bx-panel-small-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>';
                    $button_text = '<span class="bx-panel-small-button-text">' . htmlspecialcharsbx($arButton['TEXT']) . '</span>';
                    $button_text_js = CUtil::JSEscape($arButton['TEXT']);
                    if ($bHasAction) {
                        $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\')" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"' : '"' . $hkInstance->GetTitle("bx_topmenu_btn_" . $key) . '"') . '>' . $button_icon . $button_text . '</a>';
                        $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', ACTIVE_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-active\', HOVER_CSS: \'bx-panel-small-button' . ($bHasMenu ? '-text' : '') . '-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : ' . ($bHasMenu ? "true" : "false") . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '",TEXT :  "' . $button_text_js . '" })</script>';
                        if ($bHasMenu) {
                            $result .= '<a href="javascript:void(0)" class="bx-panel-small-button-arrow" id="bx_topmenu_btn_' . $key . '_menu"><span class="bx-panel-small-button-arrow"></span></a>';
                            $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'SMALL\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-small-button-arrow-active\', HOVER_CSS: \'bx-panel-small-button-arrow-hover\'' . ($hintMenu ? ', HINT: ' . $hintMenu : '') . ', GROUP_ID : ' . $groupId . ', TEXT :  "' . $button_text_js . '"})</script>';
                        }
                    } elseif ($bHasMenu) {
                        $result .= '<a href="javascript:void(0)" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . $button_text . '<span class="bx-panel-small-single-button-arrow"></span></a>';
                        $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'SMALL\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-small-button-active\', HOVER_CSS: \'bx-panel-small-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', TEXT :  "' . $button_text_js . '"})</script>';
                    }
                    $result .= '</span></span>';
                    $last_btn_small_cnt++;
                    break;
                case 'BIG':
                    $last_btn_small_cnt = 0;
                    $result .= '<span class="bx-panel-button"><span class="bx-panel-button-inner">';
                    $button_icon = '<span class="bx-panel-button-icon' . ($arButton['ICON'] ? ' ' . $arButton['ICON'] : '') . '"' . (isset($arButton['SRC']) && $arButton['SRC'] ? ' style="background: scroll transparent url(' . htmlspecialcharsbx($arButton['SRC']) . ') no-repeat center center !important;"' : '') . '></span>';
                    $button_text_js = CUtil::JSEscape(str_replace('#BR#', ' ', $arButton['TEXT']));
                    if ($bHasAction && $bHasMenu) {
                        $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . '&nbsp;<span class="bx-panel-button-arrow"></span></span>';
                        $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-button-icon-active\');" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . '</a><a id="bx_topmenu_btn_' . $key . '_menu" href="javascript:void(0)">' . $button_text . '</a>';
                        $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'BIG\', ACTIVE_CSS: \'bx-panel-button-icon-active\', HOVER_CSS: \'bx-panel-button-icon-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', SKIP : true }); BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'BIG\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-button-text-active\', HOVER_CSS: \'bx-panel-button-text-hover\'' . ($hintMenu ? ', HINT: ' . $hintMenu : '') . ', GROUP_ID : ' . $groupId . ', TEXT :  "' . $button_text_js . '"})</script>';
                    } else {
                        if ($bHasAction) {
                            $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . '</span>';
                            $result .= '<a href="' . htmlspecialcharsbx($arButton['HREF']) . '" onclick="' . $onClick . ';BX.removeClass(this.parentNode.parentNode, \'bx-panel-button-active\');" id="bx_topmenu_btn_' . $key . '"' . ($title ? ' title="' . $title . '"' : '') . '>' . $button_icon . $button_text . '</a>';
                            $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '\', TYPE: \'BIG\', ACTIVE_CSS: \'bx-panel-button-active\', HOVER_CSS: \'bx-panel-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', LINK: "' . CUtil::JSEscape($arButton['HREF']) . '", ACTION : "' . $onClickJs . '", TEXT :  "' . $button_text_js . '"});</script>';
                        } else {
                            $button_text = '<span class="bx-panel-button-text">' . str_replace('#BR#', '<span class="bx-panel-break"></span>', $arButton['TEXT']) . '&nbsp;<span class="bx-panel-button-arrow"></span></span>';
                            $result .= '<a href="javascript:void(0)" id="bx_topmenu_btn_' . $key . '_menu">' . $button_icon . $button_text . '</a>';
                            $result .= '<script type="text/javascript">BX.admin.panel.RegisterButton({ID: \'bx_topmenu_btn_' . $key . '_menu\', TYPE: \'BIG\', MENU: ' . CUtil::PhpToJsObject($arButton['MENU']) . ', ACTIVE_CSS: \'bx-panel-button-active\', HOVER_CSS: \'bx-panel-button-hover\'' . ($arButton['HINT'] ? ', HINT: ' . CUtil::PhpToJsObject($arButton['HINT']) : '') . ', GROUP_ID : ' . $groupId . ', TEXT :  "' . $button_text_js . '"});</script>';
                        }
                    }
                    $result .= '</span></span>';
                    break;
            }
            $main_sort = $arButton["MAIN_SORT"];
            $last_btn_type = $arButton['TYPE'];
        }
        $result .= '</span>';
        $result .= '</div>
			</div>
		</div>';
        if ($USER->IsAdmin()) {
            $result .= CAdminNotify::GetHtml();
        }
        $result .= '
	</div>
	';
        $result .= '<script type="text/javascript">
		BX.admin.panel.state = {
			fixed: ' . ($aUserOpt["fix"] == "on" ? 'true' : 'false') . ',
			collapsed: ' . ($aUserOpt["collapsed"] == "on" ? 'true' : 'false') . '
		}
		BX.admin.moreButton.init({ buttonTitle : "' . GetMessageJS("top_panel_more_button_title") . '"});
		</script>';
        //start menu preload
        // if($aUserOptGlobal["start_menu_preload"] == 'Y')
        // 	$result .= '<script type="text/javascript">BX.ready(function(){jsStartMenu.PreloadMenu(\''.CUtil::JSEscape($href.($params<>""? "?".$params:"")).'\');});</script>';
        //show script to play sound
        $result .= $adminPage->ShowSound();
        return $result;
    }
Example #4
0
<?php

// define("START_EXEC_EPILOG_BEFORE_1", microtime());
$GLOBALS["BX_STATE"] = "EB";
if ($USER->IsAuthorized() && (!defined("BX_AUTH_FORM") || !BX_AUTH_FORM)) {
    $hkInstance = CHotKeys::getInstance();
    $Execs = $hkInstance->GetCodeByClassName("Global");
    echo $hkInstance->PrintJSExecs($Execs);
    echo $hkInstance->SetTitle("Global");
    $Execs = $hkInstance->GetCodeByUrl($_SERVER["REQUEST_URI"]);
    echo $hkInstance->PrintJSExecs($Execs);
    echo $hkInstance->PrintPhpToJSVars();
    echo CAdminInformer::PrintHtml();
}
if (!defined('BX_PUBLIC_MODE') || BX_PUBLIC_MODE != 1) {
    if (!defined("BX_AUTH_FORM") || !BX_AUTH_FORM) {
        require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/interface/epilog_main_admin.php";
    } else {
        require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/interface/epilog_auth_admin.php";
    }
} else {
    require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/interface/epilog_jspopup_admin.php";
}
Example #5
0
 function PrintHKGlobalUrlVar()
 {
     return CHotKeys::GetInstance()->PrintGlobalUrlVar();
 }
Example #6
0
	public static function GetInstance()
	{
		if (!isset(self::$instance))
		{
			$c = __CLASS__;
			self::$instance = new $c;
			self::$codes = new CHotKeysCode;
			self::$optUse = COption::GetOptionString('main', "use_hot_keys", "Y") == "Y";
			self::$ExpImpFileName = "hk_export_".$_SERVER['HTTP_HOST'].".srl";

		}

		return self::$instance;
	}
Example #7
0
);
	</script>
	<div class="bx-gadgets-header"><?php 
    if (array_key_exists($arParams["DESKTOP_PAGE"], $arResult["DESKTOPS"])) {
        $title = strlen($arResult["DESKTOPS"][$arParams["DESKTOP_PAGE"]]["NAME"]) > 0 ? $arResult["DESKTOPS"][$arParams["DESKTOP_PAGE"]]["NAME"] : str_replace("#NUM#", intval($arParams["DESKTOP_PAGE"] + 1), GetMessage("CMDESKTOP_TDEF_ADMIN_TITLE_DEFAULT"));
        $title = str_replace("#TITLE#", $title, GetMessage("CMDESKTOP_TDEF_ADMIN_TITLE"));
        ?>
<h1 id="adm-title" class="adm-title" id=""><?php 
        echo htmlspecialcharsbx($title);
        ?>
</h1><?php 
    }
    ?>
<div class="bx-gadgets-buttons"><?php 
    $mContext->Button($arGadgetsButton, CHotKeys::getInstance());
    $mContext->Button($arSettingsButton, CHotKeys::getInstance());
    ?>
</div>
	</div>
	<?php 
}
?>
<form action="<?php 
echo POST_FORM_ACTION_URI;
?>
" method="POST" id="GDHolderForm_<?php 
echo $arResult["ID"];
?>
">
<?php 
echo bitrix_sessid_post();
Example #8
0
 function SetHotKeys()
 {
     $arHK = array("B" => "Alt+66", "I" => "Alt+73", "U" => "Alt+85", "QUOTE" => "Alt+81", "CODE" => "Alt+67", "TRANSLIT" => "Alt+84");
     $hkc = new CHotKeysCode();
     foreach ($arHK as $s => $hk) {
         $className = "TICKET_EDIT_{$s}";
         $arHKC = array(CLASS_NAME => $className, CODE => "var d=document.getElementById('{$s}'); if (d) d.click();", NAME => " ({$id})", TITLE_OBJ => "TICKET_EDIT_" . $s . "_T", IS_CUSTOM => "1");
         $objK = $hkc->GetList(array(), array("CLASS_NAME" => $className));
         if ($arK = $objK->Fetch()) {
             $hkc->Update($arK["ID"], $arHKC);
         } else {
             $id = $hkc->Add($arHKC);
             if ($id > 0) {
                 $result = CHotKeys::GetInstance()->AddDefaultKeyToAll($id, $hk);
             }
         }
     }
 }
Example #9
0
	function EndContent()
	{
		if ($this->bContentStarted)
		{
			echo '</form>'."\r\n";

			$hkInstance = CHotKeys::getInstance();
			$Execs = $hkInstance->GetCodeByClassName("CDialog");
			echo $hkInstance->PrintJSExecs($Execs, "", true, true);

			if ($this->bContentBuffered)
			{
?></div><script type="text/javascript">BX.ready(function() {<?php 
echo $this->jsPopup;
?>
.SwapContent(BX('<?echo $this->cont_id?>'))});</script><?
			}
			$this->bContentStarted = false;
		}
	}
Example #10
0
    function End()
    {
        $hkInst = CHotKeys::getInstance();
        if (!$this->bButtons) {
            while ($this->tabIndex < count($this->tabs)) {
                $this->BeginNextTab();
            }
            //end previous tab
            $this->EndTab();
            echo '<div class="adm-detail-content-btns-wrap"><div class="adm-detail-content-btns adm-detail-content-btns-empty"></div></div>';
        } elseif (!$this->bPublicMode) {
            echo '</div></div>';
        }
        if (!$this->bPublicMode) {
            echo '
</div></div>
';
        }
        $Execs = $hkInst->GetCodeByClassName("CAdminSubForm");
        echo $hkInst->PrintJSExecs($Execs, $this->name);
        echo '

<input type="hidden" id="' . $this->name . '_active_tab" name="' . $this->name . '_active_tab" value="' . htmlspecialcharsbx($this->selectedTab) . '">

<script type="text/javascript">';
        $s = "";
        foreach ($this->tabs as $tab) {
            $s .= ($s != "" ? ", " : "") . "{" . "'DIV': '" . $tab["DIV"] . "' " . ($tab["ONSELECT"] != "" ? ", 'ONSELECT': '" . CUtil::JSEscape($tab["ONSELECT"]) . "'" : "") . "}";
        }
        echo 'var ' . $this->name . ' = new BX.adminSubTabControl("' . $this->name . '", "' . $this->unique_name . '", [' . $s . '], "' . $this->GetListUrl(true) . '",' . $this->GetListPostParams(true, true) . ');';
        if (!$this->bPublicMode) {
            $aEditOpt = CUserOptions::GetOption("edit", $this->unique_name, array());
            $aTabOpt = CUserOptions::GetOption("edit", 'admin_tabs', array());
            if ($this->bCanExpand && count($this->tabs) > 1) {
                if ($aEditOpt["expand"] == "on") {
                    echo '
' . $this->name . '.ToggleTabs();';
                }
            }
            if ($aTabOpt["fix_top"] == "off" && $aEditOpt["expand"] != "on") {
                echo '
' . $this->name . '.ToggleFix(\'top\');';
            }
            if ($aTabOpt["fix_bottom"] == "off") {
                echo '
' . $this->name . '.ToggleFix(\'bottom\');';
            }
        } else {
            echo 'window.' . $this->name . '.setPublicMode(true); ';
        }
        echo '
</script>
';
        if ($this->bPublicModeBuffer) {
            echo '</div>';
            echo '<script type="text/javascript">BX.ready(function() {' . $this->publicObject . '.SwapContent(\'' . $this->publicModeBuffer_id . '\');});</script>';
        }
    }