isActive; } /** * Mark preset as active. * The custom features do not know by itself if they are * active or not since the configuration options may overlay * with other presets. * Marking the custom preset as active is therefor taken care * off by the feature itself if no other preset is active. */ public function setActive() { $this->isActive = true; } /** * Custom configuration is always available * * @return bool TRUE */ public function isAvailable() { return true; } /** * Get configuration values is used to persist data and is merged with given $postValues. * * @return array Configuration values needed to activate prefix */ public function getConfigurationValues() { return array_map(static fn($configuration) => $configuration['value'], $this->getConfigurationDescriptors()); } /** * Build configuration descriptors to be used in fluid to show configuration options. * They are fetched from LocalConfiguration / DefaultConfiguration and * merged with given $postValues. * * @return array Configuration values needed to activate prefix */ public function getConfigurationDescriptors() { $configurationValues = []; foreach ($this->configurationValues as $configurationKey => $configurationValue) { $readonly = isset($this->readonlyConfigurationValues[$configurationKey]); if (!$readonly && isset($this->postValues['enable']) && $this->postValues['enable'] === $this->name && isset($this->postValues[$this->name][$configurationKey]) ) { $currentValue = $this->postValues[$this->name][$configurationKey]; } else { $currentValue = $this->configurationManager->getConfigurationValueByPath($configurationKey); } $configurationValues[$configurationKey] = [ 'value' => $currentValue, 'readonly' => $readonly, ]; } return $configurationValues; } }