function gathercontent_element_info in GatherContent 7.3
Implements hook_element_info().
File
- ./
gathercontent.theme.inc, line 10 - Form elements and theme functions for GatherContent module.
Code
function gathercontent_element_info() {
return array(
//
// Custom tableselect form element.
//
'gathercontent_tableselect' => array(
'#input' => TRUE,
'#js_select' => TRUE,
'#multiple' => TRUE,
'#process' => array(
'form_process_tableselect',
),
'#options' => array(),
'#empty' => '',
'#theme' => 'gathercontent_tableselect',
'#type' => 'tableselect',
//
// Additional options compared to tableselect form element.
//
// Whether to add tablesorter plugin or not (if it's available).
'#tablesorter' => TRUE,
// DIV elements which have to be added to the table as prefix, array of
// class arrays keyed by an (internal) element name.
// These elements will be wrapped into a DIV with class
// gathercontent-table--header.
//
// Example:
// @code
// $element['#filterwrapper'] = array(
// 'element_one' => array('class1', 'class2'),
// 'element_two' => array('class3', 'class4'),
// );
// @endcode
//
// Sample output in the case above:
// @code
// <div class="gathercontent-table-header">
// <div class="class1 class2"></div>
// <div class="class3 class4"></div>
// </div>
// @endcode
'#filterwrapper' => array(),
'#filterdescription' => '',
),
//
// Checkbox counter form element.
//
// Sample usage:
// @code
// $form['counter'] = array(
// '#type' => 'gathercontent_checkboxcounter',
// '#checkboxes_selector' => '.custom-wrapper [type="checkbox"]',
// '#counter_message_template' => array(
// '1 node selected',
// '@count nodes selected',
// ),
// '#counter_message_default' => format_plural(0,
// '1 node selected',
// '@count nodes selected'
// ),
// );
// @endcode
'gathercontent_checkboxcounter' => array(
'#input' => FALSE,
'#theme' => 'gathercontent_checkboxcounter',
'#process' => array(
'form_process_container',
),
'#checkboxes_selector' => '',
'#counter_message_js_template' => array(),
'#counter_message_default' => '',
),
);
}