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.

  1.  <com:THtmlArea>
  2.       <prop:Options>
  3.            plugins "contextmenu,paste"
  4.            language "zh_cn"
  5.       </prop:Options>
  6.  </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

  1.                     Windows XP        MacOS X 10.4
  2.  ----------------------------------------------------
  3.  MSIE 6                  OK
  4.  MSIE 5.5 SP2            OK
  5.  MSIE 5.0                OK
  6.  Mozilla 1.7.x           OK              OK
  7.  Firefox 1.0.x           OK              OK
  8.  Firefox 1.5b2           OK              OK
  9.  Safari 2.0 (412)                        OK(1)
  10.  Opera Preview 1       OK(1)           OK(1)
  11.  ----------------------------------------------------
  12.     * (1Partialy working
  13.  ----------------------------------------------------

  • author: Wei Zhuo <weizhuo[at]gmail[dot]com>
  • version: $Id: THtmlArea.php 3159 2012-06-01 18:01:40Z ctrlaltca $
  • since: 3.0

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

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
            |
            --TTextBox
               |
               --THtmlArea
Method Summary
THtmlArea __construct ()
void copyCustomPlugins ( $url)
boolean getAutoPostBack ()
string getClientClassName ()
string getCulture ()
array getEditorOptions ()
boolean getEnableVisualEdit ()
string getLanguageSuffix ( $culture)
string getOptions ()
string getScriptUrl ()
string getTextMode ()
array parseEditorOptions ( $string)
void registerEditorClientScript ( $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)
Variables

Inherited Variables

Inherited from TWebControl

TWebControl::$_decorator
Methods
Constructor __construct (line 222)

Constructor.

Sets default width and height.

  • access: public
THtmlArea __construct ()

Redefinition of:
TControl::__construct()
Constructor.
addAttributesToRender (line 349)

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.
copyCustomPlugins (line 440)
  • access: protected
void copyCustomPlugins ( $url)
  • $url
getAutoPostBack (line 251)
  • 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 365)

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 373)
  • return: list of available themese
  • access: public
array getAvailableThemes ()
getClientClassName (line 530)

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.
getCompressionOptions (line 378)
  • access: protected
void getCompressionOptions ()
getCulture (line 277)

Gets the current culture.

  • return: current culture, e.g. en_AU.
  • access: public
string getCulture ()
getCustomPluginPath (line 322)
  • return: path to custom plugins to be copied.
  • access: public
string getCustomPluginPath ()
getEditorOptions (line 456)

Default editor options gives basic tool bar only.

  • return: editor initialization options.
  • access: protected
array getEditorOptions ()
getEnableCompression (line 330)
  • return: enable compression of the javascript files, default is true.
  • access: public
boolean getEnableCompression ()
getEnableVisualEdit (line 259)
  • return: whether to show WYSIWYG text editor. Defaults to true.
  • access: public
boolean getEnableVisualEdit ()
getLanguageSuffix (line 507)
  • return: localized editor interface language extension.
  • access: protected
string getLanguageSuffix ( $culture)
  • $culture
getOptions (line 296)

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

string getOptions ()
getScriptDeploymentPath (line 429)

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 417)
  • return: editor script URL.
  • access: protected
string getScriptUrl ()
getTextMode (line 233)

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 389)
  • access: protected
void loadJavascriptLibrary ()
parseEditorOptions (line 483)

Parse additional options set in the Options property.

  • return: additional custom options
  • access: protected
array parseEditorOptions ( $string)
  • $string
registerEditorClientScript (line 399)

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

  • access: protected
void registerEditorClientScript ( $writer)
  • $writer
setCulture (line 286)

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 314)
  • access: public
void setCustomPluginPath (string $value)
  • string $value: path to custom plugins to be copied.
setEnableCompression (line 338)
  • access: public
void setEnableCompression (boolean $value)
  • boolean $value: enable compression of the javascript files, default is true.
setEnableVisualEdit (line 268)

Sets whether to show WYSIWYG text editor.

  • access: public
void setEnableVisualEdit (boolean $value)
  • boolean $value: whether to show WYSIWYG text editor
setOptions (line 306)

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

void setOptions (string $value)
  • string $value: options
setTextMode (line 243)

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

Inherited From TWebControl

TWebControl::addAttributesToRender()
TWebControl::clearStyle()
TWebControl::copyBaseAttributes()
TWebControl::createStyle()
TWebControl::getAccessKey()
TWebControl::getBackColor()
TWebControl::getBorderColor()
TWebControl::getBorderStyle()
TWebControl::getBorderWidth()
TWebControl::getCssClass()
TWebControl::getDecorator()
TWebControl::getDisplay()
TWebControl::getEnsureId()
TWebControl::getFont()
TWebControl::getForeColor()
TWebControl::getHasStyle()
TWebControl::getHeight()
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getTagName()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::onPreRender()
TWebControl::render()
TWebControl::renderBeginTag()
TWebControl::renderContents()
TWebControl::renderEndTag()
TWebControl::setAccessKey()
TWebControl::setBackColor()
TWebControl::setBorderColor()
TWebControl::setBorderStyle()
TWebControl::setBorderWidth()
TWebControl::setCssClass()
TWebControl::setDisplay()
TWebControl::setEnsureId()
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::getIsSkinApplied()
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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants

Documentation generated on Mon, 25 Jun 2012 14:38:20 +0200 by phpDocumentor 1.4.3