Datamanager 2 Autocomplete widget

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 search form and place holder for results.

Also adds static options to results.

Parameters

$attributes

add_head_elements ($creation_mode_enabled)

Static

Parameters

$creation_mode_enabled

create_item_label ($object, $result_headers, $get_label_for)

Static

Parameters

$object

$result_headers

$get_label_for

freeze ()

get_default ()

The defaults of the widget are mapped to the current selection.

get_widget_config ($type)

Static

Parameters

$type

is_frozen ()

render_content ()

sort_items ($a, $b)

Static

Parameters

$a

$b

sync_type_with_widget ($results)

Reads the given get/post data and puts to type->selection

Parameters

$results

unfreeze ()

Unfreezes all form elements associated with the widget.

The default implementation works on the default field name, you don't need to override this function unless you have multiple widgets in the form.

This maps to the HTML_QuickForm_element::unfreeze() function.

_get_form_selection ($data)

Parameters

$data

_get_selection ()

 Properties

 

string $auto_wildcards

Whether to automatically append/prepend wildcards to the query

Valid values: 'both', 'start', 'end' and (0, '', false & null)

Example:

    'auto_wildcards' => 'end',
 

string $class

Class to search for
 

string $component

Which component the searched class belongs to
 

array $constraints

Associative array of constraints (besides the search term), always AND

Example:

    'constraints' => array
    (
        array
        (
            'field' => 'username',
            'op' => '<>',
            'value' => '',
        ),
    ),
 

mixed $creation_default_key

 

mixed $creation_handler

 

mixed $creation_mode_enabled

 

string $get_label_for

In search results replaces given field with the object's label

Example:

     'get_label_for' => 'title',
 

string $id_field

Field/property to use as the key/id
 

integer $min_chars

Minimum characters necessary to trigger a search
 

array $orders

associative array of ordering info, always added last

Example:

    'orders' => array
    (
        array
        (
            'lastname' => 'ASC',
        ),
        array
        (
            'firstname' => 'ASC',
        )
    ),
 

array $result_headers

Fields/properties to show on results

Example:

     'result_headers' => array
     (
         array
         (
             'name' => 'firstname',
             'title' => 'first name',
         ),
         array
         (
             'name' => 'lastname',
             'title' => 'last name',
         ),
     ),
 

array $searchfields

Fields/properties to search the keyword for, always OR and specified after the constraints above

Example:

     'searchfields' => array
     (
         'firstname',
         'lastname',
         'email',
         'username'
     ),
 

string $_element_id

the element's ID
 

array $_widget_elements

The group of widgets items as QuickForm elements