You are here

function custom_formatters_form_builder_types in Custom Formatters 7.2

Implements hook_form_builder_types().

File

includes/form_builder.inc, line 114
Form Builder module integration.

Code

function custom_formatters_form_builder_types() {
  $fields = array();
  $fields['select'] = array(
    'title' => t('Select list'),
    'properties' => array(
      'title',
      'description',
      'default_value',
      'required',
      'options',
      'multiple',
      'key_type',
      'key_type_toggle',
      'key_type_toggled',
      'key',
    ),
    'default' => array(
      '#title' => t('New select list'),
      '#type' => 'select',
      '#options' => array(
        '1' => 'one',
        '2' => 'two',
        '3' => 'three',
      ),
      '#multiple_toggle' => TRUE,
    ),
  );
  $fields['checkboxes'] = array(
    'title' => t('Checkboxes'),
    'properties' => array(
      'title',
      'description',
      'default_value',
      'required',
      'options',
      'multiple',
      'key_type',
      'key_type_toggle',
      'key_type_toggled',
      'key',
    ),
    'default' => array(
      '#title' => t('New checkboxes'),
      '#type' => 'checkboxes',
      '#options' => array(
        'one' => 'one',
        'two' => 'two',
        'three' => 'three',
      ),
    ),
  );
  $fields['radios'] = array(
    'title' => t('Radios'),
    'properties' => array(
      'title',
      'description',
      'default_value',
      'required',
      'options',
      'key_type',
      'key_type_toggle',
      'key_type_toggled',
      'key',
    ),
    'default' => array(
      '#title' => t('New radios'),
      '#type' => 'radios',
      '#options' => array(
        'one' => 'one',
        'two' => 'two',
        'three' => 'three',
      ),
    ),
  );
  $fields['textfield'] = array(
    'title' => t('Textfield'),
    'properties' => array(
      'title',
      'description',
      'field_prefix',
      'field_suffix',
      'default_value',
      'required',
      'size',
      'key',
    ),
    'default' => array(
      '#title' => t('New textfield'),
      '#type' => 'textfield',
    ),
  );
  $fields['textarea'] = array(
    'title' => t('Textarea'),
    'properties' => array(
      'title',
      'description',
      'default_value',
      'required',
      'rows',
      'cols',
      'key',
    ),
    'default' => array(
      '#title' => t('New textarea'),
      '#type' => 'textarea',
    ),
  );

  // Allow other modules to modify the fields.
  drupal_alter('custom_formatters_form_builder_types', $fields);
  return array(
    'custom_formatters' => $fields,
  );
}