You are here

function views_flag_refresh_plugin_display_extender::options_form in Views Flag Refresh 7

Provide the form to set new option.

Overrides views_plugin_display_extender::options_form

File

./views_flag_refresh_plugin_display_extender.inc, line 46
Views field view field handler class.

Class

views_flag_refresh_plugin_display_extender
This plugin adds additional settings to the Views AJAX options.

Code

function options_form(&$form, &$form_state) {
  switch ($form_state['section']) {
    case 'views_flag_refresh':
      $form['use_ajax_flags'] = array(
        '#type' => 'checkboxes',
        '#title' => t('Refresh display on flags'),
        '#options' => views_flag_refresh_flag_options_get(),
        '#default_value' => (array) $this->display
          ->get_option('use_ajax_flags'),
        '#description' => t('Refreshes the display via AJAX whenever a user clicks one of the selected flags. This will only take effect if the <em>Use AJAX</em> option is set to <em>Yes</em>.'),
      );
      $form['use_ajax_flags_noscrolltop'] = array(
        '#type' => 'checkbox',
        '#title' => t('Disable scroll to top of this view.'),
        '#default_value' => $this->display
          ->get_option('use_ajax_flags_noscrolltop'),
        '#description' => t('Check if you want disable scroll to the top of this view after AJAX update.'),
      );
      $default_value = $this->display
        ->get_option('use_ajax_flags_widget');
      $form['use_ajax_flags_widget'] = array(
        '#type' => 'radios',
        '#title' => t('Refresh widget'),
        '#options' => views_flag_refresh_widget_options_get(),
        '#default_value' => $default_value ? $default_value : 'default',
        '#description' => t('The widget alters the display of the view as it is refreshing, for example by adding a throbber or textual message.'),
      );
      break;
  }
}