TYPO3 CMS  TYPO3_6-2
ButtonElement.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' => 'button',
42  'value' => ''
43  );
44 
50  protected $mandatoryAttributes = array(
51  'name',
52  'id'
53  );
54 
65  public function setValue($value = '') {
67  $localizationHandler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Localization');
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_button.value');
74  }
75  $this->value = (string) $newValue;
76  $this->setAttribute('value', $newValue);
77  }
78  }
79 
80 }