コード例 #1
0
function GetProperties($componentName, $curTemplate = '')
{
	$stid = (isset($_GET['stid'])) ? $_GET['stid'] : '';
	$curTemplate = (!$curTemplate || $curTemplate == '.default') ? '' : CUtil::JSEscape($curTemplate);
	$arTemplates = CComponentUtil::GetTemplatesList($componentName, $stid);
	$arCurVals = isset($_POST['curval']) ? CEditorUtils::UnJSEscapeArray($_POST['curval']) : Array();
	$loadHelp = (isset($_GET['loadhelp']) && $_GET['loadhelp']=="Y") ? true : false;

	if (is_array($arTemplates))
	{
		foreach ($arTemplates as $k => $arTemplate)
		{
			push2arComp2Templates($arTemplate['NAME'], $arTemplate['TEMPLATE'], $arTemplate['TITLE'], $arTemplate['DESCRIPTION']);
			$tName = (!$arTemplate['NAME'] || $arTemplate['NAME'] == '.default') ? '' : $arTemplate['NAME'];
			if ($tName == $curTemplate)
			{
				$arTemplateProps = CComponentUtil::GetTemplateProps($componentName, $arTemplate['NAME'], $stid, $arCurVals);
				if (is_array($arTemplateProps))
					foreach ($arTemplateProps as $k => $arTemplateProp)
						push2arComp2TemplateProps($componentName,$k,$arTemplateProp);
			}
		}
	}

	$arProps = CComponentUtil::GetComponentProps($componentName, $arCurVals);
	if ($loadHelp && is_array($arProps['PARAMETERS']))
		fetchPropsHelp($componentName);

	$bGroup = (isset($arProps['GROUPS']) && count($arProps['GROUPS']) > 0);
	if (is_array($arProps['GROUPS']))
	{
		foreach ($arProps['GROUPS'] as $k => $arGroup)
		{
			?>window.arComp2Groups.push({name: '<?php 
echo CUtil::JSEscape($k);
?>
', title: '<?php 
echo CUtil::JSEscape($arGroup['NAME']);
?>
'});<?
		}
	}

	if (is_array($arProps['PARAMETERS']))
		foreach ($arProps['PARAMETERS'] as $k => $arParam)
			push2arComp2Props($k, $arParam, (($bGroup) ? $arProps['GROUPS'] : false));
}
コード例 #2
0
ファイル: editor_utils.php プロジェクト: Satariall/izurit
 function UnJSEscapeArray($ar)
 {
     //$APPLICATION->UnJSEscape
     foreach ($ar as $key => $val) {
         if (is_array($val)) {
             $ar[$key] = CEditorUtils::UnJSEscapeArray($val);
         } elseif (is_string($val)) {
             $ar[$key] = $GLOBALS['APPLICATION']->UnJSEscape($val);
         }
     }
     return $ar;
 }
コード例 #3
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/prolog.php";
if (!isset($_POST['name']) && !isset($_POST['source'])) {
    // Some bogus call
    die;
}
if (!($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_edit_existent_files'))) {
    die('BX_EDITOR_ERROR: ACCESS_DENIED');
}
if (!check_bitrix_sessid()) {
    $APPLICATION->RestartBuffer();
    die('<!--BX_EDITOR_ERROR_SESSION_EXPIRED' . bitrix_sessid() . '-->');
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/include.php";
CEditorUtils::RenderComponents(array('name' => isset($_POST['name']) ? $_POST['name'] : false, 'template' => isset($_POST['template']) ? $_POST['template'] : '', 'params' => isset($_POST['params']) ? CEditorUtils::UnJSEscapeArray($_POST['params']) : false, 'source' => isset($_POST['source']) ? $_POST['source'] : false, 'siteTemplateId' => isset($_POST['stid']) ? $_POST['stid'] : false));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_after.php";
コード例 #4
0
            echo "\n";
        }
        ?>
window.arComp2TemplateProps.push(tempAr2);
<?php 
    }
    ?>
</script><?php 
    //__GetTemplateProps($_GET['cname'], $_GET['tname'], $_GET['stid'],$arCurrentValues);
} else {
    if (isset($_GET['stid']) && isset($_GET['mode']) && $_GET['mode'] == 'list') {
        ?>
<script>
window.arComp2TemplateLists = {};
<?php 
        $arComponents = isset($_POST['complist']) ? CEditorUtils::UnJSEscapeArray($_POST['complist']) : array();
        $len = count($arComponents);
        for ($i = 0; $i < $len; $i++) {
            $cName = $arComponents[$i];
            $arTemplates = CComponentUtil::GetTemplatesList($cName, $siteTemplate);
            $tempLen = count($arTemplates);
            ?>
window.arComp2TemplateLists['<?php 
            echo CUtil::JSEscape($cName);
            ?>
'] = {};
		<?php 
            for ($j = 0; $j < $tempLen; $j++) {
                ?>

window.arComp2TemplateLists['<?php 
コード例 #5
0
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/fileman/prolog.php");

if (!isset($_POST['name']) && !isset($_POST['source'])) // Some bogus call
	die();

if (!($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_edit_existent_files')))
	die('FX_EDITOR_ERROR: ACCESS_DENIED');

if(!check_freetrix_sessid())
{
	$APPLICATION->RestartBuffer();
	die('<!--FX_EDITOR_ERROR_SESSION_EXPIRED'.freetrix_sessid().'-->');
}

require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/fileman/include.php");

CEditorUtils::RenderComponents(array(
	'name' => isset($_POST['name']) ? $_POST['name'] : false,
	'template' => isset($_POST['template']) ? $_POST['template'] : '',
	'params' => isset($_POST['params']) ? CEditorUtils::UnJSEscapeArray($_POST['params']) : false,
	'source' => isset($_POST['source']) ? $_POST['source'] : false,
	'siteTemplateId' => isset($_POST['stid']) ? $_POST['stid'] : false
));

require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin_after.php");
?>