‪TYPO3CMS  10.4
BackendLayout.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
25 {
29  protected ‪$identifier;
30 
34  protected ‪$title;
35 
39  protected ‪$description;
40 
44  protected ‪$iconPath;
45 
49  protected ‪$configuration;
50 
56  protected ‪$structure = [];
57 
61  protected ‪$data;
62 
69  public static function ‪create(‪$identifier, ‪$title, ‪$configuration)
70  {
71  return GeneralUtility::makeInstance(
72  static::class,
74  ‪$title,
76  );
77  }
78 
85  {
87  $this->‪setTitle(‪$title);
88  if (is_array(‪$configuration)) {
89  $this->structure = ‪$configuration;
90  $this->configuration = ‪$configuration['config'] ?? '';
91  } else {
93  }
94  }
95 
99  public function ‪getIdentifier()
100  {
102  }
103 
108  public function ‪setIdentifier(‪$identifier)
109  {
110  if (strpos(‪$identifier, '__') !== false) {
111  throw new \UnexpectedValueException(
112  'Identifier "' . ‪$identifier . '" must not contain "__"',
113  1381597630
114  );
115  }
116 
117  $this->identifier = ‪$identifier;
118  }
119 
123  public function ‪getTitle()
124  {
125  return ‪$this->title;
126  }
127 
131  public function ‪setTitle(‪$title)
132  {
133  $this->title = ‪$title;
134  }
135 
139  public function ‪getDescription()
140  {
141  return ‪$this->description;
142  }
143 
147  public function ‪setDescription(‪$description)
148  {
149  $this->description = ‪$description;
150  }
151 
155  public function ‪getIconPath()
156  {
157  return ‪$this->iconPath;
158  }
159 
163  public function ‪setIconPath(‪$iconPath)
164  {
165  $this->iconPath = ‪$iconPath;
166  }
167 
171  public function ‪getConfiguration()
172  {
174  }
175 
179  public function ‪setConfiguration(‪$configuration)
180  {
181  $this->configuration = ‪$configuration;
182  $this->structure = GeneralUtility::makeInstance(BackendLayoutView::class)->parseStructure($this);
183  }
184 
192  public function ‪getUsedColumns(): array
193  {
194  return $this->structure['usedColumns'] ?? [];
195  }
196 
200  public function ‪getData()
201  {
202  return ‪$this->data;
203  }
204 
208  public function ‪setData(array ‪$data)
209  {
210  $this->data = ‪$data;
211  }
212 
213  public function ‪setStructure(array ‪$structure)
214  {
215  $this->structure = ‪$structure;
216  }
217 
218  public function ‪getStructure(): array
219  {
220  return ‪$this->structure;
221  }
222 
223  public function ‪getColumnPositionNumbers(): array
224  {
225  return $this->structure['__colPosList'];
226  }
227 }
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$data
‪array $data
Definition: BackendLayout.php:54
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getIdentifier
‪string getIdentifier()
Definition: BackendLayout.php:92
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getIconPath
‪string getIconPath()
Definition: BackendLayout.php:148
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$iconPath
‪string $iconPath
Definition: BackendLayout.php:40
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getStructure
‪getStructure()
Definition: BackendLayout.php:211
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setDescription
‪setDescription($description)
Definition: BackendLayout.php:140
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$configuration
‪string $configuration
Definition: BackendLayout.php:44
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getData
‪array getData()
Definition: BackendLayout.php:193
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setData
‪setData(array $data)
Definition: BackendLayout.php:201
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getColumnPositionNumbers
‪getColumnPositionNumbers()
Definition: BackendLayout.php:216
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getDescription
‪string getDescription()
Definition: BackendLayout.php:132
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\__construct
‪__construct($identifier, $title, $configuration)
Definition: BackendLayout.php:77
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\create
‪static BackendLayout create($identifier, $title, $configuration)
Definition: BackendLayout.php:62
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getConfiguration
‪string getConfiguration()
Definition: BackendLayout.php:164
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setIconPath
‪setIconPath($iconPath)
Definition: BackendLayout.php:156
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setConfiguration
‪setConfiguration($configuration)
Definition: BackendLayout.php:172
‪TYPO3\CMS\Backend\View\BackendLayout
Definition: BackendLayout.php:16
‪TYPO3\CMS\Backend\View\BackendLayoutView
Definition: BackendLayoutView.php:36
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setIdentifier
‪setIdentifier($identifier)
Definition: BackendLayout.php:101
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getUsedColumns
‪array getUsedColumns()
Definition: BackendLayout.php:185
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$identifier
‪string $identifier
Definition: BackendLayout.php:28
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout
Definition: BackendLayout.php:25
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$description
‪string $description
Definition: BackendLayout.php:36
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getTitle
‪string getTitle()
Definition: BackendLayout.php:116
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setTitle
‪setTitle($title)
Definition: BackendLayout.php:124
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$title
‪string $title
Definition: BackendLayout.php:32
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setStructure
‪setStructure(array $structure)
Definition: BackendLayout.php:206
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$structure
‪array $structure
Definition: BackendLayout.php:50