From: John Du Hart Date: Sat, 22 Oct 2011 20:10:41 +0000 (+0000) Subject: Removing extra stuff that was committed in r100512 X-Git-Tag: 1.31.0-rc.0~26962 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=525f1b0a9d5436665078048f7fe9ebfd714f11a1;p=lhc%2Fweb%2Fwiklou.git Removing extra stuff that was committed in r100512 --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 15a73f9f50..50ff097767 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1374,8 +1374,6 @@ class HTMLSelectField extends HTMLFormField { return $p; } - print_r( $value ); - $validOptions = HTMLFormField::flattenOptions( $this->mParams['options'] ); if ( in_array( $value, $validOptions ) ) @@ -1401,54 +1399,10 @@ class HTMLSelectField extends HTMLFormField { $select->setAttribute( 'disabled', 'disabled' ); } - if ( !empty( $this->mParams['multiple'] ) ) { - $select->setAttribute( 'name', $this->mName . '[]' ); - $select->setAttribute( 'multiple', 'multiple' ); - - if ( !empty( $this->mParams['size'] ) ) { - $select->setAttribute( 'size', $this->mParams['size'] ); - } - } - $select->addOptions( $this->mParams['options'] ); return $select->getHTML(); } - - /** - * @param $request WebRequest - * @return String - */ - function loadDataFromRequest( $request ) { - if ( $this->mParent->getMethod() == 'post' ) { - if( $request->wasPosted() ){ - # Checkboxes are just not added to the request arrays if they're not checked, - # so it's perfectly possible for there not to be an entry at all - return $request->getArray( $this->mName, array() ); - } else { - # That's ok, the user has not yet submitted the form, so show the defaults - return $this->getDefault(); - } - } else { - # This is the impossible case: if we look at $_GET and see no data for our - # field, is it because the user has not yet submitted the form, or that they - # have submitted it with all the options unchecked? We will have to assume the - # latter, which basically means that you can't specify 'positive' defaults - # for GET forms. - # @todo FIXME... - return $request->getArray( $this->mName, array() ); - } - } - - public static function keysAreValues( $array ) { - $resultArray = array(); - - foreach ( $array as $name => $value ) { - $resultArray[$value] = $value; - } - - return $resultArray; - } } /** @@ -1924,7 +1878,7 @@ class HTMLHiddenField extends HTMLFormField { $this->mParent->addHiddenField( $this->mName, - $value, + $this->mDefault, $params );