Removing the function HTMLSelectGroups: no longer used (both Special:Userrights and...
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 7 Aug 2007 19:52:24 +0000 (19:52 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 7 Aug 2007 19:52:24 +0000 (19:52 +0000)
includes/HTMLForm.php

index 0aaa076..69ec100 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 /**
- * This file contain a class to easily build HTML forms as well as custom
- * functions used by SpecialUserrights.php
+ * This file contain a class to easily build HTML forms
  */
 
 /**
@@ -106,53 +105,3 @@ class HTMLForm {
                        "<textarea name=\"{$varname}\" rows=\"5\" cols=\"{$size}\">{$s}</textarea>\n";
        }
 } // end class
-
-/** Build a select with all defined groups
- *
- * used by SpecialUserrights.php
- * @todo move it to there, and don't forget to copy it for SpecialMakesysop.php
- *
- * @param $selectname String: name of this element. Name of form is automaticly prefixed.
- * @param $selectmsg String: FIXME
- * @param $selected Array: array of element selected when posted. Only multiples will show them.
- * @param $multiple Boolean: A multiple elements select.
- * @param $size Integer: number of elements to be shown ignored for non-multiple (default 6).
- * @param $reverse Boolean: if true, multiple select will hide selected elements (default false).
- * @todo Document $selectmsg
-*/
-function HTMLSelectGroups($selectname, $selectmsg, $selected=array(), $multiple=false, $size=6, $reverse=false) {
-       $groups = User::getAllGroups();
-       $out = htmlspecialchars( wfMsg( $selectmsg ) );
-       $out .= "<br />";
-
-       if( $multiple ) {
-               $attribs = array(
-                       'name'    => $selectname . '[]',
-                       'multiple'=> 'multiple',
-                       'size'    => $size );
-       } else {
-               $attribs = array( 'name' => $selectname );
-       }
-       $attribs['style'] = 'width: 100%';
-       $out .= wfOpenElement( 'select', $attribs );
-
-       foreach( $groups as $group ) {
-               $attribs = array( 'value' => $group );
-               if( $multiple ) {
-                       // for multiple will only show the things we want
-                       if( !in_array( $group, $selected ) xor $reverse ) {
-                               continue;
-                       }
-               } else {
-                       if( in_array( $group, $selected ) ) {
-                               $attribs['selected'] = 'selected';
-                       }
-               }
-               $out .= wfElement( 'option', $attribs, User::getGroupName( $group ) ) . "\n";
-       }
-
-       $out .= "</select>\n";
-       return $out;
-}
-
-