Exemplo n.º 1
0
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/classes/general/sticker.php";
if (!$USER->CanDoOperation('fileman_view_file_structure') || !$USER->CanDoOperation('fileman_edit_existent_files') || !CSticker::CanDoOperation('sticker_view')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/include.php";
if (CModule::IncludeModule("compression")) {
    CCompress::Disable2048Spaces();
}
$action = isset($_REQUEST['sticker_action']) ? $_REQUEST['sticker_action'] : false;
if (!check_bitrix_sessid()) {
    die('<!--BX_STICKER_DUBLICATE_ACTION_REQUEST' . bitrix_sessid() . '-->');
}
CUtil::JSPostUnEscape();
if ($action == 'show_stickers' || $action == 'hide_stickers') {
    // Save user choise
    CSticker::SetBShowStickers($action == 'show_stickers');
    if ($_REQUEST['b_inited'] == "N") {
        $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 
    }
    ?>