Class midcom_helper_datamanager_widget_text

Description

This is a flexible text widget, that allows for input of plain text in several forms. Supported widgets are:

  • Simple single line text field ('shorttext')
  • Auto-wrapping textarea ('longtext')
  • Preformatted textarea ('longtext_preformatted')
  • Password field, it will show only a single * for an entered password ('password')
This widget is the default widget for these datatypes:

  • text
  • number
Configuration parameters:

widget_text_inputstyle: This defines the actual widget to use, as listed above, defaults to 'shorttext'.

widget_text_maxlength: The maximum input length, only relevant for the single line modes shorttext and password. It defaults to 255 there. The value will be ignored for the longtext fields. If set, this must be a positive integer number.

widget_text_height, widget_text_width: These to variables are only used with the longtext widgets, they allow you to override the size of the fields using the CSS width and height parameters while editing only. The style='' is used to override the default values.

Sample configuration

 "title" => array (
     "description" => "Title",
     "datatype" => "text",
     "location" => "title",
     "required" => true,
     "widget_text_inputstyle" => "longtext",
     "widget_text_height" => "5em",
     // Example for the shorttext (default) input style
     // "widget_text_maxlength" => 60,
 ),

CSS Styles in use by the Widget

The input fields have one of these CSS classes assigned to them in respect to the selected inputstyle:

  • input.shorttext
  • textarea.longtext
  • textarea.longtext_preformatted
  • input.password

Located in /midcom/helper/datamanager/widget_text.php (line 66)

midcom_helper_datamanager_widget
   |
   --midcom_helper_datamanager_widget_text
Variable Summary
 string $_height
 string $_inputstyle
 string $_width
Method Summary
 void draw_view ()
 void draw_widget ()
 void _constructor (mixed &$datamanager, mixed $field, mixed $defaultvalue)
 void _read_formdata ()
Variables
string $_height (line 94)

Height of longtext fields.

Remember to define em or px, as this uses CSS rules, this overrides any rules in ais.css.

  • access: private
string $_inputstyle (line 83)

The widget style to use, one of shorttext, longtext, longtext_preformatted or password.

  • access: private
int $_maxlength (line 74)

Maximum length of the input text for single-line fields.

  • access: private
string $_width (line 105)

Width of both long- and shorttext fields.

Remember to define em or px, as this uses CSS rules, this overrides any rules in ais.css.

  • 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 179)
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 198)
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 108)
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.
_read_formdata (line 265)

Overriden to handle the password style widget. It mustn't update in certain cases.

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:55 +0100 by phpDocumentor 1.3.0RC3