protected function genEditHTML()
 {
     if (\CModule::IncludeModule("fileman")) {
         ob_start();
         $codeType = $this->code . '_TEXT_TYPE';
         /** @var string $className Имя класса без неймспейса */
         $className = $this->getEntityShortName();
         $entityClass = $this->entityName;
         $modelPk = $entityClass::getEntity()->getPrimary();
         $id = isset($this->data[$modelPk]) ? $this->data[$modelPk] : false;
         $bxCode = $this->code . '_' . $className;
         $bxCodeType = $codeType . '_' . $className;
         if ($this->forceMultiple) {
             if ($id) {
                 $bxCode .= '_' . $id;
                 $bxCodeType .= '_' . $id;
             } else {
                 $bxCode .= '_new_';
                 $bxCodeType .= '_new_';
             }
         }
         // TODO Избавиться от данного костыля
         if ($_REQUEST[$bxCode]) {
             $this->data[$this->code] = $_REQUEST[$bxCode];
         }
         \CFileMan::AddHTMLEditorFrame($bxCode, $this->data[$this->code], $bxCodeType, $this->data[$codeType], array('width' => $this->getSettings('WIDTH'), 'height' => $this->getSettings('HEIGHT')));
         $defaultEditors = array("text" => "text", "html" => "html", "editor" => "editor");
         $editors = $this->getSettings('EDITORS');
         $defaultEditor = strtolower($this->getSettings('DEFAULT_EDITOR'));
         $contentType = $this->data[$codeType];
         $defaultEditor = isset($contentType) && $contentType == "text" ? "text" : $defaultEditor;
         $defaultEditor = isset($contentType) && $contentType == "html" ? "editor" : $defaultEditor;
         if (count($editors) > 1) {
             foreach ($editors as &$editor) {
                 $editor = strtolower($editor);
                 if (isset($defaultEditors[$editor])) {
                     unset($defaultEditors[$editor]);
                 }
             }
         }
         $script = '<script type="text/javascript">';
         $script .= '$(document).ready(function() {';
         foreach ($defaultEditors as $editor) {
             $script .= '$("#bxed_' . $bxCode . '_' . $editor . '").parent().hide();';
         }
         $script .= '$("#bxed_' . $bxCode . '_' . $defaultEditor . '").click();';
         $script .= 'setTimeout(function() {$("#bxed_' . $bxCode . '_' . $defaultEditor . '").click(); }, 500);';
         $script .= "});";
         $script .= '</script>';
         echo $script;
         $html = ob_get_clean();
         return $html;
     } else {
         return parent::genEditHTML();
     }
 }
Beispiel #2
0
</label></td>
		<td><?CFileMan::AddHTMLEditorFrame('smartpolis_message_before_button', $settings->get('smartpolis_message_before_button'), 'smartpolis_message_before_button_type', 'html')?></td>
	</tr>
	<tr>
		<td width="30%"><label for="smartpolis_header_before_form"><?php 
echo GetMessage('SPM_OPTION_H_BF');
?>
</label></td>
		<td><?CFileMan::AddHTMLEditorFrame('smartpolis_header_before_form', $settings->get('smartpolis_header_before_form'), 'smartpolis_header_before_form_type', 'html')?></td>
	</tr>
	<tr>
		<td width="30%"><label for="smartpolis_message_before_form"><?php 
echo GetMessage('SPM_OPTION_M_BF');
?>
</label></td>
		<td><?CFileMan::AddHTMLEditorFrame('smartpolis_message_before_form', $settings->get('smartpolis_message_before_form'), 'smartpolis_message_before_form_type', 'html')?></td>
	</tr>
<?

$companies = $settings->get('smartpolis_companies');

$tabControl->BeginNextTab();
?>
	<tr>
		<td colspan="2">
			<?if (count($companies)) {?>
				<table class="internal">
					<tbody>
						<tr class="heading">
							<td><?php 
echo GetMessage('SPM_TABLE_ACTIVE');
Beispiel #3
0
    }
}
?>
		</td>
	</tr>
	<tr class="heading">
		<td colspan="2"><?php 
echo GetMessage("VOTE_DESCR");
?>
</td>
	</tr>
	<tr>
		<td align="center" colspan="2">
