## Class THtmlArea

Description

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
     ----------------------------------------------------

- since: 3.0
- version: $Id: THtmlArea.php 1929 2007-05-10 23:37:57Z wei $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /Web/UI/WebControls/THtmlArea.php (line 79)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TTextBox
                   |
                   --THtmlArea

Method Summary
THtmlArea __construct ()
void addAttributesToRender (THtmlWriter $writer)
void applyJavascriptFixes ()
void copyCustomPlugins (mixed $url)
boolean getAutoPostBack ()
array getAvailablePlugins ()
array getAvailableThemes ()
string getClientClassName ()
string getCulture ()
string getCustomPluginPath ()
array getEditorOptions ()
boolean getEnableCompression ()
boolean getEnableVisualEdit ()
string getLanguageSuffix (mixed $culture)
string getOptions ()
string getScriptDeploymentPath ()
string getScriptUrl ()
string getTextMode ()
void loadJavascriptLibrary ()
array parseEditorOptions (mixed $string)
void preLoadCompressedScript ()
void registerEditorClientScript (mixed $writer)
void setCulture (string $value)
void setCustomPluginPath (string $value)
void setEnableCompression (boolean $value)
void setEnableVisualEdit (boolean $value)
void setOptions (string $value)
void setTextMode (string $value)
Methods
Constructor __construct (line 166)

Constructor.

Sets default width and height.

- access: public

THtmlArea __construct ()

Redefinition of:

TControl::__construct()
  Constructor.

addAttributesToRender (line 293)

Adds attribute name-value pairs to renderer.

This method overrides the parent implementation by registering additional javacript code.

- access: protected

void addAttributesToRender (THtmlWriter $writer)

- THtmlWriter $writer: the writer used for the rendering purpose

Redefinition of:

TTextBox::addAttributesToRender()
  Adds attribute name-value pairs to renderer.

applyJavascriptFixes (line 354)

Changes the TinyMCE triggerSave() function to allow for missing textareas.

- access: protected

void applyJavascriptFixes ()
copyCustomPlugins (line 408)

- access: protected

void copyCustomPlugins (mixed $url)
getAutoPostBack (line 195)

- return: whether change of the content should cause postback. Return false if EnableVisualEdit is true.
- access: public

boolean getAutoPostBack ()

Redefinition of:

TTextBox::getAutoPostBack()

getAvailablePlugins (line 314)

Returns a list of plugins to be loaded.

Override this method to customize.

- return: list of plugins to be loaded
- access: public

array getAvailablePlugins ()
getAvailableThemes (line 322)

- return: list of available themese
- access: public

array getAvailableThemes ()
getClientClassName (line 491)

Gets the name of the javascript class responsible for performing postback for this control.

This method overrides the parent implementation.

- return: the javascript class name
- access: protected

string getClientClassName ()

Redefinition of:

TTextBox::getClientClassName()
  Gets the name of the javascript class responsible for performing postback for this control.

getCulture (line 221)

Gets the current culture.

- return: current culture, e.g. en_AU.
- access: public

string getCulture ()
getCustomPluginPath (line 266)

- return: path to custom plugins to be copied.
- access: public

string getCustomPluginPath ()
getEditorOptions (line 424)

Default editor options gives basic tool bar only.

- return: editor initialization options.
- access: protected

array getEditorOptions ()
getEnableCompression (line 274)

- return: enable compression of the javascript files, default is true.
- access: public

boolean getEnableCompression ()
getEnableVisualEdit (line 203)

- return: whether to show WYSIWYG text editor. Defaults to true.
- access: public

boolean getEnableVisualEdit ()
getLanguageSuffix (line 468)

- return: localized editor interface language extension.
- access: protected

string getLanguageSuffix (mixed $culture)
getOptions (line 240)

Gets the list of options for the WYSIWYG (TinyMCE) editor

- return: options
- access: public
- see: http://tinymce.moxiecode.com/tinymce/docs/index.html

string getOptions ()
getScriptDeploymentPath (line 397)

Gets the editor script base URL by publishing the tarred source via TTarAssetManager.

