Datamanager 2 CodeMirror 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 all types which have a simple, plain text representation accessible though their value member.

Available configuration options:

  • string language: Programming language being edited by CodeMirror, for example php or javascript
  • int width: The number of columns of the textarea, this defaults to 50. Note that this value might be overridden by CSS.
  • int height: The number of rows of the textearea, this defaults to 6. Note that this value might be overridden by CSS.
package midcom.helper.datamanager2

 Methods

_on_initialize ()

The initialization event handler post-processes the maxlength setting.

Returns

booleanIndicating Success

add_elements_to_form ($attributes)

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

Parameters

$attributes

get_default ()

sync_type_with_widget ($results)

Parameters

$results

 Properties

 

mixed $enabled

Whether to actually enable the widget
 

int $height

Height of the textbox.
 

string $language

Language of code in editor
 

int $width

Width of the textbox.