You are here

function RadixViewsGridPluginStyle::options_form in Radix Views 7

Provide a form to edit options for this plugin.

Overrides views_plugin_style::options_form

File

plugins/radix_views_grid_plugin_style.inc, line 24
Plugin style for radix_views_grid_plugin_style.

Class

RadixViewsGridPluginStyle
Class to define a style plugin handler.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  // Show this option only if grouping is enabled.
  if (!empty($form['grouping'])) {
    $form['views_group_col_class'] = array(
      '#type' => 'textfield',
      '#title' => t('Group column class'),
      '#description' => t('The grid class to use for the group. Example: col-xs-12, col-md-6, col-lg-4.'),
      '#required' => TRUE,
      '#default_value' => $this->options['views_group_col_class'],
    );
  }
  else {
    $form['views_group_col_class'] = array(
      '#type' => 'hidden',
      '#value' => $this->options['views_group_col_class']['default'],
    );
  }
  $form['views_row_col_class'] = array(
    '#type' => 'textfield',
    '#title' => t('Column class'),
    '#description' => t('The grid class to use for each views result. Example col-xs-12, col-md-6, col-lg-4.'),
    '#required' => TRUE,
    '#default_value' => $this->options['views_row_col_class'],
  );
}