You are here

views_bootstrap_table_plugin_style.inc in Views Bootstrap 7.3

Same filename and directory in other branches
  1. 7.2 plugins/table/views_bootstrap_table_plugin_style.inc

Definition of views_bootstrap_plugin_style.

File

plugins/table/views_bootstrap_table_plugin_style.inc
View source
<?php

/**
 * @file
 * Definition of views_bootstrap_plugin_style.
 */

/**
 * Class to define a style plugin handler.
 */
class ViewsBootstrapTablePluginStyle extends views_plugin_style_table {

  /**
   * Definition.
   */
  public function option_definition() {
    $options = parent::option_definition();
    $options['bootstrap_styles'] = array(
      'default' => array(),
    );
    $options['responsive'] = array(
      'default' => FALSE,
    );
    return $options;
  }

  /**
   * Form.
   */
  public function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['help'] = array(
      '#markup' => t('The Bootstrap table style adds default Bootstrap table classes and optional classes (<a href="!docs">see documentation</a>).', [
        '!docs' => 'https://www.drupal.org/docs/7/modules/views-bootstrap/table',
      ]),
      '#weight' => -99,
    );
    $form['responsive'] = array(
      '#type' => 'checkbox',
      '#title' => t('Responsive'),
      '#default_value' => $this->options['responsive'],
      '#description' => t('To make a table scroll horizontally on small devices.'),
    );
    $form['bootstrap_styles'] = array(
      '#title' => t('Bootstrap styles'),
      '#type' => 'checkboxes',
      '#default_value' => $this->options['bootstrap_styles'],
      '#options' => array(
        'striped' => t('Striped'),
        'bordered' => t('Bordered'),
        'hover' => t('Hover'),
        'condensed' => t('Condensed'),
      ),
    );
  }

}

Classes

Namesort descending Description
ViewsBootstrapTablePluginStyle Class to define a style plugin handler.