You are here

function vbo_hide_plugin_display_extender::options_form in VBO Hide 7

Provide the default form for setting options.

Overrides views_plugin_display_extender::options_form

File

views/vbo_hide_plugin_display_extender.inc, line 24
Views plugin handler. Contains all relevant options and related logic. Implements the Views Form API.

Class

vbo_hide_plugin_display_extender
@file Views plugin handler. Contains all relevant options and related logic. Implements the Views Form API.

Code

function options_form(&$form, &$form_state) {

  // Call parent method so that default functionality not override.
  parent::options_form($form, $form_state);
  $vbo_value = $this->display
    ->get_option('vbo_hide');
  switch ($form_state['section']) {
    case 'vbo_hide':
      $form['#title'] .= t('Hide VBO when no data in View');
      $form['vbo_hide'] = array(
        '#type' => 'radios',
        '#options' => array(
          0 => t('No'),
          1 => t('Yes'),
        ),
        '#default_value' => isset($vbo_value) ? $this->display
          ->get_option('vbo_hide') : 0,
        '#description' => t('Hide the Views Bulk Operations options if there is no data in View?'),
      );
      break;
  }
}