midcom_helper_datamanager_widgetThe widget concept is the interface to the user.
It displays both a simple view of the stored data within the AIS and the form elements required to modify this data. It also handles the interaction between the forms and the PHP-representation of the data.
A important point is that this is a base class for a class hierarchy of datatypes. To make creating child classes a littlebit easier and less error_prone, the classes constructor has been moved to the method _constructor, which can be overwritten by clients. The advantage of this is that you can just call parent:: on this and don't need to remeber the name of the parent class to call its constructor. As PHP automatically uses the parent classes constructor if non is defined, it is enough to define the _constructor method in the subclasses.
See also this PHP Manual Note:
If you have a complex class hierarchy, I find that it's a good idea to have a function constructor() in every class, and the 'real' php constructor only exists in the absolute base class. From the basic constructor, you call $this->constructor(). Now descendants simply have to call parent::constructor() in their own constructor, which eliminates complicated parent calls.
The default behavoir implemented in this class is sufficiant for data with a text-representation. It does not, however, implement the draw* methods.
Located in /midcom/helper/datamanager/widget.php (line 47)
| Class | Description |
|---|---|
midcom_helper_datamanager_widget_account
|
This is a simple widget for the account datatype, it queries username, password and password verification. |
midcom_helper_datamanager_widget_blob
|
This is a widget to handle binary attachments. |
midcom_helper_datamanager_widget_checkbox
|
This is a widget for simple boolean fields. |
midcom_helper_datamanager_widget_collection
|
This is a widget to handle a variable-length collection of other types. |
midcom_helper_datamanager_widget_communityhtml
|
This is a widget to handle the simple "communityhtml" type, which is a very simplified form of bbcode. |
midcom_helper_datamanager_widget_date
|
This is a widget to show a JS driven date selector. |
midcom_helper_datamanager_widget_html
|
This is a WYSIWYG HTML widget, built on HTMLArea. |
midcom_helper_datamanager_widget_image
|
This is a widget to handle image attachments. |
midcom_helper_datamanager_widget_mailtemplate
|
This is a widget that manages E-Mail templates. |
midcom_helper_datamanager_widget_multiselect
|
This is a widget to handle image variable-height multi-selection lists. |
midcom_helper_datamanager_widget_radiobox
|
This is a widget to handle radio-box style select lists. |
midcom_helper_datamanager_widget_select
|
This is a widget to handle image variable-height select lists. |
midcom_helper_datamanager_widget_text
|
This is a flexible text widget, that allows for input of plain text in several forms. Supported widgets are: |
midcom_helper_datamanager_widget_tinymce
|
This is a WYSIWYG HTML widget that uses the powerful TinyMCE editor |
midcom_helper_datamanager_widget
midcom_helper_datamanager_widget
(midcom_helper_datamanager &$datamanager, Array $field, mixed $defaultvalue)
bool
$missingrequired
(line 121)
This flag is true if the field is a required input field which was missing in the last submit run. The rendering code should take this into account accordingly. This is used by the draw_widget_start method.
bool
$required
(line 111)
This flag is true if the field is a required input field. The rendering code should take this into account accordingly. This is used by the draw_widget_start method.
midcom_helper_datamanager
$_datamanager
(line 63)
A reference to our Datamanager.
Array
$_field
(line 55)
A copy of the field definition we use.
string
$_fieldname
(line 76)
The name we should use for HTML Form elements, can also be used as prefix.
This consists of the Datamanager's form prefix, the string "field_" completed with the name of the field. For ease of use it is also passed through htmlspecialchars automatically.
midcom_helper_services__i18n_l10n
$_l10n
(line 93)
midcom.helper.datamanager L10n database reference.
midcom_helper_services__i18n_l10n
$_l10n_midcom
(line 101)
MidCOM core L10n database reference.
mixed
$_value
(line 85)
Our actual value as initialized by the datatype and (if applicable) extracted from the HTTP POST information.
Constructor
This base-class constructor is used throughout the hierarchy and just relays the constructor call to _construct. See there.
Helper function that renders the helptext if applicable. This is usually appended directly after the label.
Wenn called, this method should display the current data without any editing widget.
You must override this member.
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.
You must override this member.
This is the default widget "introduction" code rendered before the actual field code. It will close the <label> tag.
This is the default widget "introduction" code rendered before the actual field code. It will open a <label> tag and display the heading.
Evaluates the required and missingrequired field states and
returns an according list of CSS classes when one or both of these variables is set. Required fields are reported as 'required', while missing required fields are 'required missing'. If none of these values is set, an empty string is returned.
Return the widget's value.
You should override this if the _value representation of the widget does not match the one returned to the type.
Set the value of the widget.
You should override this if the _value representation of the widget does not match the one returned to the type.
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.
After doing this, it will call _read_formdata to catch any changes submitted by the user, see there for details.
Override this method if you need a custom class construction.
Reads the HTTP POST request data if available.
It checks the $_REQUEST array wether there is anything related to our widget. If yes, it will be read and stored in the widget.
You should override this only if you cannot use the Request data directly, as the default bevavoir is to copy it to the _value member.
Documentation generated on Mon, 21 Nov 2005 18:24:31 +0100 by phpDocumentor 1.3.0RC3