本文整理汇总了PHP中CFileMan::ShowTypeSelector方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::ShowTypeSelector方法的具体用法?PHP CFileMan::ShowTypeSelector怎么用?PHP CFileMan::ShowTypeSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::ShowTypeSelector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddHTMLEditorFrame
function AddHTMLEditorFrame($strTextFieldName, $strTextValue, $strTextTypeFieldName, $strTextTypeValue, $arSize = array("height" => 350), $CONVERT_FOR_WORKFLOW = "N", $WORKFLOW_DOCUMENT_ID = 0, $NEW_DOCUMENT_PATH = "", $textarea_field = "", $site = false, $bWithoutPHP = true, $arTaskbars = false, $arAdditionalParams = array())
{
// We have to avoid of showing HTML-editor with probably unsecure content when loosing the session [mantis:#0007986]
if ($_SERVER["REQUEST_METHOD"] == "POST" && !check_bitrix_sessid()) {
return;
}
global $htmled, $usehtmled;
$strTextFieldName = preg_replace("/[^a-zA-Z0-9_:\\.]/is", "", $strTextFieldName);
if (is_array($arSize)) {
$iHeight = $arSize["height"];
} else {
$iHeight = $arSize;
}
$strTextValue = htmlspecialcharsback($strTextValue);
$dontShowTA = isset($arAdditionalParams['dontshowta']) ? $arAdditionalParams['dontshowta'] : false;
if ($arAdditionalParams['hideTypeSelector']) {
$textType = $strTextTypeValue == 'html' ? 'editor' : 'text';
?>
<input type="hidden" name="<?php
echo $strTextTypeFieldName;
?>
" value="<?php
echo $strTextTypeValue;
?>
"/><?php
} else {
$textType = CFileMan::ShowTypeSelector(array('name' => $strTextFieldName, 'key' => $arAdditionalParams['saveEditorKey'], 'strTextTypeFieldName' => $strTextTypeFieldName, 'strTextTypeValue' => $strTextTypeValue, 'bSave' => $arAdditionalParams['saveEditorState'] !== false));
}
$curHTMLEd = $textType == 'editor';
setEditorEventHandlers($strTextFieldName);
?>
<textarea class="typearea" style="<?php
echo $curHTMLEd || $dontShowTA ? 'display:none;' : '';
?>
width:100%;height:<?php
echo $iHeight;
?>
px;" name="<?php
echo $strTextFieldName;
?>
" id="bxed_<?php
echo $strTextFieldName;
?>
" wrap="virtual" <?php
echo $textarea_field;
?>
><?php
echo htmlspecialcharsbx($strTextValue);
?>
</textarea>
<?php
if ($bWithoutPHP) {
$arTaskbars = array("BXPropertiesTaskbar", "BXSnippetsTaskbar");
} else {
if (!$arTaskbars) {
$arTaskbars = array("BXPropertiesTaskbar", "BXSnippetsTaskbar", "BXComponents2Taskbar");
}
}
$minHeight = $arAdditionalParams['minHeight'] ? intval($arAdditionalParams['minHeight']) : 450;
$arParams = array("bUseOnlyDefinedStyles" => COption::GetOptionString("fileman", "show_untitled_styles", "N") != "Y", "bFromTextarea" => true, "bDisplay" => $curHTMLEd, "bWithoutPHP" => $bWithoutPHP, "arTaskbars" => $arTaskbars, "height" => max($iHeight, $minHeight));
if (isset($arAdditionalParams['use_editor_3'])) {
$arParams['use_editor_3'] = $arAdditionalParams['use_editor_3'];
}
$arParams['site'] = strlen($site) <= 0 ? LANG : $site;
if (isset($arSize["width"])) {
$arParams["width"] = $arSize["width"];
}
if (isset($arAdditionalParams)) {
$arParams["arAdditionalParams"] = $arAdditionalParams;
}
if (isset($arAdditionalParams['limit_php_access'])) {
$arParams['limit_php_access'] = $arAdditionalParams['limit_php_access'];
}
if (isset($arAdditionalParams['toolbarConfig'])) {
$arParams['toolbarConfig'] = $arAdditionalParams['toolbarConfig'];
}
if (isset($arAdditionalParams['componentFilter'])) {
$arParams['componentFilter'] = $arAdditionalParams['componentFilter'];
}
$arParams['setFocusAfterShow'] = isset($arParams['setFocusAfterShow']) ? $arParams['setFocusAfterShow'] : false;
CFileman::ShowHTMLEditControl($strTextFieldName, $strTextValue, $arParams);
}