Pull merge.
[yaffs-website] / web / core / modules / views / src / Plugin / views / style / UnformattedSummary.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\style;
4
5 use Drupal\Core\Form\FormStateInterface;
6
7 /**
8  * The default style plugin for summaries.
9  *
10  * @ingroup views_style_plugins
11  *
12  * @ViewsStyle(
13  *   id = "unformatted_summary",
14  *   title = @Translation("Unformatted"),
15  *   help = @Translation("Displays the summary unformatted, with option for one after another or inline."),
16  *   theme = "views_view_summary_unformatted",
17  *   display_types = {"summary"}
18  * )
19  */
20 class UnformattedSummary extends DefaultSummary {
21
22   protected function defineOptions() {
23     $options = parent::defineOptions();
24     $options['inline'] = ['default' => FALSE];
25     $options['separator'] = ['default' => ''];
26     return $options;
27   }
28
29   public function buildOptionsForm(&$form, FormStateInterface $form_state) {
30     parent::buildOptionsForm($form, $form_state);
31     $form['inline'] = [
32       '#type' => 'checkbox',
33       '#default_value' => !empty($this->options['inline']),
34       '#title' => $this->t('Display items inline'),
35     ];
36     $form['separator'] = [
37       '#type' => 'textfield',
38       '#title' => $this->t('Separator'),
39       '#default_value' => $this->options['separator'],
40     ];
41   }
42
43 }