Class midcom_helper_datamanager_widget_blob

Description

This is a widget to handle binary attachments.

This widget should only be used with the blob datatype. It will show a bunch of meta-data fields (unless in simple mode). Deletion is handled through a checkbox while saving the datamanager form.

Configuration parameters:

widget_blob_simple: Set this to true to reduce the field to a very simple upload field without the ability to set mime-type, filename and file description.

Sample configuration

 "blob" => array (
     "description" => "Download",
     "datatype" => "blob",
     "widget_blob_simple" => true
 ),

CSS Styles in use by the Widget

The fieldset is set to fieldset.blob. The inputfields are input.shorttext for all text fields and input.fileupload for the actual upload field. The deletion checkbox is of the class input.checkbox.

Note, that while the field is empty, the fieldset is only used, when the full-scale widget is used. The simple widget does not use it. While editing an existing blob, both have the same UI.

The download link is a simple paragraph within the enclosing fieldset.

The preview link is a nested div: div.blob_preview surrounds the entire preview area, div.image_frame surrounds any displayed image.

Located in /midcom/helper/datamanager/widget_blob.php (line 51)

midcom_helper_datamanager_widget
   |
   --midcom_helper_datamanager_widget_blob
Variable Summary
Method Summary
 void draw_view ()
 void draw_widget ()
 void draw_widget_end ()
 void get_value ()
 void _constructor (mixed &$datamanager, mixed $field, mixed $defaultvalue)
 void _read_formdata ()
Variables
array $_commands (line 91)

The array with the commands to execute (for the type)

  • access: private
string $_fieldname_delete (line 59)

Fieldname constant

  • access: private
string $_fieldname_description (line 67)

Fieldname constant

  • access: private
string $_fieldname_filename (line 75)

Fieldname constant

  • access: private
string $_fieldname_mimetype (line 83)

Fieldname constant

  • access: private
bool $_simple (line 99)

Set to true if the simple upload widget should be shown.

  • 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 155)
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 224)
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.
draw_widget_end (line 212)

The widget will use a field group to put all related fields together, unless we're in simple upload mode.

void draw_widget_end ()

Redefinition of:
midcom_helper_datamanager_widget::draw_widget_end()
This is the default widget "introduction" code rendered before the actual field code. It will close the <label> tag.
draw_widget_start (line 186)

The widget will use a field group to put all related fields together, unless we're in simple upload mode.

void draw_widget_start ()

Redefinition of:
midcom_helper_datamanager_widget::draw_widget_start()
This is the default widget "introduction" code rendered before the actual field code. It will open a <label> tag and display the heading.
get_value (line 309)
void get_value ()

Redefinition of:
midcom_helper_datamanager_widget::get_value()
Return the widget's value.
_constructor (line 101)
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 123)

Evaluates the various controls and populates the command array for processing through datatype_blob

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