TYPO3 CMS  TYPO3_6-2
AbstractCustomPreset.php
Go to the documentation of this file.
1 <?php
3 
18 
22 abstract class AbstractCustomPreset extends AbstractPreset {
23 
27  protected $name = 'Custom';
28 
32  protected $isActive = FALSE;
33 
37  protected $priority = 10;
38 
44  public function isActive() {
45  return $this->isActive;
46  }
47 
58  public function setActive() {
59  $this->isActive = TRUE;
60  }
61 
67  public function isAvailable() {
68  return TRUE;
69  }
70 
78  public function getConfigurationValues() {
79  $configurationValues = array();
80  foreach ($this->configurationValues as $configurationKey => $configurationValue) {
81  if (isset($this->postValues['enable'])
82  && $this->postValues['enable'] === $this->name
83  && isset($this->postValues[$this->name][$configurationKey])
84  ) {
85  $currentValue = $this->postValues[$this->name][$configurationKey];
86  } else {
87  $currentValue = $this->configurationManager->getConfigurationValueByPath($configurationKey);
88  }
89  $configurationValues[$configurationKey] = $currentValue;
90  }
91  return $configurationValues;
92  }
93 }