‪TYPO3CMS  ‪main
DocHeaderComponent.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 {
31  protected ‪$menuRegistry;
32 
38  protected ‪$metaInformation;
39 
45  protected ‪$buttonBar;
46 
50  protected ‪$enabled = true;
51 
55  public function ‪__construct()
56  {
57  $this->buttonBar = GeneralUtility::makeInstance(ButtonBar::class);
58  $this->menuRegistry = GeneralUtility::makeInstance(MenuRegistry::class);
59  $this->metaInformation = GeneralUtility::makeInstance(MetaInformation::class);
60  }
61 
67  public function ‪setMetaInformation(array ‪$metaInformation)
68  {
69  $this->metaInformation->setRecordArray(‪$metaInformation);
70  }
71 
72  public function ‪setMetaInformationForResource(‪ResourceInterface $resource): void
73  {
74  $this->metaInformation->setResource($resource);
75  }
76 
82  public function ‪getMenuRegistry()
83  {
85  }
86 
92  public function ‪getButtonBar()
93  {
94  return ‪$this->buttonBar;
95  }
96 
102  public function ‪isEnabled()
103  {
104  return ‪$this->enabled;
105  }
106 
110  public function ‪enable()
111  {
112  $this->enabled = true;
113  }
114 
118  public function ‪disable()
119  {
120  $this->enabled = false;
121  }
122 
128  public function ‪docHeaderContent()
129  {
130  return [
131  'enabled' => $this->‪isEnabled(),
132  'buttons' => $this->buttonBar->getButtons(),
133  'menus' => $this->menuRegistry->getMenus(),
134  'metaInformation' => ‪$this->metaInformation,
135  ];
136  }
137 }
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\setMetaInformation
‪setMetaInformation(array $metaInformation)
Definition: DocHeaderComponent.php:63
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\$enabled
‪bool $enabled
Definition: DocHeaderComponent.php:46
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent
Definition: DocHeaderComponent.php:25
‪TYPO3\CMS\Backend\Template\Components\ButtonBar
Definition: ButtonBar.php:33
‪TYPO3\CMS\Backend\Template\Components\MenuRegistry
Definition: MenuRegistry.php:25
‪TYPO3\CMS\Backend\Template\Components\MetaInformation
Definition: MetaInformation.php:33
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\setMetaInformationForResource
‪setMetaInformationForResource(ResourceInterface $resource)
Definition: DocHeaderComponent.php:68
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\isEnabled
‪bool isEnabled()
Definition: DocHeaderComponent.php:98
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\enable
‪enable()
Definition: DocHeaderComponent.php:106
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\$buttonBar
‪ButtonBar $buttonBar
Definition: DocHeaderComponent.php:42
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\$metaInformation
‪MetaInformation $metaInformation
Definition: DocHeaderComponent.php:36
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\getMenuRegistry
‪MenuRegistry getMenuRegistry()
Definition: DocHeaderComponent.php:78
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\getButtonBar
‪ButtonBar getButtonBar()
Definition: DocHeaderComponent.php:88
‪TYPO3\CMS\Core\Resource\ResourceInterface
Definition: ResourceInterface.php:21
‪TYPO3\CMS\Backend\Template\Components
Definition: AbstractControl.php:16
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\__construct
‪__construct()
Definition: DocHeaderComponent.php:51
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\docHeaderContent
‪array docHeaderContent()
Definition: DocHeaderComponent.php:124
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\$menuRegistry
‪MenuRegistry $menuRegistry
Definition: DocHeaderComponent.php:30
‪TYPO3\CMS\Backend\Template\Components\DocHeaderComponent\disable
‪disable()
Definition: DocHeaderComponent.php:114