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 9 Preview 1 OK(1) OK(1)
  11. ----------------------------------------------------
  12. * (1) - Partialy working
  13. ----------------------------------------------------

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

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

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

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

Documentation generated on Mon, 21 Apr 2008 11:35:06 -0400 by phpDocumentor 1.3.0RC4