r24662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24661‎ | r24662 | r24663 >
Date:19:52, 7 August 2007
Author:rotem
Status:old
Tags:
Comment:
Removing the function HTMLSelectGroups: no longer used (both Special:Userrights and Special:Makesysop use a function from their class).
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -1,7 +1,6 @@
22 <?php
33 /**
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
65 */
76
87 /**
@@ -106,53 +105,3 @@
107106 "<textarea name=\"{$varname}\" rows=\"5\" cols=\"{$size}\">{$s}</textarea>\n";
108107 }
109108 } // 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 -

Follow-up revisions

RevisionCommit summaryAuthorDate
r24705Merged revisions 24632-24693 via svnmerge from...david19:15, 9 August 2007

Status & tagging log