You are here

function itoggle_get_options_form in iToggle 7.2

Return form markup used for iToggle Widget Options. This is used in the Field Formatter, Field Widget and Views Handler.

Parameters

bool: Default $clickable value.

bool: Default $display_type value.

bool: Whether we are overriding default settings. This is only used by the Field Formatter.

Return value

array A Form API array of fields.

3 calls to itoggle_get_options_form()
itoggle_field_field_formatter_settings_form in modules/field/itoggle_field.module
Implements hook_field_formatter_settings_form().
itoggle_field_field_widget_settings_form in modules/field/itoggle_field.module
Implements hook_field_widget_settings_form().
itoggle_views_handler_field::options_form in modules/views/itoggle_views_handler_field.inc
iToggle field options form.

File

./itoggle.module, line 434
iToggle core module.

Code

function itoggle_get_options_form($clickable, $display_type, $override = FALSE) {
  $form = array(
    'clickable' => array(
      '#type' => 'checkbox',
      '#title' => t('Make Widget Clickable'),
      '#description' => t("Check this box to make the iToggle Widget clickable. When clicked the widget will try to update the it's value via AJAX (if the current user has the correct <a href=\"@url\">permissions</a>).", array(
        '@url' => url('admin/people/permissions/#module-itoggle'),
      )),
      '#default_value' => $clickable,
      '#weight' => -2,
    ),
    'display_type' => array(
      '#type' => 'select',
      '#title' => t('Display Type'),
      '#description' => t('Choose between the default On/Off, Yes/No caption or a language-agnostic 1/0 caption for the Widget.'),
      '#options' => array(
        t('On/Off'),
        t('Yes/No'),
        '1/0',
      ),
      '#default_value' => $display_type,
      '#weight' => -1,
    ),
  );
  if ($override) {
    $form['override'] = array(
      '#type' => 'checkbox',
      '#title' => t('Override Widget Settings'),
      '#description' => t('Check this box to override the Widget settings when displaying this field.'),
      '#default_value' => $override,
      '#weight' => -3,
    );
  }
  return $form;
}