You are here

public function ExtraResult::buildOptionsForm in Views Extras (Session/Cookie/Token Support) 8

Same name and namespace in other branches
  1. 2.x src/Plugin/views/area/ExtraResult.php \Drupal\views_extras\Plugin\views\area\ExtraResult::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides AreaPluginBase::buildOptionsForm

File

src/Plugin/views/area/ExtraResult.php, line 36

Class

ExtraResult
Views area handler to display some configurable result summary.

Namespace

Drupal\views_extras\Plugin\views\area

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $item_list = array(
    '#theme' => 'item_list',
    '#items' => array(
      '@start -- the initial record number in the set',
      '@end -- the last record number in the set',
      '@total -- the total records in the set',
      '@label -- the human-readable name of the view',
      '@per_page -- the number of items per page',
      '@current_page -- the current page number',
      '@current_record_count -- the current page record count',
      '@page_count -- the total page count',
      '@more -- @total - @current_record_count',
    ),
  );
  $list = \Drupal::service('renderer')
    ->render($item_list);
  $form['content'] = array(
    '#title' => $this
      ->t('Display'),
    '#type' => 'textarea',
    '#rows' => 3,
    '#default_value' => $this->options['content'],
    '#description' => $this
      ->t('You may use HTML code in this field. The following tokens are supported:') . $list,
  );
}