예제 #1
0
function JSPopupRedirectHandler(&$url, $skip_security_check)
{
    $a = new CAutoSave();
    $a->Reset();
    if (preg_match("#^/bitrix/admin/#", $url)) {
        ob_end_clean();
        echo '<script type="text/javascript">top.BX.WindowManager.Get().Close(); ' . (!$_REQUEST['subdialog'] ? 'top.BX.reload(true);' : '') . '</script>';
        die;
    } else {
        ob_end_clean();
        echo '<script type="text/javascript">top.BX.WindowManager.Get().Close(); ' . (!$_REQUEST['subdialog'] ? 'top.BX.reload(\'' . CUtil::JSEscape($url) . '\', true);' : '') . '</script>';
        die;
    }
}
예제 #2
0
	function CAdminTabControl($name, $tabs, $bCanExpand = true, $bDenyAutoSave = false)
	{
		/** @global CMain $APPLICATION */
		global $APPLICATION;

		//array(array("DIV"=>"", "TAB"=>"", "ICON"=>, "TITLE"=>"", "ONSELECT"=>"javascript"), ...)
		if(is_array($tabs))
		{
			$this->tabs = $tabs;
		}
		$this->name = $name;
		$this->unique_name = $name."_".md5($APPLICATION->GetCurPage());

		$this->bPublicMode = defined('FX_PUBLIC_MODE') && FX_PUBLIC_MODE == 1;
		$this->bCanExpand = !$this->bPublicMode && (bool)$bCanExpand;

		$this->SetSelectedTab();

		if (!$bDenyAutoSave && CAutoSave::Allowed())
		{
			$this->AUTOSAVE = new CAutoSave();
		}
	}
예제 #3
0
파일: template.php 프로젝트: vim84/b-markt
',
	activeTab : '<?php 
        echo $bVarsFromForm || $arParams["ID"] > 0 ? $activeTab : '';
        ?>
',
	text : '<?php 
        echo CUtil::JSEscape($formParams["TEXT"]["VALUE"]);
        ?>
'
});
</script>
<?php 
        if (COption::GetOptionString("blog", "use_autosave", "Y") == "Y") {
            $dynamicArea = new \Bitrix\Main\Page\FrameStatic("post-autosave");
            $dynamicArea->startDynamicArea();
            $as = new CAutoSave();
            $as->Init(false);
            $dynamicArea->finishDynamicArea();
        }
        $arButtons = array(array("NAME" => "save", "TEXT" => GetMessage("BLOG_BUTTON_SEND"), "CLICK" => "submitBlogPostForm();"));
        if ($arParams["MICROBLOG"] != "Y") {
            $arButtons[] = array("NAME" => "draft", "TEXT" => GetMessage("BLOG_BUTTON_DRAFT"));
        } else {
            $arButtons[] = array("NAME" => "cancel", "TEXT" => GetMessage("BLOG_BUTTON_CANCEL"), "CLICK" => "window.SBPETabs.getInstance().collapse()", "CLEAR_CANCEL" => "Y");
        }
        ?>
<div class="feed-buttons-block" id="feed-add-buttons-block<?php 
        echo $arParams["FORM_ID"];
        ?>