<?php 
if (COption::GetOptionString("vote", "USE_HTML_EDIT") == "Y" && CModule::IncludeModule("fileman")) {
    CFileMan::AddHTMLEditorFrame("DESCRIPTION", $arVote["DESCRIPTION"], "DESCRIPTION_TYPE", $arVote["DESCRIPTION_TYPE"], array('height' => '200', 'width' => '100%'));
} else {
    ?>
			<input type="radio" name="DESCRIPTION_TYPE" id="DESCRIPTION_TYPE_TEXT" value="text" <?php 
    echo $arVote["DESCRIPTION_TYPE"] == "text" ? " checked" : "";
    ?>
 />
				<label for="DESCRIPTION_TYPE_TEXT">Text</label>&nbsp;/&nbsp;
			<input type="radio" name="DESCRIPTION_TYPE" id="DESCRIPTION_TYPE_HTML" value="html" <?php 
    echo $arVote["DESCRIPTION_TYPE"] == "html" ? " checked" : "";
    ?>
 />
				<label for="DESCRIPTION_TYPE_HTML">HTML</label><br />

			<textarea name="DESCRIPTION" style="width:100%" rows="23"><?php 
    echo $arVote["DESCRIPTION"];
$tabControl->BeginCustomField("DESCRIPTION", GetMessage("IBSEC_E_DESCRIPTION"), $arIBlock["FIELDS"]["SECTION_DESCRIPTION"]["IS_REQUIRED"] === "Y");
?>
	<tr class="heading">
		<td colspan="2"><?php 
echo $tabControl->GetCustomLabelHTML();
?>
</td>
	</tr>

	<?php 
if (COption::GetOptionString("iblock", "use_htmledit", "Y") == "Y" && $bFileman) {
    ?>
	<tr>
		<td colspan="2" align="center">
			<?php 
    CFileMan::AddHTMLEditorFrame("DESCRIPTION", $str_DESCRIPTION, "DESCRIPTION_TYPE", $str_DESCRIPTION_TYPE, array('height' => 450, 'width' => '100%'), "N", 0, "", "", $arIBlock["LID"]);
    ?>
		</td>
	</tr>
	<?php 
} else {
    ?>
	<tr>
		<td  ><?php 
    echo GetMessage("IBSEC_E_DESC_TYPE");
    ?>
</td>
		<td >
			<input type="radio" name="DESCRIPTION_TYPE" id="DESCRIPTION_TYPE_text" value="text"<?php 
    if ($str_DESCRIPTION_TYPE != "html") {
        echo " checked";
if ($ID > 0 && $PREV_ID > 0) {
    ?>
	<tr>
		<td colspan=2>
		<?php 
    echo getDiff($prev_ar["BODY"], $ar["BODY"]);
    ?>
		</td>
	</tr>
	<?php 
} elseif (COption::GetOptionString("workflow", "USE_HTML_EDIT", "Y") == "Y" && CModule::IncludeModule("fileman")) {
    ?>
	<tr>
		<td align="center" colspan="2"><?php 
    $bWithoutPHP = !$USER->IsAdmin();
    CFileMan::AddHTMLEditorFrame("BODY", $str_BODY, "BODY_TYPE", $str_BODY_TYPE, 300, "Y", $str_DOCUMENT_ID, GetDirPath($str_FILENAME), "", false, $bWithoutPHP);
    ?>
</td>
	</tr>
	<?php 
} else {
    ?>
	<tr>
		<td align="center" colspan="2"><?php 
    echo GetMessage("FLOW_TEXT");
    ?>
&nbsp;<?php 
    echo InputType("radio", "BODY_TYPE", "text", $str_BODY_TYPE, false);
    ?>
&nbsp;HTML&nbsp;<?php 
    echo InputType("radio", "BODY_TYPE", "html", $str_BODY_TYPE, false);
	</tr>
<?php 
    $tabControl->EndCustomField("ANSWERS");
    ?>

<?php 
    $tabControl->BeginNextFormTab();
    $tabControl->BeginCustomField("DESCRIPTION", GetMessage("LEARNING_DESCRIPTION"), false);
    ?>
	<?php 
    if (COption::GetOptionString("learning", "use_htmledit", "Y") == "Y" && CModule::IncludeModule("fileman")) {
        ?>
	<tr>
		<td colspan="2" align="center">
			<?php 
        CFileMan::AddHTMLEditorFrame("DESCRIPTION", $str_DESCRIPTION, "DESCRIPTION_TYPE", $str_DESCRIPTION_TYPE, array('width' => '100%', 'height' => '500'), "N", 0, "", "", false, true, false, array('toolbarConfig' => CFileman::GetEditorToolbarConfig("learning_" . (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 ? 'public' : 'admin'))));
        ?>
		</td>
	</tr>
	<?php 
    } else {
        ?>
	<tr>
		<td align="center"><?php 
        echo GetMessage("LEARNING_DESC_TYPE");
        ?>
:</td>
		<td>
			<input type="radio" name="DESCRIPTION_TYPE" value="text"<?php 
        if ($str_DESCRIPTION_TYPE != "html") {
            echo " checked";
echo GetMessage("FLOW_TITLE");
?>
</td>
		<td><input type="text" name="TITLE" maxlength="255" value="<?php 
echo $str_TITLE;
?>
" style="width:60%"></td>
	</tr>
	<?php 
if (COption::GetOptionString("workflow", "USE_HTML_EDIT", "Y") == "Y" && CModule::IncludeModule("fileman")) {
    ?>
	<tr>
		<td colspan="2" align="center"><?php 
    $limit_php_access = $USER->CanDoFileOperation('fm_lpa', array($str_SITE_ID, $str_FILENAME)) && !$USER->CanDoOperation('edit_php');
    $bWithoutPHP = !$USER->CanDoOperation('edit_php') && !$limit_php_access;
    CFileMan::AddHTMLEditorFrame("BODY", $str_BODY, "BODY_TYPE", $str_BODY_TYPE, 400, "Y", $ID, GetDirPath($str_FILENAME), "", false, $bWithoutPHP, false, array('limit_php_access' => $limit_php_access));
    ?>
</td>
	</tr>
	<?php 
} else {
    ?>
	<tr>
		<td colspan="2" align="center"><?php 
    echo InputType("radio", "BODY_TYPE", "text", $str_BODY_TYPE, false);
    ?>
&nbsp;<?php 
    echo GetMessage("FLOW_TEXT");
    ?>
/&nbsp;<?php 
    echo InputType("radio", "BODY_TYPE", "html", $str_BODY_TYPE, false);
	function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
	{
		global $APPLICATION;

		$strHTMLControlName["VALUE"] = htmlspecialcharsEx($strHTMLControlName["VALUE"]);
		if (!is_array($value["VALUE"]))
			$value = CIBlockPropertyHTML::ConvertFromDB($arProperty, $value);
		$ar = $value["VALUE"];
		if (strToLower($ar["TYPE"]) != "text")
			$ar["TYPE"] = "html";
		else
			$ar["TYPE"] = "text";

		$settings = CIBlockPropertyHTML::PrepareSettings($arProperty);

		ob_start();
		?><table width="100%"><?
		if($strHTMLControlName["MODE"]=="FORM_FILL" && COption::GetOptionString("iblock", "use_htmledit", "Y")=="Y" && Loader::includeModule("fileman")):
		?><tr>
			<td colspan="2" align="center">
			<input type="hidden" name="<?php 
echo $strHTMLControlName["VALUE"];
?>
" value="">
				<?
				$text_name = preg_replace("/([^a-z0-9])/is", "_", $strHTMLControlName["VALUE"]."[TEXT]");
				$text_type = preg_replace("/([^a-z0-9])/is", "_", $strHTMLControlName["VALUE"]."[TYPE]");
				CFileMan::AddHTMLEditorFrame($text_name, htmlspecialcharsBx($ar["TEXT"]), $text_type, strToLower($ar["TYPE"]), $settings['height'], "N", 0, "", "");
				?>
			</td>
		</tr>
		<?else:?>
		<tr>
			<td align="right"><?echo Loc::getMessage("IBLOCK_DESC_TYPE")?></td>
			<td align="left">
				<input type="radio" name="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TYPE]" id="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TYPE][TEXT]" value="text" <?if($ar["TYPE"]!="html")echo " checked"?>>
				<label for="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TYPE][TEXT]"><?echo Loc::getMessage("IBLOCK_DESC_TYPE_TEXT")?></label> /
				<input type="radio" name="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TYPE]" id="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TYPE][HTML]" value="html"<?if($ar["TYPE"]=="html")echo " checked"?>>
				<label for="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TYPE][HTML]"><?echo Loc::getMessage("IBLOCK_DESC_TYPE_HTML")?></label>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><textarea cols="60" rows="10" name="<?php 
echo $strHTMLControlName["VALUE"];
?>
[TEXT]" style="width:100%"><?php 
echo htmlspecialcharsEx($ar["TEXT"]);
?>
</textarea></td>
		</tr>
		<?endif;
		if (($arProperty["WITH_DESCRIPTION"]=="Y") && ('' != trim($strHTMLControlName["DESCRIPTION"]))):?>
		<tr>
			<td colspan="2">
				<span title="<?echo Loc::getMessage("IBLOCK_PROP_HTML_DESCRIPTION_TITLE")?>"><?echo Loc::getMessage("IBLOCK_PROP_HTML_DESCRIPTION_LABEL")?>:<input type="text" name="<?php 
echo $strHTMLControlName["DESCRIPTION"];
?>
" value="<?php 
echo $value["DESCRIPTION"];
?>
" size="18"></span>
			</td>
		</tr>
		<?endif;?>
		</table>
		<?
		$return = ob_get_contents();
		ob_end_clean();
		return  $return;
	}
}
?>
		</td>
	</tr>
	<tr class="heading" id="tr_QUESTION_LABEL">
		<td colspan="2"><?php 
echo GetMessage("VOTE_QUESTION_TEXT");
?>
</td>
	</tr>
	<?php 
if (COption::GetOptionString("vote", "USE_HTML_EDIT") == "Y" && CModule::IncludeModule("fileman")) {
    ?>
	<tr>
		<td align="center" colspan="2"><?php 
    CFileMan::AddHTMLEditorFrame("QUESTION", $arQuestion["QUESTION"], "QUESTION_TYPE", $arQuestion["QUESTION_TYPE"], array('height' => '200', 'width' => '100%'));
    ?>
</td>
	</tr>
	<?php 
} else {
    ?>
	<tr>
		<td align="center" colspan="2"><?php 
    echo InputType("radio", "QUESTION_TYPE", "text", $arQuestion["QUESTION_TYPE"], false);
    ?>
Text &nbsp;/&nbsp;<?php 
    echo InputType("radio", "QUESTION_TYPE", "html", $arQuestion["QUESTION_TYPE"], false);
    ?>
HTML</td>
	</tr>
		TE_MESS.FILEMAN_PREVIEW_TEMPLATE_TITLE = "<?php 
    echo GetMessage("FILEMAN_PREVIEW_TEMPLATE_TITLE");
    ?>
";
		__ID = '<?php 
    echo CUtil::JSEscape($ID);
    ?>
';
		var SITE_TEMPLATE_PATH = '<?php 
    echo BX_PERSONAL_ROOT . '/templates/' . CUtil::JSEscape($ID);
    ?>
';
	</script>
	<?php 
    $template_styles_path = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $ID . "/template_styles.css";
    CFileMan::AddHTMLEditorFrame("CONTENT", $str_CONTENT, false, false, array("height" => 600, "width" => '100%'), "N", 0, "", "", false, false, array("BXPropertiesTaskbar", "BXComponentsTaskbar", "BXComponents2Taskbar", "BXSnippetsTaskbar"), array("additionalCSS" => array($template_styles_path), "saveEditorState" => false, "limit_php_access" => $lpa || $lpa_view, "dontshowta" => true, 'toolbarConfig' => CFileman::GetEditorToolbarConfig("template_edit")));
} else {
    ?>
	<textarea rows="28" cols="60" style="width:100%" id="bxed_CONTENT" name="CONTENT" wrap="off"><?php 
    echo htmlspecialcharsbx(htmlspecialcharsback($str_CONTENT));
    ?>
</textarea>
<?php 
}
?>
		</td>
	</tr>

<script type="text/javascript" src="/bitrix/js/main/template_edit.js?v=<?php 
echo @filemtime($_SERVER['DOCUMENT_ROOT'] . '/bitrix/js/main/template_edit.js');
?>
Beispiel #11
0
    ?>
] <?php 
    echo $mailTemplate['NAME'];
    ?>
</option>
				<?php 
}
?>
			</select>
		</td>
	</tr>

	<tr>
		<td colspan="2" align="center">
			<?php 
CFileMan::AddHTMLEditorFrame("MESSAGE", $str_MESSAGE, "BODY_TYPE", $str_BODY_TYPE, array('height' => 450, 'width' => '100%'), "N", 0, "", "onfocus=\"t=this\"", false, !$isUserHavePhpAccess, false, array('templateID' => $str_SITE_TEMPLATE_ID, 'componentFilter' => array('TYPE' => 'mail'), 'limit_php_access' => !$isUserHavePhpAccess));
?>
			<script type="text/javascript" language="JavaScript">
				BX.addCustomEvent('OnEditorInitedAfter', function(editor){editor.components.SetComponentIcludeMethod('EventMessageThemeCompiler::includeComponent'); });
			</script>
		</td>
	</tr>

	<?php 
$arAttachedImagePlaceHolders = array();
foreach ($arEventMessageFile as $arFile) {
    if (substr($arFile['CONTENT_TYPE'], 0, 5) == 'image') {
        $arAttachedImagePlaceHolders[] = $arFile;
    }
}
?>
$tabControl->BeginCustomField("DESCRIPTION", GetMessage("IBSEC_E_DESCRIPTION"), $arIBlock["FIELDS"]["SECTION_DESCRIPTION"]["IS_REQUIRED"] === "Y");
?>
	<tr class="heading">
		<td colspan="2"><?php 
echo $tabControl->GetCustomLabelHTML();
?>
</td>
	</tr>

	<?php 
if (COption::GetOptionString("iblock", "use_htmledit", "Y") == "Y" && $bFileman) {
    ?>
	<tr>
		<td colspan="2" align="center">
			<?php 
    CFileMan::AddHTMLEditorFrame("DESCRIPTION", $str_DESCRIPTION, "DESCRIPTION_TYPE", $str_DESCRIPTION_TYPE, array('height' => 450, 'width' => '100%'), "N", 0, "", "", $arIBlock["LID"], true, false, array('hideTypeSelector' => $arIBlock["FIELDS"]["SECTION_DESCRIPTION_TYPE_ALLOW_CHANGE"]["DEFAULT_VALUE"] === "N"));
    ?>
		</td>
	</tr>
	<?php 
} else {
    ?>
	<tr>
		<td  ><?php 
    echo GetMessage("IBSEC_E_DESC_TYPE");
    ?>
</td>
		<td >
			<input type="radio" name="DESCRIPTION_TYPE" id="DESCRIPTION_TYPE_text" value="text"<?php 
    if ($str_DESCRIPTION_TYPE != "html") {
        echo " checked";
Beispiel #13
0
    /**
     * Init editor
     *
     * @param array $params
     * @return string
     */
    public static function initEditor(array $params)
    {
        $fieldName = $params['FIELD_NAME'];
        $fieldValue = $params['FIELD_VALUE'];
        $isUserHavePhpAccess = $params['HAVE_USER_ACCESS'];
        $showSaveTemplate = isset($params['SHOW_SAVE_TEMPLATE']) ? $params['SHOW_SAVE_TEMPLATE'] : true;
        $site = isset($params['SITE']) ? $params['SITE'] : '';
        $charset = isset($params['CHARSET']) ? $params['CHARSET'] : '';
        $contentUrl = isset($params['CONTENT_URL']) ? $params['CONTENT_URL'] : '';
        $templateTypeInput = isset($params['TEMPLATE_TYPE_INPUT']) ? $params['TEMPLATE_TYPE_INPUT'] : 'TEMPLATE_TYPE';
        $templateIdInput = isset($params['TEMPLATE_ID_INPUT']) ? $params['TEMPLATE_ID_INPUT'] : 'TEMPLATE_ID';
        $templateType = isset($params['TEMPLATE_TYPE']) ? $params['TEMPLATE_TYPE'] : '';
        $templateId = isset($params['TEMPLATE_ID']) ? $params['TEMPLATE_ID'] : '';
        $isTemplateMode = isset($params['IS_TEMPLATE_MODE']) ? (bool) $params['IS_TEMPLATE_MODE'] : true;
        if (!empty($params['PERSONALIZE_LIST']) && is_array($params['PERSONALIZE_LIST'])) {
            PostingRecipientTable::setPersonalizeList($params['PERSONALIZE_LIST']);
        }
        \CJSCore::RegisterExt("editor_mailblock", array("js" => array("/bitrix/js/sender/editor_mailblock.js"), "rel" => array()));
        \CJSCore::Init(array("editor_mailblock"));
        static $isInit;
        $isDisplayBlockEditor = $templateType && $templateId || static::isContentForBlockEditor($fieldValue);
        $editorHeight = 650;
        $editorWidth = '100%';
        ob_start();
        ?>
		<div id="bx-sender-visual-editor-<?php 
        echo $fieldName;
        ?>
" style="<?php 
        if ($isDisplayBlockEditor) {
            ?>
display: none;<?php 
        }
        ?>
">
		<?php 
        if (\Bitrix\Main\Config\Option::get('fileman', 'use_editor_3') == 'Y') {
            \Bitrix\Main\Loader::includeModule('fileman');
            ?>
		<script>
			BX.ready(function(){
				<?php 
            if (!$isInit) {
                $isInit = true;
                ?>
					var letterManager = new SenderLetterManager;
					letterManager.setMailBlockList(<?php 
                echo \CUtil::PhpToJSObject(\Bitrix\Sender\Preset\MailBlock::getBlockForVisualEditor());
                ?>
);
					letterManager.setPlaceHolderList(<?php 
                echo \CUtil::PhpToJSObject(\Bitrix\Sender\PostingRecipientTable::getPersonalizeList());
                ?>
);
				<?php 
            }
            ?>
			});

			BX.message({
				"BXEdMailBlocksTitle" : "<?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_MAILBLOCK');
            ?>
",
				"BXEdMailBlocksSearchPlaceHolder" : "<?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_MAILBLOCK_SEARCH');
            ?>
",
				"BXEdPlaceHolderSelectorTitle" : "<?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_PLACEHOLDER');
            ?>
"
			});
		</script>
		<?php 
            \CFileMan::AddHTMLEditorFrame($fieldName, $fieldValue, false, "text", array('height' => $editorHeight, 'width' => $editorWidth), "N", 0, "", "onfocus=\"t=this\"", false, !$isUserHavePhpAccess, false, array('componentFilter' => array('TYPE' => 'mail'), 'limit_php_access' => !$isUserHavePhpAccess));
            ?>
		<?php 
        } else {
            $fieldValue = htmlspecialcharsback($fieldValue);
            ?>
			<br>
			<?php 
            echo Loc::getMessage("SENDER_ENTITY_TEMPLATE_NOTE_OLD_EDITOR", array("%LINK_START%" => '<a href="/bitrix/admin/settings.php?mid=fileman&lang=' . LANGUAGE_ID . '">', "%LINK_END%" => '</a>'));
            ?>
			<br>
			<br>
			<textarea class="typearea" style="width:<?php 
            echo $editorWidth;
            ?>
;height:<?php 
            echo $editorHeight;
            ?>
px;" name="<?php 
            echo $fieldName;
            ?>
" id="bxed_<?php 
            echo $fieldName;
            ?>
" wrap="virtual"><?php 
            echo htmlspecialcharsbx($fieldValue);
            ?>
</textarea>
			<?php 
        }
        ?>
		</div>

		<div id="bx-sender-block-editor-<?php 
        echo $fieldName;
        ?>
" style="<?php 
        if (!$isDisplayBlockEditor) {
            ?>
display: none;<?php 
        }
        ?>
">
			<br/>
			<input type="hidden" name="<?php 
        echo htmlspecialcharsbx($templateTypeInput);
        ?>
" value="<?php 
        echo htmlspecialcharsbx($templateType);
        ?>
" />
			<input type="hidden" name="<?php 
        echo htmlspecialcharsbx($templateIdInput);
        ?>
" value="<?php 
        echo htmlspecialcharsbx($templateId);
        ?>
" />
			<?php 
        $url = '';
        if ($isDisplayBlockEditor) {
            if ($templateType && $templateId) {
                $url = '/bitrix/admin/sender_template_admin.php?';
                $url .= 'action=get_template&template_type=' . $templateType . '&template_id=' . $templateId;
                $url .= '&lang=' . LANGUAGE_ID . '&' . bitrix_sessid_get();
            } else {
                $url = $contentUrl;
            }
        }
        echo \Bitrix\Fileman\Block\EditorMail::show(array('id' => $fieldName, 'charset' => $charset, 'site' => $site, 'own_result_id' => 'bxed_' . $fieldName, 'url' => $url, 'templateType' => $templateType, 'templateId' => $templateId, 'isTemplateMode' => $isTemplateMode, 'isUserHavePhpAccess' => $isUserHavePhpAccess));
        ?>
		</div>

		<?php 
        if ($showSaveTemplate) {
            ?>
		<script>
			function ToggleTemplateSaveDialog()
			{
				BX('TEMPLATE_ACTION_SAVE_NAME_CONT').value = '';

				var currentDisplay =  BX('TEMPLATE_ACTION_SAVE_NAME_CONT').style.display;
				BX('TEMPLATE_ACTION_SAVE_NAME_CONT').style.display = BX.toggle(currentDisplay, ['inline', 'none']);
			}
		</script>
		<div class="adm-detail-content-item-block-save">
			<span>
				<input type="checkbox" value="Y" name="TEMPLATE_ACTION_SAVE" id="TEMPLATE_ACTION_SAVE" onclick="ToggleTemplateSaveDialog();">
				<label for="TEMPLATE_ACTION_SAVE"><?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_SAVE');
            ?>
</label>
			</span>
			<span id="TEMPLATE_ACTION_SAVE_NAME_CONT" style="display: none;"> <?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_SAVE_NAME');
            ?>
 <input type="text" name="TEMPLATE_ACTION_SAVE_NAME"></span>
		</div>
		<?php 
        }
        return ob_get_clean();
    }
				<?echo getDiff($prev_arElement["DETAIL_TEXT"], $arElement["DETAIL_TEXT"])?>
			</div>
		</td>
	</tr>
	<?elseif(COption::GetOptionString("iblock", "use_htmledit", "Y")=="Y" && $bFileman):?>
	<tr id="tr_SUB_DETAIL_TEXT_EDITOR">
		<td colspan="2" align="center">
			<?CFileMan::AddHTMLEditorFrame(
				"SUB_DETAIL_TEXT",
				$str_DETAIL_TEXT,
				"SUB_DETAIL_TEXT_TYPE",
				$str_DETAIL_TEXT_TYPE,
				array(
						'height' => 450,
						'width' => '100%'
					),
					"N",
					0,
					"",
					"",
					$arIBlock["LID"],
					true,
					false,
					array('toolbarConfig' => CFileman::GetEditorToolbarConfig("iblock_".(defined('FX_SUB_SETTINGS') && FX_SUB_SETTINGS == true ? 'admin' : 'public')), 'saveEditorKey' => $IBLOCK_ID)
				);
		?></td>
	</tr>
	<?else:?>
	<tr id="tr_SUB_DETAIL_TEXT_TYPE">
		<td><?echo GetMessage("IBLOCK_DESC_TYPE")?></td>
		<td><input type="radio" name="SUB_DETAIL_TEXT_TYPE" id="SUB_DETAIL_TEXT_TYPE_text" value="text"<?if($str_DETAIL_TEXT_TYPE!="html")echo " checked"?>> <label for="SUB_DETAIL_TEXT_TYPE_text"><?echo GetMessage("IBLOCK_DESC_TYPE_TEXT")?></label> / <input type="radio" name="SUB_DETAIL_TEXT_TYPE" id="SUB_DETAIL_TEXT_TYPE_html" value="html"<?if($str_DETAIL_TEXT_TYPE=="html")echo " checked"?>> <label for="SUB_DETAIL_TEXT_TYPE_html"><?echo GetMessage("IBLOCK_DESC_TYPE_HTML")?></label></td>
	</tr>
Beispiel #15
0
none<?php 
}
?>
;">
		<td align="center" colspan="2">
			<table width="95%" cellspacing="0" border="0" cellpadding="0">
			<?php 
if ($isEditMode) {
    if (COption::GetOptionString("advertising", "USE_HTML_EDIT", "Y") == "Y" && CModule::IncludeModule("fileman")) {
        ?>
				<tr valign="top">
					<td align="center" colspan="2"><?php 
        if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) {
            CFileMan::AddHTMLEditorFrame("CODE", $str_CODE, "CODE_TYPE", $str_CODE_TYPE, array('height' => 450, 'width' => '100%'), "N", 0, "", "onfocus=\"t=this\"");
        } else {
            CFileMan::AddHTMLEditorFrame("CODE", $str_CODE, "CODE_TYPE", $str_CODE_TYPE, 300, "N", 0, "", "onfocus=\"t=this\"");
        }
        ?>
</td>
				</tr>
				<?php 
    } else {
        ?>
					<tr valign="top">
						<td align="center" colspan="2"><?php 
        echo InputType("radio", "CODE_TYPE", "text", $str_CODE_TYPE, false);
        echo GetMessage("AD_TEXT");
        ?>
/&nbsp;<?php 
        echo InputType("radio", "CODE_TYPE", "html", $str_CODE_TYPE, false);
        ?>
Beispiel #16
0
<br><?php 
    echo CFile::ShowImage($str_IMAGE_ID, 200, 200, "border=0", "", true);
}
?>
</td>
	</tr>
	<?php 
if (COption::GetOptionString("form", "USE_HTML_EDIT") == "Y" && CModule::IncludeModule("fileman")) {
    ?>
	<tr>
		<td align="center" colspan="2">
		<?php 
    if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) {
        CFileMan::AddHTMLEditorFrame("FORM_DESCRIPTION", $str_DESCRIPTION, "FORM_DESCRIPTION_TYPE", $str_DESCRIPTION_TYPE, array('height' => 450, 'width' => '100%'));
    } else {
        CFileMan::AddHTMLEditorFrame("FORM_DESCRIPTION", $str_DESCRIPTION, "FORM_DESCRIPTION_TYPE", $str_DESCRIPTION_TYPE);
    }
    ?>
</td>
	</tr>
	<?php 
} else {
    ?>
	<tr>
		<td align="center" colspan="2"><?php 
    echo InputType("radio", "FORM_DESCRIPTION_TYPE", "text", $str_DESCRIPTION_TYPE, false);
    ?>
&nbsp;<?php 
    echo GetMessage("FORM_TEXT");
    ?>
/&nbsp;<?php 
	<tr id="tr_SUB_DETAIL_TEXT_DIFF">
		<td colspan="2">
			<div style="width:95%;background-color:white;border:1px solid black;padding:5px">
				<?php 
        echo getDiff($prev_arElement["DETAIL_TEXT"], $arElement["DETAIL_TEXT"]);
        ?>
			</div>
		</td>
	</tr>
	<?php 
    } elseif (COption::GetOptionString("iblock", "use_htmledit", "Y") == "Y" && $bFileman) {
        ?>
	<tr id="tr_SUB_DETAIL_TEXT_EDITOR">
		<td colspan="2" align="center">
			<?php 
        CFileMan::AddHTMLEditorFrame("SUB_DETAIL_TEXT", $str_DETAIL_TEXT, "SUB_DETAIL_TEXT_TYPE", $str_DETAIL_TEXT_TYPE, array('height' => 450, 'width' => '100%'), "N", 0, "", "", $arIBlock["LID"], true, false, array('toolbarConfig' => CFileman::GetEditorToolbarConfig("iblock_" . (defined('BX_SUB_SETTINGS') && BX_SUB_SETTINGS == true ? 'admin' : 'public')), 'saveEditorKey' => $IBLOCK_ID, 'hideTypeSelector' => $arIBlock["FIELDS"]["DETAIL_TEXT_TYPE_ALLOW_CHANGE"]["DEFAULT_VALUE"] === "N"));
        ?>
</td>
	</tr>
	<?php 
    } else {
        ?>
	<tr id="tr_SUB_DETAIL_TEXT_TYPE">
		<td><?php 
        echo GetMessage("IBLOCK_DESC_TYPE");
        ?>
</td>
		<td><input type="radio" name="SUB_DETAIL_TEXT_TYPE" id="SUB_DETAIL_TEXT_TYPE_text" value="text"<?php 
        if ($str_DETAIL_TEXT_TYPE != "html") {
            echo " checked";
        }
Beispiel #18
0
</td>
		<td><input type="text" name="SUBJECT" value="<?php 
echo $str_SUBJECT;
?>
" size="30" maxlength="255"></td>
	</tr>
	<tr class="heading adm-detail-required-field">
		<td colspan="2"><?php 
echo GetMessage("post_fields_text");
?>
<span class="required"><sup>1</sup></span></td>
	</tr>
	<tr>
		<td colspan="2">
		<?php 
CFileMan::AddHTMLEditorFrame("BODY", $str_BODY, "BODY_TYPE", $str_BODY_TYPE, 400, "N", 0, "", "", SITE_ID);
?>
		</td>
	</tr>
<?php 
//********************
//Receipients
//********************
$tabControl->BeginNextTab();
?>
	<tr class="heading">
		<td colspan="2"><?php 
echo GetMessage("post_subscr");
?>
</td>
	</tr>
				<?echo getDiff($prev_arElement["DETAIL_TEXT"], $arElement["DETAIL_TEXT"])?>
			</div>
		</td>
	</tr>
	<?elseif(COption::GetOptionString("iblock", "use_htmledit", "Y")=="Y" && $bFileman):?>
	<tr id="tr_DETAIL_TEXT_EDITOR">
		<td colspan="2" align="center">
			<?CFileMan::AddHTMLEditorFrame(
				"DETAIL_TEXT",
				$str_DETAIL_TEXT,
				"DETAIL_TEXT_TYPE",
				$str_DETAIL_TEXT_TYPE,
				array(
					'height' => 450,
					'width' => '100%'
				),
				"N",
				0,
				"",
				"",
				$arIBlock["LID"],
				true,
				false,
				array('toolbarConfig' => CFileman::GetEditorToolbarConfig("iblock_".(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 ? 'public' : 'admin')), 'saveEditorKey' => $IBLOCK_ID)
			);
		?></td>
	</tr>
	<?else:?>
	<tr id="tr_DETAIL_TEXT_TYPE">
		<td><?echo GetMessage("IBLOCK_DESC_TYPE")?></td>
		<td><input type="radio" name="DETAIL_TEXT_TYPE" id="DETAIL_TEXT_TYPE_text" value="text"<?if($str_DETAIL_TEXT_TYPE!="html")echo " checked"?>> <label for="DETAIL_TEXT_TYPE_text"><?echo GetMessage("IBLOCK_DESC_TYPE_TEXT")?></label> / <input type="radio" name="DETAIL_TEXT_TYPE" id="DETAIL_TEXT_TYPE_html" value="html"<?if($str_DETAIL_TEXT_TYPE=="html")echo " checked"?>> <label for="DETAIL_TEXT_TYPE_html"><?echo GetMessage("IBLOCK_DESC_TYPE_HTML")?></label></td>
	</tr>
Beispiel #20
0
';
	</script>
	<?
	$template_styles_path = $_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/templates/".$ID."/template_styles.css";
	CFileMan::AddHTMLEditorFrame(
		"CONTENT", // Name
		$str_CONTENT, // Content
		false, // strTextTypeFieldName
		false, //strTextTypeValue
		Array("height"=>600, "width"=>'100%'),
		"N", //CONVERT_FOR_WORKFLOW
		0, //WORKFLOW_DOCUMENT_ID
		"", //NEW_DOCUMENT_PATH
		"", //textarea_field
		false, //site
		false, //bWithoutPHP
		Array("BXPropertiesTaskbar","BXComponentsTaskbar", "BXComponents2Taskbar","BXSnippetsTaskbar"), //arTaskbars
		Array //arAdditionalParams
		(
			"additionalCSS" => Array($template_styles_path),
			"saveEditorState" => false,
			//"dontusecookie" => true,
			"limit_php_access" => ($lpa || $lpa_view),
			"dontshowta" => true,
			'toolbarConfig' => CFileman::GetEditorToolbarConfig("template_edit")
		)
	);
else:?>
	<textarea rows="28" cols="60" style="width:100%" id="bxed_CONTENT" name="CONTENT" wrap="off"><?echo htmlspecialcharsbx(htmlspecialcharsback($str_CONTENT))?></textarea>
<?endif;?>
		</td>
Beispiel #21
0
        echo GetMessage("IB_E_PICTURE");
        ?>
</td>
		<td>
			<?php 
        echo CFileInput::Show('PICTURE', $str_PICTURE, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))), array('upload' => true, 'medialib' => false, 'file_dialog' => false, 'cloud' => false, 'del' => true, 'description' => false));
        ?>
		</td>
	</tr>
	<?php 
        if (COption::GetOptionString("iblock", "use_htmledit", "Y") == "Y" && CModule::IncludeModule("fileman")) {
            ?>
		<tr>
			<td colspan="2" align="center">
				<?php 
            CFileMan::AddHTMLEditorFrame("DESCRIPTION", $str_DESCRIPTION, "DESCRIPTION_TYPE", $str_DESCRIPTION_TYPE, array('height' => 450, 'width' => '100%'));
            ?>
			</td>
		</tr>
	<?php 
        } else {
            ?>
		<tr>
			<td ><?php 
            echo GetMessage("IB_E_DESCRIPTION_TYPE");
            ?>
</td>
			<td >
				<input type="radio" name="DESCRIPTION_TYPE" id="DESCRIPTION_TYPE1" value="text"<?php 
            if ($str_DESCRIPTION_TYPE != "html") {
                echo " checked";
 /**
  * @inheritdoc
  */
 protected function getEditHtml()
 {
     if (\CModule::IncludeModule('fileman')) {
         ob_start();
         $codeType = $this->getContentTypeCode();
         /** @var string $className Имя класса без неймспейса */
         $className = $this->getEntityShortName();
         $entityClass = $this->entityName;
         $modelPk = $entityClass::getEntity()->getPrimary();
         $id = isset($this->data[$modelPk]) ? $this->data[$modelPk] : false;
         $bxCode = $this->code . '_' . $className;
         $bxCodeType = $codeType . '_' . $className;
         if ($this->forceMultiple) {
             if ($id) {
                 $bxCode .= '_' . $id;
                 $bxCodeType .= '_' . $id;
             } else {
                 $bxCode .= '_new_';
                 $bxCodeType .= '_new_';
             }
         }
         // TODO Избавиться от данного костыля
         if ($_REQUEST[$bxCode]) {
             $this->data[$this->code] = $_REQUEST[$bxCode];
         }
         $editorToolbarSets = array('FULL' => array('Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'CreateLink', 'DeleteLink', 'Image', 'Video', 'BackColor', 'ForeColor', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull', 'InsertOrderedList', 'InsertUnorderedList', 'Outdent', 'Indent', 'StyleList', 'HeaderList', 'FontList', 'FontSizeList'), 'SIMPLE' => array('Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'CreateLink', 'DeleteLink', 'Video', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull', 'InsertOrderedList', 'InsertUnorderedList', 'Outdent', 'Indent', 'FontList', 'FontSizeList'));
         if ($this->getSettings('LIGHT_EDITOR_MODE') == 'Y') {
             // Облегченная версия редактора
             global $APPLICATION;
             $editorToolbarConfig = $this->getSettings('EDITOR_TOOLBAR_CONFIG');
             if (!is_array($editorToolbarConfig)) {
                 $editorToolbarSet = $this->getSettings('EDITOR_TOOLBAR_CONFIG_SET');
                 if (isset($editorToolbarSets[$editorToolbarSet])) {
                     $editorToolbarConfig = $editorToolbarSets[$editorToolbarSet];
                 } else {
                     $editorToolbarConfig = $editorToolbarSets['FULL'];
                 }
             }
             $APPLICATION->IncludeComponent('bitrix:fileman.light_editor', '', array('CONTENT' => $this->data[$this->code], 'INPUT_NAME' => $bxCode, 'INPUT_ID' => $bxCode, 'WIDTH' => $this->getSettings('WIDTH'), 'HEIGHT' => $this->getSettings('HEIGHT'), 'RESIZABLE' => 'N', 'AUTO_RESIZE' => 'N', 'VIDEO_ALLOW_VIDEO' => 'Y', 'VIDEO_MAX_WIDTH' => $this->getSettings('WIDTH'), 'VIDEO_MAX_HEIGHT' => $this->getSettings('HEIGHT'), 'VIDEO_BUFFER' => '20', 'VIDEO_LOGO' => '', 'VIDEO_WMODE' => 'transparent', 'VIDEO_WINDOWLESS' => 'Y', 'VIDEO_SKIN' => '/bitrix/components/bitrix/player/mediaplayer/skins/bitrix.swf', 'USE_FILE_DIALOGS' => 'Y', 'ID' => 'LIGHT_EDITOR_' . $bxCode, 'JS_OBJ_NAME' => $bxCode, 'TOOLBAR_CONFIG' => $editorToolbarConfig));
         } else {
             // Полная версия редактора
             \CFileMan::AddHTMLEditorFrame($bxCode, $this->data[$this->code], $bxCodeType, $this->data[$codeType], array('width' => $this->getSettings('WIDTH'), 'height' => $this->getSettings('HEIGHT')));
             $defaultEditors = array(static::CONTENT_TYPE_TEXT => static::CONTENT_TYPE_TEXT, static::CONTENT_TYPE_HTML => static::CONTENT_TYPE_HTML, 'editor' => 'editor');
             $editors = $this->getSettings('EDITORS');
             $defaultEditor = strtolower($this->getSettings('DEFAULT_EDITOR'));
             $contentType = $this->getContentType();
             $defaultEditor = isset($contentType) && $contentType == static::CONTENT_TYPE_TEXT ? static::CONTENT_TYPE_TEXT : $defaultEditor;
             $defaultEditor = isset($contentType) && $contentType == static::CONTENT_TYPE_HTML ? "editor" : $defaultEditor;
             if (count($editors) > 1) {
                 foreach ($editors as &$editor) {
                     $editor = strtolower($editor);
                     if (isset($defaultEditors[$editor])) {
                         unset($defaultEditors[$editor]);
                     }
                 }
             }
             $script = '<script type="text/javascript">';
             $script .= '$(document).ready(function() {';
             foreach ($defaultEditors as $editor) {
                 $script .= '$("#bxed_' . $bxCode . '_' . $editor . '").parent().hide();';
             }
             $script .= '$("#bxed_' . $bxCode . '_' . $defaultEditor . '").click();';
             $script .= 'setTimeout(function() {$("#bxed_' . $bxCode . '_' . $defaultEditor . '").click(); }, 500);';
             $script .= "});";
             $script .= '</script>';
             echo $script;
         }
         $html = ob_get_clean();
         return $html;
     } else {
         return parent::getEditHtml();
     }
 }
Beispiel #23
0
		<td><?php 
    echo CFile::InputFile("IMAGE_ID", 20, $str_IMAGE_ID);
    if ($str_IMAGE_ID > 0) {
        ?>
<br /><?php 
        echo CFile::ShowImage($str_IMAGE_ID, 200, 200, "border=0", "", true);
    }
    ?>
		</td>
	</tr>
	<?php 
    if (COption::GetOptionString("form", "USE_HTML_EDIT") == "Y" && CModule::IncludeModule("fileman")) {
        ?>
	<tr>
		<td align="center" colspan="2"><?php 
        CFileMan::AddHTMLEditorFrame("TITLE", $str_TITLE, "TITLE_TYPE", $str_TITLE_TYPE, 400);
        ?>
</td>
	</tr>
	<?php 
    } else {
        ?>
	<tr>
		<td align="center" colspan="2"><?php 
        echo InputType("radio", "TITLE_TYPE", "text", $str_TITLE_TYPE, false);
        ?>
&nbsp;<?php 
        echo GetMessage("FORM_TEXT");
        ?>
/&nbsp;<?php 
        echo InputType("radio", "TITLE_TYPE", "html", $str_TITLE_TYPE, false);
Beispiel #24
0
    /**
     * @param array $arParams
     * @return string
     */
    public static function initEditor(array $arParams)
    {
        $fieldName = $arParams['FIELD_NAME'];
        $fieldValue = $arParams['FIELD_VALUE'];
        $isUserHavePhpAccess = $arParams['HAVE_USER_ACCESS'];
        $showSaveTemplate = isset($arParams['SHOW_SAVE_TEMPLATE']) ? $arParams['SHOW_SAVE_TEMPLATE'] : true;
        if (!empty($arParams['PERSONALIZE_LIST']) && is_array($arParams['PERSONALIZE_LIST'])) {
            PostingRecipientTable::setPersonalizeList($arParams['PERSONALIZE_LIST']);
        }
        \CJSCore::RegisterExt("editor_mailblock", array("js" => "/bitrix/js/sender/editor_mailblock.js", "rel" => array()));
        static $isInit;
        $editorHeight = 650;
        $editorWidth = '100%';
        ob_start();
        if (\Bitrix\Main\Config\Option::get('fileman', 'use_editor_3') == 'Y') {
            \Bitrix\Main\Loader::includeModule('fileman');
            \CJSCore::Init(array("editor_mailblock"));
            ?>
		<script>
			//BX.ready(function(){
				<?php 
            if (!$isInit) {
                $isInit = true;
                ?>
					letterManager = new SenderLetterManager;
					letterManager.setMailBlockList(<?php 
                echo \CUtil::PhpToJSObject(\Bitrix\Sender\Preset\MailBlock::getBlockForVisualEditor());
                ?>
);
				<?php 
            }
            ?>
			//});

			BX.message({"BXEdMailBlocksTitle" : "<?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_MAILBLOCK');
            ?>
"});
			BX.message({"BXEdMailBlocksSearchPlaceHolder" : "<?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_MAILBLOCK_SEARCH');
            ?>
"});
		</script>
		<?php 
            \CFileMan::AddHTMLEditorFrame($fieldName, $fieldValue, false, "html", array('height' => $editorHeight, 'width' => $editorWidth), "N", 0, "", "onfocus=\"t=this\"", false, !$isUserHavePhpAccess, false, array('componentFilter' => array('TYPE' => 'mail'), 'limit_php_access' => !$isUserHavePhpAccess));
            ?>
		<?php 
        } else {
            $fieldValue = htmlspecialcharsback($fieldValue);
            ?>
			<br>
			<?php 
            echo Loc::getMessage("SENDER_ENTITY_TEMPLATE_NOTE_OLD_EDITOR", array("%LINK_START%" => '<a href="/bitrix/admin/settings.php?mid=fileman&lang=' . LANGUAGE_ID . '">', "%LINK_END%" => '</a>'));
            ?>
			<br>
			<br>
			<textarea class="typearea" style="width:<?php 
            echo $editorWidth;
            ?>
;height:<?php 
            echo $editorHeight;
            ?>
px;" name="<?php 
            echo $fieldName;
            ?>
" id="bxed_<?php 
            echo $fieldName;
            ?>
" wrap="virtual"><?php 
            echo htmlspecialcharsbx($fieldValue);
            ?>
</textarea>
			<?php 
        }
        if ($showSaveTemplate) {
            ?>
		<script>
			function ToggleTemplateSaveDialog()
			{
				BX('TEMPLATE_ACTION_SAVE_NAME_CONT').value = '';

				var currentDisplay =  BX('TEMPLATE_ACTION_SAVE_NAME_CONT').style.display;
				BX('TEMPLATE_ACTION_SAVE_NAME_CONT').style.display = BX.toggle(currentDisplay, ['inline', 'none']);
			}
		</script>
		<div class="adm-detail-content-item-block-save">
			<span>
				<input type="checkbox" value="Y" name="TEMPLATE_ACTION_SAVE" id="TEMPLATE_ACTION_SAVE" onclick="ToggleTemplateSaveDialog();">
				<label for="TEMPLATE_ACTION_SAVE"><?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_SAVE');
            ?>
</label>
			</span>
			<span id="TEMPLATE_ACTION_SAVE_NAME_CONT" style="display: none;"> <?php 
            echo Loc::getMessage('SENDER_TEMPLATE_EDITOR_SAVE_NAME');
            ?>
 <input type="text" name="TEMPLATE_ACTION_SAVE_NAME"></span>
		</div>
		<?php 
        }
        return ob_get_clean();
    }