‪TYPO3CMS  ‪main
BackendLayout.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 
22 
27 {
28  protected string ‪$identifier;
29  protected string ‪$title;
30  protected string ‪$description = '';
31  protected string ‪$iconPath = '';
32  protected string ‪$configuration = '';
33 
37  protected array ‪$structure = [];
38  protected array ‪$data = [];
39 
40  public static function ‪create(string ‪$identifier, string ‪$title, string|array ‪$configuration): ‪BackendLayout
41  {
42  return GeneralUtility::makeInstance(
43  static::class,
45  ‪$title,
47  );
48  }
49 
50  public function ‪__construct(string ‪$identifier, string ‪$title, string|array ‪$configuration)
51  {
52  $this->‪setIdentifier($identifier);
53  $this->‪setTitle($title);
54  if (is_array(‪$configuration)) {
55  $this->structure = ‪$configuration;
56  $this->configuration = ‪$configuration['config'] ?? '';
57  } else {
58  $this->‪setConfiguration($configuration);
59  }
60  }
61 
62  public function ‪getIdentifier(): string
63  {
64  return ‪$this->identifier;
65  }
66 
67  public function ‪setIdentifier(string ‪$identifier): void
68  {
69  if (str_contains(‪$identifier, '__')) {
70  throw new \UnexpectedValueException(
71  'Identifier "' . ‪$identifier . '" must not contain "__"',
72  1381597630
73  );
74  }
75 
76  $this->identifier = ‪$identifier;
77  }
78 
79  public function ‪getTitle(): string
80  {
81  return ‪$this->title;
82  }
83 
84  public function ‪setTitle(string ‪$title): void
85  {
86  $this->title = ‪$title;
87  }
88 
89  public function ‪getDescription(): string
90  {
91  return ‪$this->description;
92  }
93 
94  public function ‪setDescription(string ‪$description): void
95  {
97  }
98 
99  public function ‪getIconPath(): string
100  {
101  return ‪$this->iconPath;
102  }
103 
104  public function ‪setIconPath(string ‪$iconPath): void
105  {
106  $this->iconPath = ‪$iconPath;
107  }
108 
109  public function ‪getConfiguration(): string
110  {
112  }
113 
114  public function ‪setConfiguration(string ‪$configuration): void
115  {
116  $this->configuration = ‪$configuration;
117  $this->structure = GeneralUtility::makeInstance(BackendLayoutView::class)->parseStructure($this);
118  }
119 
126  public function ‪getUsedColumns(): array
127  {
128  return $this->structure['usedColumns'] ?? [];
129  }
130 
131  public function ‪getColCount(): int
132  {
133  return $this->structure['colCount'] ?? 0;
134  }
135 
136  public function ‪getRowCount(): int
137  {
138  return $this->structure['rowCount'] ?? 0;
139  }
140 
141  public function ‪getData(): array
142  {
143  return ‪$this->data;
144  }
145 
146  public function ‪setData(array ‪$data): void
147  {
148  $this->data = ‪$data;
149  }
150 
151  public function ‪setStructure(array ‪$structure): void
152  {
153  $this->structure = ‪$structure;
154  }
155 
156  public function ‪getStructure(): array
157  {
158  return ‪$this->structure;
159  }
160 
164  public function ‪getColumnPositionNumbers(): array
165  {
166  return $this->structure['__colPosList'];
167  }
168 }
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$data
‪array $data
Definition: BackendLayout.php:38
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setConfiguration
‪setConfiguration(string $configuration)
Definition: BackendLayout.php:114
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getColumnPositionNumbers
‪string[] getColumnPositionNumbers()
Definition: BackendLayout.php:164
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$iconPath
‪string $iconPath
Definition: BackendLayout.php:31
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getStructure
‪getStructure()
Definition: BackendLayout.php:156
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getColCount
‪getColCount()
Definition: BackendLayout.php:131
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$configuration
‪string $configuration
Definition: BackendLayout.php:32
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getData
‪getData()
Definition: BackendLayout.php:141
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getIconPath
‪getIconPath()
Definition: BackendLayout.php:99
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getRowCount
‪getRowCount()
Definition: BackendLayout.php:136
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setData
‪setData(array $data)
Definition: BackendLayout.php:146
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\__construct
‪__construct(string $identifier, string $title, string|array $configuration)
Definition: BackendLayout.php:50
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\create
‪static create(string $identifier, string $title, string|array $configuration)
Definition: BackendLayout.php:40
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setIdentifier
‪setIdentifier(string $identifier)
Definition: BackendLayout.php:67
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setDescription
‪setDescription(string $description)
Definition: BackendLayout.php:94
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getUsedColumns
‪getUsedColumns()
Definition: BackendLayout.php:126
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getTitle
‪getTitle()
Definition: BackendLayout.php:79
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getConfiguration
‪getConfiguration()
Definition: BackendLayout.php:109
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setIconPath
‪setIconPath(string $iconPath)
Definition: BackendLayout.php:104
‪TYPO3\CMS\Backend\View\BackendLayout
Definition: BackendLayout.php:18
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getDescription
‪getDescription()
Definition: BackendLayout.php:89
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setTitle
‪setTitle(string $title)
Definition: BackendLayout.php:84
‪TYPO3\CMS\Backend\View\BackendLayoutView
Definition: BackendLayoutView.php:37
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\getIdentifier
‪getIdentifier()
Definition: BackendLayout.php:62
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$identifier
‪string $identifier
Definition: BackendLayout.php:28
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout
Definition: BackendLayout.php:27
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$description
‪string $description
Definition: BackendLayout.php:30
‪TYPO3\CMS\Redirects\Message\description
‪identifier description
Definition: RedirectWasHitMessage.php:32
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$title
‪string $title
Definition: BackendLayout.php:29
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\setStructure
‪setStructure(array $structure)
Definition: BackendLayout.php:151
‪TYPO3\CMS\Backend\View\BackendLayout\BackendLayout\$structure
‪array $structure
Definition: BackendLayout.php:37