X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHTMLForm.php;h=69ec1007c262ae32cc5fdc603e506816facadae2;hb=0495f90ebb83c0295f67b9da410ddf3b0534ca38;hp=c3d74b20a9ea4acbb649cf3bbe9bbc600ee828bd;hpb=6f0d8da544fe39fc756ced6cfa9d590c01478194;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index c3d74b20a9..69ec1007c2 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1,14 +1,11 @@ " . wfMsg( $this->mName.'-'.$varname.'-'.$value ) . "\n"; } - return $this->fieldset( $this->mName.'-'.$varname, $s ); + return $this->fieldset( $varname, $s ); } /** @@ -99,7 +96,7 @@ class HTMLForm { if ( $this->mRequest->wasPosted() ) { $arr = $this->mRequest->getArray( $varname ); if ( is_array( $arr ) ) { - foreach ( $_POST[$varname] as $index => $element ) { + foreach ( $_POST[$varname] as $element ) { $s .= htmlspecialchars( $element )."\n"; } } @@ -108,70 +105,3 @@ class HTMLForm { "\n"; } } // end class - - -// functions used by SpecialUserrights.php - -/** Build a select with all defined groups - * @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 ) ); - - if( $multiple ) { - $attribs = array( - 'name' => $selectname . '[]', - 'multiple'=> 'multiple', - 'size' => $size ); - } else { - $attribs = array( 'name' => $selectname ); - } - $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 .= "\n"; - return $out; -} - -/** Build a select with all existent rights - * @param $selected Array: Names(?) of user rights that should be selected. - * @return string HTML select. - */ -function HTMLSelectRights($selected='') { - global $wgAvailableRights; - $out = '\n"; - return $out; -} -?>