‪TYPO3CMS  ‪main
AbstractCustomPreset.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 
23 {
27  protected ‪$name = 'Custom';
28 
32  protected ‪$isActive = false;
33 
37  protected ‪$priority = 10;
38 
44  public function ‪isActive()
45  {
46  return ‪$this->isActive;
47  }
48 
57  public function ‪setActive()
58  {
59  $this->‪isActive = true;
60  }
61 
67  public function ‪isAvailable()
68  {
69  return true;
70  }
71 
77  public function ‪getConfigurationValues()
78  {
79  return array_map(static fn($configuration) => $configuration['value'], $this->‪getConfigurationDescriptors());
80  }
81 
89  public function ‪getConfigurationDescriptors()
90  {
92  foreach ($this->configurationValues as $configurationKey => $configurationValue) {
93  $readonly = isset($this->readonlyConfigurationValues[$configurationKey]);
94  if (!$readonly
95  && isset($this->postValues['enable'])
96  && $this->postValues['enable'] === $this->name
97  && isset($this->postValues[$this->name][$configurationKey])
98  ) {
99  $currentValue = $this->postValues[‪$this->name][$configurationKey];
100  } else {
101  $currentValue = $this->configurationManager->getConfigurationValueByPath($configurationKey);
102  }
103  ‪$configurationValues[$configurationKey] = [
104  'value' => $currentValue,
105  'readonly' => $readonly,
106  ];
107  }
109  }
110 }
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\setActive
‪setActive()
Definition: AbstractCustomPreset.php:54
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\getConfigurationValues
‪array getConfigurationValues()
Definition: AbstractCustomPreset.php:74
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\$priority
‪int $priority
Definition: AbstractCustomPreset.php:34
‪TYPO3\CMS\Install\Configuration\AbstractPreset
Definition: AbstractPreset.php:27
‪TYPO3\CMS\Install\Configuration\AbstractPreset\$configurationValues
‪array $configurationValues
Definition: AbstractPreset.php:42
‪TYPO3\CMS\Install\Configuration
Definition: AbstractCustomPreset.php:16
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\$name
‪string $name
Definition: AbstractCustomPreset.php:26
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\$isActive
‪bool $isActive
Definition: AbstractCustomPreset.php:30
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\isActive
‪bool isActive()
Definition: AbstractCustomPreset.php:41
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\getConfigurationDescriptors
‪array getConfigurationDescriptors()
Definition: AbstractCustomPreset.php:86
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset\isAvailable
‪bool isAvailable()
Definition: AbstractCustomPreset.php:64
‪TYPO3\CMS\Install\Configuration\AbstractCustomPreset
Definition: AbstractCustomPreset.php:23