diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-09-14 13:18:58 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-09-14 13:18:58 +0200 |
commit | 8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch) | |
tree | cd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /includes/HTMLForm.php | |
parent | d7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff) |
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 'includes/HTMLForm.php')
-rw-r--r-- | includes/HTMLForm.php | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 715c8c88..69ec1007 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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 .= wfElement( 'select', $attribs, null ); - - 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; -} - -?> |