- Модуль: fileman
- Путь к файлу: ~/bitrix/modules/fileman/classes/general/sticker.php
- Класс: CSticker
- Вызов: CSticker::InitJS
static function InitJS($Params)
{
global $APPLICATION, $USER;
CUtil::InitJSCore(array('window', 'ajax', 'date'));
$APPLICATION->AddHeadScript('/bitrix/js/fileman/sticker.js', true);
$APPLICATION->SetAdditionalCSS('/bitrix/js/fileman/sticker.css', true);
$pageUrl = $APPLICATION->GetCurPage();
$pageTitle = $APPLICATION->GetTitle();
if ($pageTitle == '')
$pageTitle = $pageUrl;
$listSize = CUtil::GetPopupSize("bx_sticker_list_resize_id", array("width" => 800, "height" => 450));
$size = explode("_", COption::GetOptionString("fileman", "stickers_start_sizes", "350_200"));
$min_width = 280;
$min_height = 160;
$JSConfig = array(
"access" => CSticker::CanDoOperation('sticker_edit') ? "W" : "R",
"sessid_get" => bitrix_sessid_get(),
"start_width" => $size[0] > $min_width ? $size[0] : $min_width,
"start_height" => $size[1] > $min_height ? $size[1] : $min_height,
"min_width" => $min_width,
"min_height" => $min_height,
"start_color" => CUserOptions::GetOption('fileman', "stickers_last_color", 0),
"zIndex" => 5000,
"curUserName" => CSticker::GetUserName(),
"curUserId" => $USER->GetId(),
"pageUrl" => $pageUrl,
"pageTitle" => $pageTitle,
"bShowStickers" => $Params['bInit'],
"listWidth" => $listSize['width'],
"listHeight" => $listSize['height'],
"listNaviSize" => CUserOptions::GetOption('fileman', "stickers_navi_size", 5),
"useHotkeys" => COption::GetOptionString('fileman', "stickers_use_hotkeys", "Y") == "Y",
"filterParams" => CSticker::GetFilterParams(),
"bHideBottom" => COption::GetOptionString("fileman", "stickers_hide_bottom", "Y") == "Y",
"focusOnSticker" => isset($_GET['show_sticker'])? intval($_GET['show_sticker']): 0,
"strDate" => FormatDate("j F", time()+CTimeZone::GetOffset()),
"curPageCount" => $Params['curPageCount'],
"site_id" => SITE_ID
);
if (!is_array($Params['stickers']))
$Params['stickers'] = array();
self::$Params = array("JSCONFIG" => $JSConfig, "STICKERS" => $Params['stickers']);
}