Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * This file contain a class to easily build HTML forms as well as custom |
5 | | - * functions used by SpecialUserrights.php |
| 4 | + * This file contain a class to easily build HTML forms |
6 | 5 | */ |
7 | 6 | |
8 | 7 | /** |
— | — | @@ -106,53 +105,3 @@ |
107 | 106 | "<textarea name=\"{$varname}\" rows=\"5\" cols=\"{$size}\">{$s}</textarea>\n"; |
108 | 107 | } |
109 | 108 | } // end class |
110 | | - |
111 | | -/** Build a select with all defined groups |
112 | | - * |
113 | | - * used by SpecialUserrights.php |
114 | | - * @todo move it to there, and don't forget to copy it for SpecialMakesysop.php |
115 | | - * |
116 | | - * @param $selectname String: name of this element. Name of form is automaticly prefixed. |
117 | | - * @param $selectmsg String: FIXME |
118 | | - * @param $selected Array: array of element selected when posted. Only multiples will show them. |
119 | | - * @param $multiple Boolean: A multiple elements select. |
120 | | - * @param $size Integer: number of elements to be shown ignored for non-multiple (default 6). |
121 | | - * @param $reverse Boolean: if true, multiple select will hide selected elements (default false). |
122 | | - * @todo Document $selectmsg |
123 | | -*/ |
124 | | -function HTMLSelectGroups($selectname, $selectmsg, $selected=array(), $multiple=false, $size=6, $reverse=false) { |
125 | | - $groups = User::getAllGroups(); |
126 | | - $out = htmlspecialchars( wfMsg( $selectmsg ) ); |
127 | | - $out .= "<br />"; |
128 | | - |
129 | | - if( $multiple ) { |
130 | | - $attribs = array( |
131 | | - 'name' => $selectname . '[]', |
132 | | - 'multiple'=> 'multiple', |
133 | | - 'size' => $size ); |
134 | | - } else { |
135 | | - $attribs = array( 'name' => $selectname ); |
136 | | - } |
137 | | - $attribs['style'] = 'width: 100%'; |
138 | | - $out .= wfOpenElement( 'select', $attribs ); |
139 | | - |
140 | | - foreach( $groups as $group ) { |
141 | | - $attribs = array( 'value' => $group ); |
142 | | - if( $multiple ) { |
143 | | - // for multiple will only show the things we want |
144 | | - if( !in_array( $group, $selected ) xor $reverse ) { |
145 | | - continue; |
146 | | - } |
147 | | - } else { |
148 | | - if( in_array( $group, $selected ) ) { |
149 | | - $attribs['selected'] = 'selected'; |
150 | | - } |
151 | | - } |
152 | | - $out .= wfElement( 'option', $attribs, User::getGroupName( $group ) ) . "\n"; |
153 | | - } |
154 | | - |
155 | | - $out .= "</select>\n"; |
156 | | - return $out; |
157 | | -} |
158 | | - |
159 | | - |