TYPO3 CMS  TYPO3_6-2
ResetElement.php
Go to the documentation of this file.
1 <?php
3 
23 
29  protected $allowedAttributes = array(
30  'accesskey' => '',
31  'alt' => '',
32  'class' => '',
33  'dir' => '',
34  'disabled' => '',
35  'id' => '',
36  'lang' => '',
37  'name' => '',
38  'style' => '',
39  'tabindex' => '',
40  'title' => '',
41  'type' => 'reset',
42  'value' => ''
43  );
44 
50  protected $mandatoryAttributes = array(
51  'name',
52  'id'
53  );
54 
65  public function setValue($value = '') {
66  $localizationHandler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Localization');
67  // Value not set from typoscript
68  $oldValue = $this->getAttributeValue('value');
69  if (empty($oldValue)) {
70  if (!empty($value)) {
71  $newValue = (string) $value;
72  } else {
73  $newValue = $localizationHandler->getLocalLanguageLabel('tx_form_domain_model_element_reset.value');
74  }
75  $this->value = (string) $newValue;
76  $this->setAttribute('value', $newValue);
77  }
78  }
79 
80 }