@@ 93-111 (lines=19) @@ | ||
90 | $ret .= '<div class="input-group">'; |
|
91 | } |
|
92 | $idCount = 0; |
|
93 | foreach ($elementOptions as $value => $name) { |
|
94 | $this->remove('checked'); |
|
95 | if (!empty($elementValue) && in_array($value, $elementValue)) { |
|
96 | $this->set('checked'); |
|
97 | } |
|
98 | $this->set('value', $value); |
|
99 | ++$idCount; |
|
100 | $this->set('id', $elementId . $idCount); |
|
101 | if ($inline) { |
|
102 | $ret .= '<label class="checkbox-inline">'; |
|
103 | $ret .= '<input ' . $this->renderAttributeString() . $extra . ">" . $name . "\n"; |
|
104 | $ret .= "</label>\n"; |
|
105 | } else { |
|
106 | $ret .= "<div class=\"checkbox\">\n<label>"; |
|
107 | $ret .= '<input ' . $this->renderAttributeString() . $extra . '>' . $name . "\n"; |
|
108 | $ret .= "</label>\n</div>\n"; |
|
109 | } |
|
110 | ||
111 | } |
|
112 | if ($required) { |
|
113 | $this->set('required'); |
|
114 | } |
@@ 70-88 (lines=19) @@ | ||
67 | $ret .= '<div class="input-group">'; |
|
68 | } |
|
69 | static $id_ele = 0; |
|
70 | foreach ($ele_options as $value => $buttonCaption) { |
|
71 | $this->remove('checked'); |
|
72 | if (isset($ele_value) && $value == $ele_value) { |
|
73 | $this->set('checked'); |
|
74 | } |
|
75 | $this->set('value', $value); |
|
76 | ++$id_ele; |
|
77 | $this->set('id', $ele_name . $id_ele); |
|
78 | if ($inline) { |
|
79 | $ret .= '<label class="radio-inline">'; |
|
80 | $ret .= '<input ' . $this->renderAttributeString() . $extra . ">" . $buttonCaption . "\n"; |
|
81 | $ret .= "</label>\n"; |
|
82 | } else { |
|
83 | $ret .= "<div class=\"radio\">\n<label>"; |
|
84 | $ret .= '<input ' . $this->renderAttributeString() . $extra . '>' . "\n"; |
|
85 | $ret .= $buttonCaption . "\n"; |
|
86 | $ret .= "</label>\n</div>\n"; |
|
87 | } |
|
88 | } |
|
89 | if ($inline) { |
|
90 | $ret .= '</div>'; |
|
91 | } |