- return: URL base path to the published editor script
- access: protected

string getScriptDeploymentPath ()
getScriptUrl (line 385)

- return: editor script URL.
- access: protected

string getScriptUrl ()
getTextMode (line 177)

Overrides the parent implementation.

TextMode for THtmlArea control is always 'MultiLine'

- return: the behavior mode of the THtmlArea component.
- access: public

string getTextMode ()

Redefinition of:

TTextBox::getTextMode()

loadJavascriptLibrary (line 344)

- access: protected

void loadJavascriptLibrary ()
parseEditorOptions (line 451)

Parse additional options set in the Options property.

- return: additional custom options
- access: protected

array parseEditorOptions (mixed $string)
preLoadCompressedScript (line 327)

- access: protected

void preLoadCompressedScript ()
registerEditorClientScript (line 374)

Registers the editor javascript file and code to initialize the editor.

- access: protected

void registerEditorClientScript (mixed $writer)
setCulture (line 230)

Sets the culture/language for the html area

- access: public

void setCulture (string $value)

- string $value: a culture string, e.g. en_AU.

setCustomPluginPath (line 258)

- access: public

void setCustomPluginPath (string $value)

- string $value: path to custom plugins to be copied.

setEnableCompression (line 282)

- access: public

void setEnableCompression (boolean $value)

- boolean $value: enable compression of the javascript files, default is true.

setEnableVisualEdit (line 212)

Sets whether to show WYSIWYG text editor.

- access: public

void setEnableVisualEdit (boolean $value)

- boolean $value: whether to show WYSIWYG text editor

setOptions (line 250)

Sets the list of options for the WYSIWYG (TinyMCE) editor

- access: public
- see: http://tinymce.moxiecode.com/tinymce/docs/index.html

void setOptions (string $value)

- string $value: options

setTextMode (line 187)

Overrides the parent implementation.

TextMode for THtmlArea is always 'MultiLine' and cannot be changed to others.

- access: public

void setTextMode (string $value)

- string $value: the text mode

Redefinition of:

TTextBox::setTextMode()
  Sets the behavior mode of the TTextBox component.

#### Inherited 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::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::setMaxLength()
> TTextBox::setPersistPassword()
> TTextBox::setReadOnly()
> TTextBox::setRows()
> TTextBox::setText()
> TTextBox::setTextMode()
> TTextBox::setValidationGroup()
> TTextBox::setWrap()

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()

Inherited From TControl

> TControl::__construct()
> 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()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

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()

Class Constants

#### Inherited Constants

Inherited from TTextBox

> TTextBox::DEFAULT_COLUMNS
> TTextBox::DEFAULT_ROWS

Inherited from TControl

> TControl::AUTOMATIC_ID_PREFIX
> TControl::CLIENT_ID_SEPARATOR
> TControl::CS_CHILD_INITIALIZED
> TControl::CS_CONSTRUCTED
> TControl::CS_INITIALIZED
> TControl::CS_LOADED
> TControl::CS_PRERENDERED
> TControl::CS_STATE_LOADED
> TControl::ID_FORMAT
> TControl::ID_SEPARATOR
> TControl::IS_CHILD_CREATED
> TControl::IS_CREATING_CHILD
> TControl::IS_DISABLE_THEMING
> TControl::IS_DISABLE_VIEWSTATE
> TControl::IS_ID_SET
> TControl::IS_SKIN_APPLIED
> TControl::IS_STYLESHEET_APPLIED
> TControl::RF_ADAPTER
> TControl::RF_AUTO_BINDINGS
> TControl::RF_CHILD_STATE
> TControl::RF_CONTROLS
> TControl::RF_CONTROLSTATE
> TControl::RF_DATA_BINDINGS
> TControl::RF_EVENTS
> TControl::RF_NAMED_CONTROLS
> TControl::RF_NAMED_CONTROLS_ID
> TControl::RF_NAMED_OBJECTS
> TControl::RF_SKIN_ID

Documentation generated on Sun, 30 Sep 2007 19:16:14 -0400 by phpDocumentor 1.3.0RC4