TYPO3 CMS  TYPO3_6-2
RadioElement.php
Go to the documentation of this file.
1 <?php
3 
23 
29  protected $allowedAttributes = array(
30  'accesskey' => '',
31  'alt' => '',
32  'checked' => '',
33  'class' => '',
34  'dir' => '',
35  'disabled' => '',
36  'id' => '',
37  'lang' => '',
38  'name' => '',
39  'style' => '',
40  'tabindex' => '',
41  'title' => '',
42  'type' => 'radio',
43  'value' => ''
44  );
45 
51  protected $mandatoryAttributes = array(
52  'name',
53  'id'
54  );
55 
62  protected $acceptsParentName = TRUE;
63 
74  if ($this->value === '') {
75  $this->value = (string) $this->getElementId();
76  $this->setAttribute('value', $this->value);
77  }
78  if ($this->requestHandler->has($this->getName())) {
79  $submittedValue = $this->requestHandler->getByMethod($this->getName());
80  if ($submittedValue === $this->value) {
81  $this->setAttribute('checked', 'checked');
82  }
83  } elseif ($this->requestHandler->hasRequest()) {
84  $this->attributes->removeAttribute('checked');
85  }
86  return $this;
87  }
88 
89 }