‪TYPO3CMS  11.5
ListWidget.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
34 {
38  private ‪$configuration;
39 
43  private ‪$view;
44 
48  private ‪$options;
53 
57  private ‪$dataProvider;
58 
59  public function ‪__construct(
63  ‪$buttonProvider = null,
64  array ‪$options = []
65  ) {
66  $this->configuration = ‪$configuration;
67  $this->view = ‪$view;
68  $this->options = ‪$options;
69  $this->buttonProvider = ‪$buttonProvider;
70  $this->dataProvider = ‪$dataProvider;
71  }
72 
73  public function ‪renderWidgetContent(): string
74  {
75  $this->view->setTemplate('Widget/ListWidget');
76  $this->view->assignMultiple([
77  'items' => $this->‪getItems(),
78  'options' => $this->options,
79  'button' => $this->buttonProvider,
80  'configuration' => $this->configuration,
81  ]);
82  return $this->view->render();
83  }
84 
85  protected function ‪getItems(): array
86  {
87  return $this->dataProvider->getItems();
88  }
89 
93  public function ‪getOptions(): array
94  {
95  return ‪$this->options;
96  }
97 }
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\$dataProvider
‪ListDataProviderInterface $dataProvider
Definition: ListWidget.php:52
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\renderWidgetContent
‪renderWidgetContent()
Definition: ListWidget.php:68
‪TYPO3\CMS\Dashboard\Widgets\WidgetInterface
Definition: WidgetInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\getOptions
‪array getOptions()
Definition: ListWidget.php:88
‪TYPO3\CMS\Dashboard\Widgets\ListDataProviderInterface
Definition: ListDataProviderInterface.php:24
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\$buttonProvider
‪ButtonProviderInterface null $buttonProvider
Definition: ListWidget.php:48
‪TYPO3\CMS\Dashboard\Widgets\ListWidget
Definition: ListWidget.php:34
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\$options
‪array $options
Definition: ListWidget.php:45
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\getItems
‪getItems()
Definition: ListWidget.php:80
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:31
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\$configuration
‪WidgetConfigurationInterface $configuration
Definition: ListWidget.php:37
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\__construct
‪__construct(WidgetConfigurationInterface $configuration, ListDataProviderInterface $dataProvider, StandaloneView $view, $buttonProvider=null, array $options=[])
Definition: ListWidget.php:54
‪TYPO3\CMS\Dashboard\Widgets
Definition: AdditionalCssInterface.php:18
‪TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface
Definition: ButtonProviderInterface.php:24
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface
Definition: WidgetConfigurationInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\ListWidget\$view
‪StandaloneView $view
Definition: ListWidget.php:41