30 parent::__construct($factoryElement, $factoryCollection, $escaper,
$data);
32 $this->setExtType(
'multiple');
43 $name = parent::getName();
44 if (strpos(
$name,
'[]') ===
false) {
57 $this->
addClass(
'select multiselect admin__control-multiselect');
59 if ($this->getCanBeEmpty()) {
61 <input type="hidden" id="' . $this->
getHtmlId() .
'_hidden" name="' . parent::getName() .
'" value="" /> 64 if (!empty($this->_data[
'disabled'])) {
65 $html .=
'<input type="hidden" name="' . parent::getName() .
'_disabled" value="" />';
70 ) . $this->
_getUiId() .
' multiple="multiple">' .
"\n";
72 $value = $this->getValue();
80 if (is_array(
$option[
'value'])) {
81 $html .=
'<optgroup label="' .
$option[
'label'] .
'">' .
"\n";
82 foreach (
$option[
'value'] as $groupItem) {
85 $html .=
'</optgroup>' .
"\n";
92 $html .=
'</select>' .
"\n";
127 $result = $this->getNoSpan() ===
true ?
'' :
'<span class="field-row">' .
"\n";
131 if ($this->getSelectAll() && $this->getDeselectAll()) {
132 $result .=
'<a href="#" onclick="return ' .
135 $this->getSelectAll() .
136 '</a> <span class="separator"> | </span>';
137 $result .=
'<a href="#" onclick="return ' .
140 $this->getDeselectAll() .
144 $result .= $this->getNoSpan() ===
true ?
'' :
'</span>' .
"\n";
146 $result .=
'<script type="text/javascript">' .
"\n";
148 $result .=
' selectAll: function() { ' .
"\n";
150 $result .=
' for(var i = 0; i < sel.options.length; i ++) { ' .
"\n";
151 $result .=
' sel.options[i].selected = true; ' .
"\n";
153 $result .=
' return false; ' .
"\n";
155 $result .=
' deselectAll: function() {' .
"\n";
157 $result .=
' for(var i = 0; i < sel.options.length; i ++) { ' .
"\n";
158 $result .=
' sel.options[i].selected = false; ' .
"\n";
160 $result .=
' return false; ' .
"\n";
175 return $this->
getHtmlId() .
'ElementControl';
185 $html =
'<option value="' . $this->
_escape(
$option[
'value']) .
'"';
187 $html .= isset(
$option[
'style']) ?
'style="' .
$option[
'style'] .
'"' :
'';
188 if (in_array((
string)
$option[
'value'], $selected)) {
189 $html .=
' selected="selected"';
191 $html .=
'>' . $this->
_escape($option[
'label']) .
'</option>' .
"\n";
if(!isset($_GET['name'])) $name