* @param $errors Array of message keys/values
* @return String HTML, a <ul> list of errors
*/
- static function formatErrors( $errors ) {
+ public static function formatErrors( $errors ) {
$errorstr = '';
foreach ( $errors as $error ) {
}
// GetCheck won't work like we want for checks.
- if ( $request->getCheck( 'wpEditToken' ) ) {
+ if ( $request->getCheck( 'wpEditToken' ) || $this->mParent->getMethod() != 'post' ) {
// XOR has the following truth table, which is what we want
// INVERT VALUE | OUTPUT
// true true | false
* Multi-select field
*/
class HTMLMultiSelectField extends HTMLFormField {
+
+ public function __construct( $params ){
+ parent::__construct( $params );
+ if( isset( $params['flatlist'] ) ){
+ $this->mClass .= ' mw-htmlform-multiselect-flatlist';
+ }
+ }
+
function validate( $value, $alldata ) {
$p = parent::validate( $value, $alldata );
$attribs + $thisAttribs );
$checkbox .= ' ' . Html::rawElement( 'label', array( 'for' => "{$this->mID}-$info" ), $label );
- $html .= Html::rawElement( 'div', array( 'class' => 'mw-htmlform-multiselect-item' ), $checkbox );
+ $html .= ' ' . Html::rawElement( 'div', array( 'class' => 'mw-htmlform-multiselect-item' ), $checkbox );
}
}