PluginProbe
User Access Manager / 2.3.16
User Access Manager v2.3.16
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / src / View / AdminForm / Radio.php

Radio.php in User Access Manager 2.3.16, at src/View/AdminForm/Radio.php

81 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @var Radio $radio
4 */
5
6 use UserAccessManager\Form\Input;
7 use UserAccessManager\Form\Radio;
8 use UserAccessManager\Form\Select;
9 use UserAccessManager\Form\Textarea;
10
11 ?>
12 <th scope="row"><?php echo $radio->getLabel(); ?></th>
13 <td>
14 <?php
15 $possibleValues = $radio->getPossibleValues();
16
17 foreach ($possibleValues as $possibleValue) {
18 $rawValue = $possibleValue->getValue();
19 $formValue = (is_bool($rawValue) === true) ?
20 (($rawValue === true) ? 'true' : 'false') : $rawValue;
21
22 ?>
23 <label for="uam_<?php echo $radio->getId() . '_' . $formValue; ?>">
24 <input id="uam_<?php echo $radio->getId() . '_' . $formValue; ?>"
25 type="radio"
26 name="config_parameters[<?php echo $radio->getId(); ?>]"
27 value="<?php echo $formValue; ?>"
28 <?php
29 if ($radio->getValue() === $possibleValue->getValue()) {
30 echo 'checked="checked"';
31 }
32 ?>
33 />
34 <?php echo $possibleValue->getLabel(); ?>
35 </label>&nbsp;&nbsp;&nbsp;
36 <?php
37 $subElement = $possibleValue->getSubElement();
38
39 if ($subElement !== null) {
40 if ($subElement instanceof Input) {
41 ?>
42 <input id="uam_<?php echo $subElement->getId(); ?>"
43 name="config_parameters[<?php echo $subElement->getId(); ?>]"
44 value="<?php echo $subElement->getValue(); ?>"/>
45 <?php
46 } elseif ($subElement instanceof Textarea) {
47 ?>
48 <textarea id="uam_<?php echo $subElement->getId(); ?>"
49 style="width:100%;min-height:120px;"
50 name="config_parameters[<?php echo $subElement->getId(); ?>]"><?php
51 echo htmlentities($subElement->getValue());
52 ?></textarea>
53 <?php
54 } elseif ($subElement instanceof Select) {
55 ?>
56 <select id="uam_<?php echo $subElement->getId(); ?>"
57 name="config_parameters[<?php echo $subElement->getId(); ?>]">
58 <?php
59 $subPossibleValues = $subElement->getPossibleValues();
60
61 foreach ($subPossibleValues as $subPossibleValue) {
62 ?>
63 <option value="<?php echo $subPossibleValue->getValue(); ?>" <?php
64 if ($subElement->getValue() === $subPossibleValue->getValue()) {
65 echo 'selected="selected"';
66 }
67 ?> >
68 <?php echo $subPossibleValue->getLabel(); ?>
69 </option>
70 <?php
71 }
72 ?>
73 </select>
74 <?php
75 }
76 }
77 }
78 ?>
79 <br/>
80 <p><?php echo $radio->getDescription(); ?></p>
81 </td>