" style="display:none;"><?php 
        foreach ($arButtons as $val) {
예제 #4
0
$strWarning = "";

$io = CBXVirtualIo::GetInstance();

$bVarsFromForm = false;
if (strlen($filename) > 0 && ($mess = CFileMan::CheckFileName($filename)) !== true)
{
	$filename2 = $filename;
	$filename = '';
	$strWarning = $mess;
	$bVarsFromForm = true;
}

if (CAutoSave::Allowed())
	$AUTOSAVE = new CAutoSave();

$path = $io->CombinePath("/", urldecode($path));
$site = CFileMan::__CheckSite($site);
if(!$site)
	$site = CSite::GetSiteByFullPath($_SERVER["DOCUMENT_ROOT"].$path);

$DOC_ROOT = CSite::GetSiteDocRoot($site);
$abs_path = $io->CombinePath($DOC_ROOT, $path);

if(strlen($new)>0 && strlen($filename)>0)
	$abs_path = $io->CombinePath($abs_path, $filename);

if((strlen($new) <= 0 || strlen($filename)<=0) && !$io->FileExists($abs_path))
{
	$p = strrpos($path, "/");
예제 #5
0
파일: undo.php 프로젝트: ASDAFF/bxApiDocs
	public static function Allowed()
	{
		if (!$GLOBALS['USER']->IsAuthorized())
			return false;

		if (self::$bAllowed == null)
		{
			$arOpt = CUserOptions::GetOption('global', 'settings');
			self::$bAllowed = $arOpt['autosave'] != 'N' && $GLOBALS['APPLICATION']->GetCurPage() != '/bitrix/admin/update_system.php';
		}

		return self::$bAllowed;
	}
예제 #6
0
	$p = strrpos($path, "/");
	if($p!==false)
	{
		$new = "Y";
		$filename = substr($path, $p+1);
		$path = substr($path, 0, $p);
	}
}

$NEW_ROW_CNT = 1;

$arParsedPath = CFileMan::ParsePath(Array($site, $path), true, false, "", false);
$isScriptExt = in_array(CFileman::GetFileExtension($path), CFileMan::GetScriptFileExt());

if (CAutoSave::Allowed())
	$AUTOSAVE = new CAutoSave();

//Check access to file
if(
	(
		strlen($new) > 0 &&
		!(
			$USER->CanDoOperation('fileman_admin_files') &&
			$USER->CanDoFileOperation('fm_create_new_file', $arPath)
		)
	)
	||
	(
		strlen($new) < 0 &&
		!(
			$USER->CanDoOperation('fileman_edit_existent_files') &&
예제 #7
0
	function CAdminTabControl($name, $tabs, $bCanExpand = true, $bDenyAutoSave = false)
	{
		/** @global CMain $APPLICATION */
		global $APPLICATION;

		//array(array("DIV"=>"", "TAB"=>"", "ICON"=>, "TITLE"=>"", "ONSELECT"=>"javascript"), ...)
		$this->tabs = $tabs;
		$this->name = $name;
		$this->unique_name = $name."_".md5($APPLICATION->GetCurPage());

		$this->bPublicMode = defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1;
		$this->bCanExpand = !$this->bPublicMode && (bool)$bCanExpand;

		if(isset($_REQUEST[$this->name."_active_tab"]))
			$this->selectedTab = $_REQUEST[$this->name."_active_tab"];
		else
			$this->selectedTab = $tabs[0]["DIV"];

		if (!$bDenyAutoSave && CAutoSave::Allowed())
		{
			$this->AUTOSAVE = new CAutoSave();
		}
	}
예제 #8
0
             }
         }
     }
     if ($arParams["IS_REST"] != "Y") {
         if (strlen($_POST["apply"]) <= 0) {
             if ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_DRAFT || strlen($_POST["draft"]) > 0) {
                 $redirectUrl = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_DRAFT"], array("user_id" => $arBlog["OWNER_ID"]));
             } elseif ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_READY) {
                 $redirectUrl = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("post_id" => $newID, "user_id" => $arBlog["OWNER_ID"])) . "?moder=y";
             } else {
                 $redirectUrl = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("user_id" => $arBlog["OWNER_ID"]));
             }
         } else {
             $redirectUrl = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("post_id" => $newID, "user_id" => $arBlog["OWNER_ID"]));
         }
         $as = new CAutoSave();
         // It is necessary to clear autosave buffer
         $as->Reset();
         LocalRedirect($redirectUrl);
     } else {
         return $newID;
     }
 } else {
     $GLOBALS["DB"]->Rollback();
     if (strlen($arResult["ERROR_MESSAGE"]) <= 0) {
         if ($ex = $APPLICATION->GetException()) {
             $arResult["ERROR_MESSAGE"] = $ex->GetString();
         } else {
             $arResult["ERROR_MESSAGE"] = "Error saving data to database.<br />";
         }
     }
예제 #9
0
<?php

define("STOP_STATISTICS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
if (!$USER->IsAuthorized() || !check_bitrix_sessid()) {
    die;
}
CUtil::JSPostUnescape();
$arFormData = $_REQUEST['form_data'];
$AUTOSAVE = new CAutoSave();
if ($AUTOSAVE->Set($arFormData)) {
    echo time() + CTimeZone::GetOffset();
} else {
    echo 'FAILED';
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";