## 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: $Revision: $ $Date: $
- 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)
boolean getAutoPostBack ()
string getCulture ()
array getEditorOptions ()
boolean getEnableVisualEdit ()
string getLanguageSuffix (mixed $culture)
string getOptions ()
string getScriptDeploymentPath ()
string getScriptUrl ()
string getTextMode ()
array parseEditorOptions (mixed $string)
void registerEditorClientScript (mixed $writer)
void setCulture (string $value)
void setEnableVisualEdit (boolean $value)
void setOptions (string $value)
void setTextMode (string $value)
Methods
Constructor __construct (line 125)

Constructor.

Sets default width and height.

- access: public

THtmlArea __construct ()

Redefinition of:

TControl::__construct()
  Constructor.

addAttributesToRender (line 220)

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.

getAutoPostBack (line 154)

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

boolean getAutoPostBack ()

Redefinition of:

TTextBox::getAutoPostBack()

getCulture (line 180)

Gets the current culture.

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

string getCulture ()
getEditorOptions (line 268)

Default editor options gives basic tool bar only.

- return: editor initialization options.
- access: protected

array getEditorOptions ()
getEnableVisualEdit (line 162)

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

boolean getEnableVisualEdit ()
getLanguageSuffix (line 311)

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

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

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

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

- return: editor script URL.
- access: protected

string getScriptUrl ()
getTextMode (line 136)

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

parseEditorOptions (line 295)

Parse additional options set in the Options property.

- return: additional custom options
- access: protected

array parseEditorOptions (mixed $string)
registerEditorClientScript (line 233)

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

- access: protected

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

Sets the culture/language for the html area

- access: public

void setCulture (string $value)

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

setEnableVisualEdit (line 171)

Sets whether to show WYSIWYG text editor.

- access: public

void setEnableVisualEdit (boolean $value)

- boolean $value: whether to show WYSIWYG text editor

setOptions (line 209)

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

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 (SingleLine, MultiLine, or Password) of the TTextBox component.

#### Inherited Methods

Inherited From TTextBox

> TTextBox::addAttributesToRender()
> TTextBox::getAutoCompleteType()
> TTextBox::getAutoPostBack()
> TTextBox::getAutoTrim()
> TTextBox::getCausesValidation()
> TTextBox::getColumns()
> TTextBox::getMaxLength()
> 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::renderContents()
> TTextBox::setAutoCompleteType()
> TTextBox::setAutoPostBack()
> TTextBox::setAutoTrim()
> TTextBox::setCausesValidation()
> TTextBox::setColumns()
> TTextBox::setMaxLength()
> TTextBox::setReadOnly()
> TTextBox::setRows()
> TTextBox::setText()
> TTextBox::setTextMode()
> TTextBox::setValidationGroup()
> TTextBox::setWrap()

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> 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::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> 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::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> 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::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> 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::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> 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

Inherited from TControl

Documentation generated on Sun, 04 Jun 2006 18:59:27 -0400 by phpDocumentor 1.3.0RC4