Class THtmlArea
THtmlArea class
THtmlArea wraps the visual editting functionalities provided by the TinyMCE project http://tinymce.moxiecode.com/. THtmlArea displays a WYSIWYG text area on the Web page for user input in the HTML format. The text displayed in the THtmlArea component is specified or determined by using the Text property. To enable the visual editting on the client side, set the property EnableVisualEdit to true (which is default value). To set the size of the editor when the visual editting is enabled, set the Width and Height properties instead of Columns and Rows because the latter has no meaning under the situation. The default editor gives only the basic tool bar. To change or add additional tool bars, use the Options property to add additional editor options with each options on a new line. See http://tinymce.moxiecode.com/tinymce/docs/index.html for a list of options. The options can be change/added as shown in the following example. - <com:THtmlArea>
- <prop:Options>
- plugins : "contextmenu,paste"
- language : "zh_cn"
- </prop:Options>
- </com:THtmlArea>
Compatibility The client-side visual editting capability is supported by Internet Explorer 5.0+ for Windows and Gecko-based browser. If the browser does not support the visual editting, a traditional textarea will be displayed. Browser support - Windows XP MacOS X 10.4
- ----------------------------------------------------
- MSIE 6 OK
- MSIE 5.5 SP2 OK
- MSIE 5.0 OK
- Mozilla 1.7.x OK OK
- Firefox 1.0.x OK OK
- Firefox 1.5b2 OK OK
- Safari 2.0 (412) OK(1)
- Opera 9 Preview 1 OK(1) OK(1)
- ----------------------------------------------------
- * (1) - Partialy working
- ----------------------------------------------------
Constants Inherited From TControl |
AUTOMATIC_ID_PREFIX,
CLIENT_ID_SEPARATOR,
CS_CHILD_INITIALIZED,
CS_CONSTRUCTED,
CS_INITIALIZED,
CS_LOADED,
CS_PRERENDERED,
CS_STATE_LOADED,
ID_FORMAT,
ID_SEPARATOR,
IS_CHILD_CREATED,
IS_CREATING_CHILD,
IS_DISABLE_THEMING,
IS_DISABLE_VIEWSTATE,
IS_ID_SET,
IS_SKIN_APPLIED,
IS_STYLESHEET_APPLIED,
RF_ADAPTER,
RF_AUTO_BINDINGS,
RF_CHILD_STATE,
RF_CONTROLS,
RF_CONTROLSTATE,
RF_DATA_BINDINGS,
RF_EVENTS,
RF_NAMED_CONTROLS,
RF_NAMED_CONTROLS_ID,
RF_NAMED_OBJECTS,
RF_SKIN_ID,
|
Constructor Summary |
public |
Constructor.
|
Method Summary |
protected
void
|
Adds attribute name-value pairs to renderer.
|
protected
void
|
|
boolean
|
|
array
|
Returns a list of plugins to be loaded.
|
array
|
|
protected
string
|
Gets the name of the javascript class responsible for performing postback for this control.
|
string
|
Gets the current culture.
|
string
|
|
protected
array
|
Default editor options gives basic tool bar only.
|
boolean
|
|
boolean
|
|
protected
string
|
|
string
|
Gets the list of options for the WYSIWYG (TinyMCE) editor
|
protected
string
|
Gets the editor script base URL by publishing the tarred source via TTarAssetManager.
|
protected
string
|
|
string
|
Overrides the parent implementation.
|
protected
void
|
|
protected
array
|
Parse additional options set in the Options property.
|
protected
void
|
|
protected
void
|
Registers the editor javascript file and code to initialize the editor.
|
void
|
Sets the culture/language for the html area
|
void
|
|
void
|
|
void
|
Sets whether to show WYSIWYG text editor.
|
void
|
Sets the list of options for the WYSIWYG (TinyMCE) editor
|
void
|
Overrides the parent implementation.
|
Methods Inherited From TTextBox |
TTextBox::addAttributesToRender(), TTextBox::getAutoCompleteType(), TTextBox::getAutoPostBack(), TTextBox::getAutoTrim(), TTextBox::getCausesValidation(), TTextBox::getClientClassName(), TTextBox::getColumns(), TTextBox::getData(), TTextBox::getDataChanged(), TTextBox::getEnableClientScript(), TTextBox::getIsValid(), TTextBox::getMaxLength(), TTextBox::getPersistPassword(), TTextBox::getPostBackOptions(), TTextBox::getReadOnly(), TTextBox::getRows(), TTextBox::getSafeText(), TTextBox::getSafeTextParser(), TTextBox::getTagName(), TTextBox::getText(), TTextBox::getTextMode(), TTextBox::getValidationGroup(), TTextBox::getValidationPropertyValue(), TTextBox::getWrap(), TTextBox::loadPostData(), TTextBox::onTextChanged(), TTextBox::raisePostDataChangedEvent(), TTextBox::renderClientControlScript(), TTextBox::renderContents(), TTextBox::setAutoCompleteType(), TTextBox::setAutoPostBack(), TTextBox::setAutoTrim(), TTextBox::setCausesValidation(), TTextBox::setColumns(), TTextBox::setData(), TTextBox::setEnableClientScript(), TTextBox::setIsValid(), TTextBox::setMaxLength(), TTextBox::setPersistPassword(), TTextBox::setReadOnly(), TTextBox::setRows(), TTextBox::setText(), TTextBox::setTextMode(), TTextBox::setValidationGroup(), TTextBox::setWrap()
|
Methods Inherited From TWebControl |
TWebControl::addAttributesToRender(), TWebControl::clearStyle(), TWebControl::copyBaseAttributes(), TWebControl::createStyle(), TWebControl::getAccessKey(), TWebControl::getBackColor(), TWebControl::getBorderColor(), TWebControl::getBorderStyle(), TWebControl::getBorderWidth(), TWebControl::getCssClass(), TWebControl::getDisplay(), TWebControl::getFont(), TWebControl::getForeColor(), TWebControl::getHasStyle(), TWebControl::getHeight(), TWebControl::getStyle(), TWebControl::getTabIndex(), TWebControl::getTagName(), TWebControl::getToolTip(), TWebControl::getWidth(), TWebControl::render(), TWebControl::renderBeginTag(), TWebControl::renderContents(), TWebControl::renderEndTag(), TWebControl::setAccessKey(), TWebControl::setBackColor(), TWebControl::setBorderColor(), TWebControl::setBorderStyle(), TWebControl::setBorderWidth(), TWebControl::setCssClass(), TWebControl::setDisplay(), TWebControl::setForeColor(), TWebControl::setHeight(), TWebControl::setStyle(), TWebControl::setTabIndex(), TWebControl::setToolTip(), TWebControl::setWidth()
|
Methods Inherited From TControl |
TControl::addedControl(), TControl::addParsedObject(), TControl::addToPostDataLoader(), TControl::applyStyleSheetSkin(), TControl::autoBindProperty(), TControl::autoDataBindProperties(), TControl::bindProperty(), TControl::broadcastEvent(), TControl::bubbleEvent(), TControl::clearChildState(), TControl::clearControlState(), TControl::clearNamingContainer(), TControl::clearViewState(), TControl::convertUniqueIdToClientId(), TControl::createChildControls(), TControl::createControlCollection(), TControl::dataBind(), TControl::dataBindChildren(), TControl::dataBindProperties(), TControl::ensureChildControls(), TControl::findControl(), TControl::findControlsByID(), TControl::findControlsByType(), TControl::focus(), TControl::getAdapter(), TControl::getAllowChildControls(), TControl::getAttribute(), TControl::getAttributes(), TControl::getChildControlsCreated(), TControl::getClientID(), TControl::getControls(), TControl::getControlStage(), TControl::getControlState(), TControl::getCustomData(), TControl::getEnabled(), TControl::getEnableTheming(), TControl::getEnableViewState(), TControl::getHasAdapter(), TControl::getHasAttributes(), TControl::getHasChildInitialized(), TControl::getHasControls(), TControl::getHasInitialized(), TControl::getHasLoaded(), TControl::getHasLoadedPostData(), TControl::getHasPreRendered(), TControl::getID(), TControl::getNamingContainer(), TControl::getPage(), TControl::getParent(), TControl::getRegisteredObject(), TControl::getSkinID(), TControl::getSourceTemplateControl(), TControl::getTemplateControl(), TControl::getUniqueID(), TControl::getViewState(), TControl::getVisible(), TControl::hasAttribute(), TControl::initRecursive(), TControl::isDescendentOf(), TControl::isObjectRegistered(), TControl::loadRecursive(), TControl::loadState(), TControl::loadStateRecursive(), TControl::onDataBinding(), TControl::onInit(), TControl::onLoad(), TControl::onPreRender(), TControl::onUnload(), TControl::preRenderRecursive(), TControl::raiseBubbleEvent(), TControl::registerObject(), TControl::removeAttribute(), TControl::removedControl(), TControl::render(), TControl::renderChildren(), TControl::renderControl(), TControl::saveState(), TControl::saveStateRecursive(), TControl::setAdapter(), TControl::setAttribute(), TControl::setChildControlsCreated(), TControl::setControlStage(), TControl::setControlState(), TControl::setCustomData(), TControl::setEnabled(), TControl::setEnableTheming(), TControl::setEnableViewState(), TControl::setID(), TControl::setPage(), TControl::setSkinID(), TControl::setTemplateControl(), TControl::setViewState(), TControl::setVisible(), TControl::trackViewState(), TControl::traverseChildControls(), TControl::unbindProperty(), TControl::unloadRecursive(), TControl::unregisterObject(), TControl::__get()
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Constructor Details |
__construct
Constructor.
Sets default width and height.
|
Method Details |
addAttributesToRender
protected void addAttributesToRender |
(THtmlWriter $writer ) |
Adds attribute name-value pairs to renderer.
This method overrides the parent implementation by registering additional javacript code.
Input |
THtmlWriter | $writer | the writer used for the rendering purpose |
Output |
Exception |
|
copyCustomPlugins
protected void copyCustomPlugins |
(mixed $url ) |
Input |
mixed | $url | |
Output |
Exception |
|
getAutoPostBack
public boolean getAutoPostBack |
() |
Output |
boolean
| whether change of the content should cause postback. Return false if EnableVisualEdit is true. |
Exception |
|
getAvailablePlugins
public array getAvailablePlugins |
() |
Returns a list of plugins to be loaded.
Override this method to customize.
Output |
array
| list of plugins to be loaded |
Exception |
|
getAvailableThemes
public array getAvailableThemes |
() |
Output |
array
| list of available themese |
Exception |
|
getClientClassName
protected string getClientClassName |
() |
Gets the name of the javascript class responsible for performing postback for this control.
This method overrides the parent implementation.
Output |
string
| the javascript class name |
Exception |
|
getCulture
public string getCulture |
() |
Gets the current culture.
Output |
string
| current culture, e.g. en_AU. |
Exception |
|
getCustomPluginPath
public string getCustomPluginPath |
() |
Output |
string
| path to custom plugins to be copied. |
Exception |
|
getEditorOptions
protected array getEditorOptions |
() |
Default editor options gives basic tool bar only.
Output |
array
| editor initialization options. |
Exception |
|
getEnableCompression
public boolean getEnableCompression |
() |
Output |
boolean
| enable compression of the javascript files, default is true. |
Exception |
|
getEnableVisualEdit
public boolean getEnableVisualEdit |
() |
Output |
boolean
| whether to show WYSIWYG text editor. Defaults to true. |
Exception |
|
getLanguageSuffix
protected string getLanguageSuffix |
(mixed $culture ) |
Input |
mixed | $culture | |
Output |
string
| localized editor interface language extension. |
Exception |
|
getOptions
public string getOptions |
() |
Gets the list of options for the WYSIWYG (TinyMCE) editor
Output |
string
| options |
Exception |
|
getScriptDeploymentPath
protected string getScriptDeploymentPath |
() |
Gets the editor script base URL by publishing the tarred source via TTarAssetManager.
Output |
string
| URL base path to the published editor script |
Exception |
|
getScriptUrl
protected string getScriptUrl |
() |
Output |
string
| editor script URL. |
Exception |
|
getTextMode
public string getTextMode |
() |
Overrides the parent implementation.
TextMode for THtmlArea control is always 'MultiLine'
Output |
string
| the behavior mode of the THtmlArea component. |
Exception |
|
loadJavascriptLibrary
protected void loadJavascriptLibrary |
() |
|
parseEditorOptions
protected array parseEditorOptions |
(mixed $string ) |
Parse additional options set in the Options property.
Input |
mixed | $string | |
Output |
array
| additional custom options |
Exception |
|
preLoadCompressedScript
protected void preLoadCompressedScript |
() |
|
registerEditorClientScript
protected void registerEditorClientScript |
(mixed $writer ) |
Registers the editor javascript file and code to initialize the editor.
Input |
mixed | $writer | |
Output |
Exception |
|
setCulture
public void setCulture |
(string $value ) |
Sets the culture/language for the html area
Input |
string | $value | a culture string, e.g. en_AU. |
Output |
Exception |
|
setCustomPluginPath
public void setCustomPluginPath |
(string $value ) |
Input |
string | $value | path to custom plugins to be copied. |
Output |
Exception |
|
setEnableCompression
public void setEnableCompression |
(boolean $value ) |
Input |
boolean | $value | enable compression of the javascript files, default is true. |
Output |
Exception |
|
setEnableVisualEdit
public void setEnableVisualEdit |
(boolean $value ) |
Sets whether to show WYSIWYG text editor.
Input |
boolean | $value | whether to show WYSIWYG text editor |
Output |
Exception |
|
setOptions
public void setOptions |
(string $value ) |
Sets the list of options for the WYSIWYG (TinyMCE) editor
Input |
string | $value | options |
Output |
Exception |
|
setTextMode
public void setTextMode |
(string $value ) |
Overrides the parent implementation.
TextMode for THtmlArea is always 'MultiLine' and cannot be changed to others.
Input |
string | $value | the text mode |
Output |
Exception |
|
|