TYPO3 CMS  TYPO3_6-2
SubmitElement.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' => 'submit',
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  // Value not set from typoscript
69  $oldValue = $this->getAttributeValue('value');
70  if (empty($oldValue)) {
71  if (!empty($value)) {
72  $newValue = (string) $value;
73  } else {
74  $newValue = $localizationHandler->getLocalLanguageLabel('tx_form_domain_model_element_submit.value');
75  }
76  $this->value = (string) $newValue;
77  $this->setAttribute('value', $newValue);
78  }
79  }
80 
81 }