From d8887852c03605a943ba0bd377c9eebe6e08d5cd Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Tue, 7 Aug 2007 19:52:24 +0000 Subject: [PATCH] Removing the function HTMLSelectGroups: no longer used (both Special:Userrights and Special:Makesysop use a function from their class). --- includes/HTMLForm.php | 53 +------------------------------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 0aaa076615..69ec1007c2 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1,7 +1,6 @@ {$s}\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 .= "
"; - - 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 .= "\n"; - return $out; -} - - -- 2.20.1