You are here

public function DefaultSummary::buildOptionsForm in Views (for Drupal 7) 8.3

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

1 call to DefaultSummary::buildOptionsForm()
UnformattedSummary::buildOptionsForm in lib/Drupal/views/Plugin/views/style/UnformattedSummary.php
Provide a form to edit options for this plugin.
1 method overrides DefaultSummary::buildOptionsForm()
UnformattedSummary::buildOptionsForm in lib/Drupal/views/Plugin/views/style/UnformattedSummary.php
Provide a form to edit options for this plugin.

File

lib/Drupal/views/Plugin/views/style/DefaultSummary.php, line 46
Definition of Drupal\views\Plugin\views\style\StyleSummaryPluginBase.

Class

DefaultSummary
The default style plugin for summaries.

Namespace

Drupal\views\Plugin\views\style

Code

public function buildOptionsForm(&$form, &$form_state) {
  $form['base_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Base path'),
    '#default_value' => $this->options['base_path'],
    '#description' => t('Define the base path for links in this summary
        view, i.e. http://example.com/<strong>your_view_path/archive</strong>.
        Do not include beginning and ending forward slash. If this value
        is empty, views will use the first path found as the base path,
        in page displays, or / if no path could be found.'),
  );
  $form['count'] = array(
    '#type' => 'checkbox',
    '#default_value' => !empty($this->options['count']),
    '#title' => t('Display record count with link'),
  );
  $form['override'] = array(
    '#type' => 'checkbox',
    '#default_value' => !empty($this->options['override']),
    '#title' => t('Override number of items to display'),
  );
  $form['items_per_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Items to display'),
    '#default_value' => $this->options['items_per_page'],
    '#states' => array(
      'visible' => array(
        ':input[name="options[summary][options][' . $this->definition['id'] . '][override]"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
}