$Stickers = CSticker::GetList(array('arFilter' => array('USER_ID' => $USER->GetId(), 'PAGE_URL' => $_POST['pageUrl'], 'CLOSED' => 'N', 'DELETED' => 'N', 'SITE_ID' => $_REQUEST['site_id']))); } ?> <script> <?php if ($_REQUEST['b_inited'] == "N") { ?> window.__bxst_result.stickers = <?php echo CUtil::PhpToJSObject($Stickers); ?> ; <?php } ?> window.__bxst_result.show = <?php echo CSticker::GetBShowStickers() ? 'true' : 'false'; ?> ; </script> <?php } elseif ($action == 'load_lhe') { $LHE = new CLightHTMLEditor(); $LHE->Show(array('id' => 'LHEBxStickers', 'width' => '230', 'height' => '100', 'inputId' => 'stickers_ed', 'content' => 'Text', 'bUseFileDialogs' => false, 'bUseMedialib' => false, 'toolbarConfig' => array('Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'ForeColor', 'InsertOrderedList', 'InsertUnorderedList', 'CreateLink'), 'jsObjName' => 'oLHESticker', 'bInitByJS' => true, 'BBCode' => true, 'bSaveOnBlur' => false, 'documentCSS' => "\nbody{padding:0 5px 0 20px !important; font-family:Verdana !important; font-size:12px !important;}\n.bxst-title{font-family:Verdana!important; font-size:11px !important; margin:0 0 0 -7px !important;line-height:18px!important; color: #727272!important;}\nbody.bxst-yellow{background: #FFFCB3!important;}\nbody.bxst-green{background: #DBFCCD!important;}\nbody.bxst-blue{background: #DCE7F7!important;}\nbody.bxst-red{background: #FCDFDF!important;}\nbody.bxst-purple{background: #F6DAF8!important;}\nbody.bxst-gray{background: #F5F5F5!important;}\nbody.bxst-yellow .bxst-title{color: #7F7E59!important;}\nbody.bxst-green .bxst-title{color: #6D7E66!important;}\nbody.bxst-blue .bxst-title{color: #6E737B!important;}\nbody.bxst-red .bxst-title{color: #7E6F6F!important;}\nbody.bxst-purple .bxst-title{color: #7B6D7C!important;}\nbody.bxst-gray .bxst-title{color: #7A7A7A!important;}")); } elseif ($action == 'get_cur_date') { echo FormatDate("j F G:i", time() + CTimeZone::GetOffset()); } elseif ($action == 'save_sticker') { if (isset($_POST['marker']['adjust'])) { $markerAdjust = serialize($_POST['marker']['adjust']); } else { $markerAdjust = ""; }
function OnPanelCreate() { global $APPLICATION, $REQUEST_URI; if ($APPLICATION->GetGroupRight("fileman") <= "D") { return; } $cur_page = $APPLICATION->GetCurPage(true); $cur_dir = $APPLICATION->GetCurDir(); //access to curent page $page_permission = $APPLICATION->GetFileAccessPermission($cur_page); // access to current directory $sect_permission = $APPLICATION->GetFileAccessPermission($cur_dir); $main_sort = 100; $full_src = ""; $default_edit = COption::GetOptionString("fileman", "default_edit", "html"); if ($default_edit == "php") { $editor_type = "file"; $full_src = "&full_src=Y"; } elseif ($default_edit == "text") { $editor_type = "file"; } else { $editor_type = "html"; } $aMenuItems = array('create' => array(), 'create_section' => array(), 'edit' => array(), 'edit_section' => array()); if ($sect_permission >= "W") { // New page $href = "/bitrix/admin/fileman_" . $editor_type . "_edit.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&path=" . UrlEncode($APPLICATION->GetCurDir()) . "&new=Y&templateID=" . urlencode(SITE_TEMPLATE_ID) . "&back_url=" . UrlEncode($REQUEST_URI); $APPLICATION->AddPanelButtonMenu('create', array("SEPARATOR" => true, "SORT" => 99)); $APPLICATION->AddPanelButtonMenu('create', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_new_page_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')", "SORT" => 100)); //New folder $href = "/bitrix/admin/fileman_newfolder.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&path=" . UrlEncode($APPLICATION->GetCurDir()) . "&back_url=" . UrlEncode($REQUEST_URI); $APPLICATION->AddPanelButtonMenu('create_section', array("SEPARATOR" => true, "SORT" => 99)); $APPLICATION->AddPanelButtonMenu('create_section', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_new_folder_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')")); } // Edit page if ($page_permission >= "W") { $href = "/bitrix/admin/fileman_" . $editor_type . "_edit.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&templateID=" . urlencode(SITE_TEMPLATE_ID) . $full_src . "&path=" . UrlEncode(isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "" ? $_SERVER["REAL_FILE_PATH"] : $cur_page) . "&back_url=" . UrlEncode($REQUEST_URI); $APPLICATION->AddPanelButtonMenu('edit', array("SEPARATOR" => true, "SORT" => 99)); $APPLICATION->AddPanelButtonMenu('edit', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_edit_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')", "SORT" => 100)); } // Folder properties $alt = GetMessage("FILEMAN_FOLDER_PROPS"); if ($sect_permission >= "W") { $href = "/bitrix/admin/fileman_folder.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&path=" . UrlEncode($APPLICATION->GetCurDir()) . "&back_url=" . UrlEncode($REQUEST_URI); $APPLICATION->AddPanelButtonMenu('edit_section', array("SEPARATOR" => true, "SORT" => 99)); $APPLICATION->AddPanelButtonMenu('edit_section', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_folder_prop_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')", "SORT" => 100)); } //Sticker buttons require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/classes/general/sticker.php"; if (CSticker::CanDoOperation('sticker_view')) { $useHotKeys = COption::GetOptionString('fileman', "stickers_use_hotkeys", "Y") == "Y"; $arMenu = array(); if (CSticker::CanDoOperation('sticker_new')) { $arMenu[] = array("TEXT" => '<div style="float: left; margin: 0 50px 0 0;">' . GetMessage("FMST_PANEL_STICKER_ADD") . '</div>' . ($useHotKeys ? '<div style="float: right;"><nobr>Ctrl+Shift+S</nobr></div>' : ''), "TITLE" => GetMessage("FMST_PANEL_STICKER_ADD_TITLE"), "ICON" => "", "ACTION" => CSticker::GetScriptStr('add'), "DEFAULT" => true, "HK_ID" => "FMST_PANEL_STICKER_ADD"); $arMenu[] = array("SEPARATOR" => true); } $curPageCount = CSticker::GetCurPageCount(); $arMenu[] = array("ID" => "bxst-show-sticker-icon", "TEXT" => '<div style="float: left; margin: 0 50px 0 0;">' . GetMessage("FMST_PANEL_STICKERS_SHOW", array("#COUNT#" => $curPageCount)) . '</div>' . ($useHotKeys ? '<div style="float:right;"><nobr>Ctrl+Shift+X</nobr></div>' : ''), "TITLE" => GetMessage("FMST_PANEL_STICKERS_SHOW_TITLE"), "ICON" => CSticker::GetBShowStickers() ? " checked" : "", "ACTION" => CSticker::GetScriptStr('show'), "HK_ID" => "FMST_PANEL_STICKERS_SHOW"); $arMenu[] = array("TEXT" => '<div style="float: left; margin: 0 50px 0 0;">' . GetMessage("FMST_PANEL_CUR_STICKER_LIST") . '</div>' . ($useHotKeys ? '<div style="float: right;"><nobr>Ctrl+Shift+L</nobr></div>' : ''), "TITLE" => GetMessage("FMST_PANEL_CUR_STICKER_LIST_TITLE"), "ICON" => "", "ACTION" => CSticker::GetScriptStr('list_cur'), "HK_ID" => "FMST_PANEL_CUR_STICKER_LIST"); $arMenu[] = array("TEXT" => GetMessage("FMST_PANEL_ALL_STICKER_LIST"), "TITLE" => GetMessage("FMST_PANEL_ALL_STICKER_LIST_TITLE"), "ICON" => "", "ACTION" => CSticker::GetScriptStr('list_all'), "HK_ID" => "FMST_PANEL_ALL_STICKER_LIST"); $APPLICATION->AddPanelButton(array("HREF" => 'javascript:' . (CSticker::CanDoOperation('sticker_edit') ? CSticker::GetScriptStr('add') : CSticker::GetScriptStr('show')), "TYPE" => "SMALL", "ICON" => "bx-panel-small-stickers-icon", "TEXT" => GetMessage("FMST_PANEL_STICKERS_TOOLTIP_TITLE"), "MAIN_SORT" => "1000", "SORT" => 100, "MENU" => $arMenu, "HK_ID" => "FMST_PANEL_STICKERS", "HINT" => array("TITLE" => CSticker::CanDoOperation('sticker_edit') ? GetMessage("FMST_PANEL_STICKERS_TOOLTIP_TITLE") : GetMessage("FMST_PANEL_STICKERS_SHOW_1"), "TEXT" => CSticker::CanDoOperation('sticker_edit') ? GetMessage("FMST_PANEL_STICKERS_TOOLTIP") . ($useHotKeys ? " (Ctrl+Shift+S)" : "") : GetMessage("FMST_PANEL_STICKERS_ALT") . ($useHotKeys ? " (Ctrl+Shift+X)" : "")))); CSticker::Init(array('curPageCount' => $curPageCount)); } }
function Init($Params = array()) { global $APPLICATION, $USER; if (!CSticker::CanDoOperation('sticker_view')) { return; } // Dectect - show stickers or No $bGetStickers = CSticker::GetBShowStickers(); $Stickers = array(); if ($bGetStickers) { $Stickers = CSticker::GetList(array('arFilter' => array('USER_ID' => $USER->GetId(), 'PAGE_URL' => $APPLICATION->GetCurPage(), 'CLOSED' => 'N', 'DELETED' => 'N', 'SITE_ID' => SITE_ID))); } else { $Stickers = array(); } $curPageCount = isset($Params['curPageCount']) ? $Params['curPageCount'] : CSticker::GetCurPageCount(); CSticker::InitJS(array('bInit' => $bGetStickers, 'stickers' => $Stickers, 'curPageCount' => $curPageCount)); }