Skip to main content
PHP HTML Editor

Classic API

richtexteditor/include_rte.php defines the RichTextEditor class of the previous Rich Text Editor for PHP. Pages written for it run unchanged; this page lists what each member does now.

Methods

MethodWhat it does
MvcInit()Answers this editor's upload, gallery and file requests and ends them; does nothing on a normal view. Call it before any output.
GetString(), Render(), ToString()Returns the editor's HTML: a textarea named Name and the script that turns it into the editor. The scripts are written once per page.
RichTextEditor::GetPostedHtml($name, $policyFile = 'default.config')The posted HTML of an editor, sanitized. Use it instead of $_POST[$name].
SetSecurity($category, $storage, $name, $value)Overrides one policy setting, for example SetSecurity("Image", "default", "AllowUpload", "false"). "*" matches every category or storage.
SetConfig($name, $value)Sets an option of the JavaScript editor by its new name, for example SetConfig("toolbar_custom", "{bold,italic}|{insertlink}").
LoadConfigFile()Returns the policy (a PhpHtmlEditor\Policy) with SetSecurity() applied.
LoadHTML($path), LoadFile($path)Loads the content from a file: a path relative to the page, or ~/... from the web root.
LoadFormData($html), set_Text($html), get_Text()Sets or reads the content. Setting it sanitizes it with the policy, as before.
PlainText()The content as plain text.
WebToPhy($path), GetAppRoot(), SetApplicationRoot($dir, $url)Path helpers; SetApplicationRoot() sets what ~/ means in policies.

Properties that work

PropertyEffect now
Name (ID)The form field name and the editor's id.
Text (XHTML)The content, sanitized when set.
Width, HeightSize; a plain number means pixels.
Toolbardefault, basic, full, mobile, office. Old names map: ribbon to full; lite, email, forum to basic.
SkinOld skins map to the new ones: names with blue to blue, silver/gray to gray, others to default.
SecurityPolicyFileThe policy file in richtexteditor/config.
LanguageA language code from richtexteditor/lang, for example de.
ReadOnly, MaxTextLength, MaxHTMLLengthAs before.
ContentCss, ContentCssText, EditorBodyClass, EditorBodyStyleStyles of the editing area.
EnterKeyTagp, div or br.
PasteMode, URLType, ResizeModeMapped by meaning to the new options (for example a "disabled" resize mode becomes none).
ShowTagList, ShowStatisticsStatus bar contents.
TagBlackList, AttrBlackList, StyleBlackListAdded to the server-side cleaning.

Properties accepted and ignored

These settings of the previous editor have no counterpart. Setting them does nothing and raises no error, so old pages keep running. Unknown properties are ignored the same way.

UploaderName, Version, LoadDelay, RenderSupportAjax, EnableDragDrop, PreviewCss, PreviewCssText, ToolbarItems, DisabledItems, TextDirection, ShiftEnterKeyTag, EditorMode, FullScreen, ToggleBorder, DesignDocType, SaveButtonScript, SaveButtonMode, ContextMenuMode, EnableContextMenu, EnableIEBorderRadius, EnableAntiSpamEmailEncoder, EnableObjectResizing, BaseHref, EditorBodyId, DisableClassList, AutoParseClasses, AutoFocus, ShowRulers, ShowEditMode, ShowCodeMode, ShowPreviewMode, ShowZoomView, ShowResizeCorner, ShowBottomBar, ShowLinkbar, ShowToolbar, ShowCodeToolbar, ShowPreviewToolbar, AllowScriptCode, UseHTMLEntities, EditCompleteDocument, AjaxPostbackUrl, Uploader, FilterBegin, FilterEnd, TabSpaces, TempDirectory, RTEClient