Datamanager 2 simple video widget

As with all subclasses, the actual initialization is done in the initialize() function, not in the constructor, to allow for error handling.

This widget supports the video type or any subtype thereof.

All processing is done during the on_submit handlers, enforcing immediate update of the associated storage objects. No other solution is possible, since we need to transfer uploaded files somehow through multiple requests.

Available configuration options:

  • boolean show_title: This flag controls whether the title field is shown or not. If this is flag, the whole title processing will be disabled. This flag is true by default.
package midcom.helper.datamanager2

 Methods

_cast_formgroup_to_replacedelete_video ()

_cast_formgroup_to_upload_video ()

_create_frozen_elements (array $elements)

Constructs the widget for frozen operation: Only a single static element is added indicating the current type state.

Parameters

$elements

array&$elements The array where the references to the created elements should be added.

_create_replace_elements (array $elements)

Creates the elements to manage an existing upload, offering "delete" and "upload new file" operations.

Parameters

$elements

array&$elements The array where the references to the created elements should be added.

_create_replace_elements_video ($elements)

Parameters

$elements

_create_upload_elements (array $elements)

Creates the upload elements for empty types.

Parameters

$elements

array&$elements The array where the references to the created elements should be added.

_create_upload_elements_video ($elements)

Parameters

$elements

_on_initialize ()

The initialization event handler post-processes the maxlength setting.

Returns

booleanIndicating Success

add_action_elements (array $elements)

Adds common image operations to the QF.

Parameters

$elements

array&$elements reference to the elements array to add the actions to

add_elements_to_form ($attributes)

Adds a simple single-line text form element at this time.

Parameters

$attributes

freeze ()

Freeze the entire group, special handling applies, the formgroup is replaced by a single static element.

get_default ()

Populate the title field.

on_submit ($results)

The on_submit event handles all file uploads immediately.

They are passed through the type at that point. This is required, since we do not have persistent upload file management on the QF side. Deletions take precedence over uploads.

Parameters

$results

sync_type_with_widget ($results)

Synchronize the title field

Parameters

$results

unfreeze ()

Unfreeze the entire group, special handling applies, the formgroup is replaced by a the full input widget set.

_cast_formgroup_to_replacedelete ()

Switches the Element Group from a simple upload form to a replace/delete constellation.

_cast_formgroup_to_upload ()

Switches the Element Group from a replace/delete constellation to a simple upload form.

_get_preview_size ()

 Properties

 

mixed $_upload_element_video

 

boolean $show_title

Controls title processing.
 

\HTML_QuickForm_file $_upload_element

The QF upload form element, used for processing.