Class midcom_helper_datamanager_widget_html

Description

This is a WYSIWYG HTML widget, built on HTMLArea.

This widget should only be used with the text type configured to an unlimited-length field.

Configuration parameters:

widget_html_stripmstags: This option will activate a couple of regular expressions that filter out a lot of the crap that M$ products like Word insert into the stuff they copy into the clipborard. If you leave this deactivated, any content copy/pasted from Word will most probably override your site style in almost any thinkable way. As this modifies content, this is disabled by default.

widget_html_css_url: The CSS file in this URL is used by the HTMLArea to render the content within the HTMLArea to have a better preview what the content will look like on-site. Note, that with strongly CSS formatted content, this is not always a good idea.

widget_htmlarea_customconfig: The most powerful and complex part of the HTMLArea configuration. It is inserted into the HTMLArea startup code and allows you to adapt the widget to your personal surroundings. The example below gives you an insight what can be possible, albeit it is far from complete. Refer to the HTMLArea documentation for details about this.

Sample configuration

 "html" => array (
     "description" => "WYSIWYG HTML",
     "datatype" => "text",
     "location" => "attachment",
     "widget" => "html",
     "widget_html_stripmstags" => true,
     "widget_html_css_url" => "http://my.host.com/css/htmlarea_iframe.css",
     "widget_html_customconfig" => <<

CSS Styles in use by the Widget

The select widget will be both of select.list and select.multiple.

HTMLArea licence information

Portions (c) dynarch.com, 2003-2004

A free WYSIWYG editor replacement for <textarea> fields. For full source code and docs, visit http://www.interactivetools.com/ or http://www.htmlarea.com/

Version 3.0 developed by Mihai Bazon. http://dynarch.com/mishoo

  • todo: Add a section about configuration of HTMLArea or at least add a corresponding docuemnt to the distribution.

Located in /midcom/helper/datamanager/widget_html.php (line 86)

midcom_helper_datamanager_widget
   |
   --midcom_helper_datamanager_widget_html
Variable Summary
 string $_css_url
 bool $_tidy
Method Summary
 void draw_view ()
 void draw_widget ()
 void _constructor (mixed &$datamanager, mixed $field, mixed $defaultvalue)
 string _get_config_js ()
 void _preloadImages ()
 void _read_formdata ()
Variables
string $_css_url (line 94)

The URL of the CSS file to use inside of the HTMLArea.

  • access: private
string $_customconfig (line 102)

Custom JScript configuration block

  • access: private
bool $_stripmstags (line 110)

Flag to enable the M$ HTML crap filter(tm).

  • access: private
bool $_tidy (line 119)

Flag to enable HTML Tidy cleaning Requires the PECL Tidy extension

  • access: private

Inherited Variables

Inherited from midcom_helper_datamanager_widget

midcom_helper_datamanager_widget::$missingrequired
midcom_helper_datamanager_widget::$required
midcom_helper_datamanager_widget::$_datamanager
midcom_helper_datamanager_widget::$_field
midcom_helper_datamanager_widget::$_fieldname
midcom_helper_datamanager_widget::$_l10n
midcom_helper_datamanager_widget::$_l10n_midcom
midcom_helper_datamanager_widget::$_value
Methods
draw_view (line 200)
void draw_view ()

Redefinition of:
midcom_helper_datamanager_widget::draw_view()
Wenn called, this method should display the current data without any editing widget.
draw_widget (line 205)
void draw_widget ()

Redefinition of:
midcom_helper_datamanager_widget::draw_widget()
This method draws the HTML-Form widgets required to edit the data. This can be anything from a single form tag to a full list of them. Note, that you will be automatically enclosed within the calls to draw_widget_start and draw_widget_end.
_constructor (line 125)

The constructor will add the corresponding Javascript code only if we are running AIS. On-Site usage is not yet possible.

void _constructor (mixed &$datamanager, mixed $field, mixed $defaultvalue)

Redefinition of:
midcom_helper_datamanager_widget::_constructor()
The constructor populates the internal members with a reference to the datamanger we belong to, the definition of the field we use and the default value we should use to initialize the widget's data.
_get_config_js (line 302)

Prepares the HTMLArea configuration scriptlet. It will search the templates in this order:

  • /sitegroup-config/midcom.helper.datamanager.widget_html/config
  • file:/midcom/helper/datamanager/config/midcom.helper.datamanger.widget_html
  • local fallback default configuration
Look at the source of this function how your template should look like.

  • return: JS configuration code for the current HTMLArea
string _get_config_js ()
_preloadImages (line 384)

Preload images used by htmlarea.

This makes HTMLArea more stable in IE.

  • access: private
void _preloadImages ()
_read_formdata (line 229)

Overridden to allow for the post-processing of the HTMLArea generated content.

Two things happen:

  • First, a newline will be added after all closing td, tr, table,
p and div tags for better readability of the source
  • Second, if enabled, the M$ HTML crap filter (tm) is invoked.
The M$ HTML crap filter(tm):

It will remove about this, and is incomplete yet:

  • mso, navigointipaa1 and windowtext tags within p, b, div and span tags
  • all font tags
  • all msnormal class tags
This might be replaced by HTMLTidy on the long run.

void _read_formdata ()

Redefinition of:
midcom_helper_datamanager_widget::_read_formdata()
Reads the HTTP POST request data if available.

Inherited Methods

Inherited From midcom_helper_datamanager_widget

 midcom_helper_datamanager_widget::midcom_helper_datamanager_widget()
 midcom_helper_datamanager_widget::draw_helptext()
 midcom_helper_datamanager_widget::draw_view()
 midcom_helper_datamanager_widget::draw_widget()
 midcom_helper_datamanager_widget::draw_widget_end()
 midcom_helper_datamanager_widget::draw_widget_start()
 midcom_helper_datamanager_widget::get_css_classes_required()
 midcom_helper_datamanager_widget::get_value()
 midcom_helper_datamanager_widget::set_value()
 midcom_helper_datamanager_widget::_constructor()
 midcom_helper_datamanager_widget::_read_formdata()

Documentation generated on Mon, 21 Nov 2005 18:24:44 +0100 by phpDocumentor 1.3.0RC3