'input',
array(
'type' => 'reset',
- 'value' => wfMessage( 'htmlform-reset' )->text()
+ 'value' => $this->msg( 'htmlform-reset' )->text()
)
) . "\n";
}
function getSubmitText() {
return $this->mSubmitText
? $this->mSubmitText
- : wfMessage( 'htmlform-submit' )->text();
+ : $this->msg( 'htmlform-submit' )->text();
}
/**
* @return String
*/
public function getLegend( $key ) {
- return wfMessage( "{$this->mMessagePrefix}-$key" )->text();
+ return $this->msg( "{$this->mMessagePrefix}-$key" )->text();
}
/**
*/
function validate( $value, $alldata ) {
if ( isset( $this->mParams['required'] ) && $this->mParams['required'] !== false && $value === '' ) {
- return wfMessage( 'htmlform-required' )->parse();
+ return $this->mParent->msg( 'htmlform-required' )->parse();
}
if ( isset( $this->mValidationCallback ) ) {
if ( isset( $this->mParams['help-messages'] ) ) {
foreach ( $this->mParams['help-messages'] as $name ) {
$helpMessage = (array)$name;
- $msg = wfMessage( array_shift( $helpMessage ), $helpMessage );
+ $msg = $this->mParent->msg( array_shift( $helpMessage ), $helpMessage );
if ( $msg->exists() ) {
if ( is_null( $helptext ) ) {
$helptext = '';
} else {
- $helptext .= wfMessage( 'word-separator' )->escaped(); // some space
+ $helptext .= $this->mParent->msg( 'word-separator' )->escaped(); // some space
}
$helptext .= $msg->parse(); // Append message
}
# http://dev.w3.org/html5/spec/common-microsyntaxes.html#real-numbers
# with the addition that a leading '+' sign is ok.
if ( !preg_match( '/^((\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?)?$/i', $value ) ) {
- return wfMessage( 'htmlform-float-invalid' )->parseAsBlock();
+ return $this->mParent->msg( 'htmlform-float-invalid' )->parseAsBlock();
}
# The "int" part of these message names is rather confusing.
$min = $this->mParams['min'];
if ( $min > $value ) {
- return wfMessage( 'htmlform-int-toolow', array( $min ) )->parseAsBlock();
+ return $this->mParent->msg( 'htmlform-int-toolow', $min )->parseAsBlock();
}
}
$max = $this->mParams['max'];
if ( $max < $value ) {
- return wfMessage( 'htmlform-int-toohigh', array( $max ) )->parseAsBlock();
+ return $this->mParent->msg( 'htmlform-int-toohigh', $max )->parseAsBlock();
}
}
# value to, eg, save in the DB, clean it up with intval().
if ( !preg_match( '/^((\+|\-)?\d+)?$/', trim( $value ) )
) {
- return wfMessage( 'htmlform-int-invalid' )->parseAsBlock();
+ return $this->mParent->msg( 'htmlform-int-invalid' )->parseAsBlock();
}
return true;
if ( in_array( $value, $validOptions ) )
return true;
else
- return wfMessage( 'htmlform-select-badoption' )->parse();
+ return $this->mParent->msg( 'htmlform-select-badoption' )->parse();
}
function getInputHTML( $value ) {
if ( count( $validValues ) == count( $value ) ) {
return true;
} else {
- return wfMessage( 'htmlform-select-badoption' )->parse();
+ return $this->mParent->msg( 'htmlform-select-badoption' )->parse();
}
}
} elseif ( $text == '' ) {
$final = $list;
} else {
- $final = $list . wfMessage( 'colon-separator' )->inContentLanguage()->text() . $text;
+ $final = $list . $this->mParent->msg( 'colon-separator' )->inContentLanguage()->text() . $text;
}
} else {
$list = 'other';
$text = $final;
foreach ( $this->mFlatOptions as $option ) {
- $match = $option . wfMessage( 'colon-separator' )->inContentLanguage()->text();
+ $match = $option . $this->mParent->msg( 'colon-separator' )->inContentLanguage()->text();
if ( strpos( $text, $match ) === 0 ) {
$list = $option;
$text = substr( $text, strlen( $match ) );
}
if ( isset( $this->mParams['required'] ) && $this->mParams['required'] !== false && $value[1] === '' ) {
- return wfMessage( 'htmlform-required' )->parse();
+ return $this->mParent->msg( 'htmlform-required' )->parse();
}
return true;
if ( in_array( $value, $validOptions ) ) {
return true;
} else {
- return wfMessage( 'htmlform-select-badoption' )->parse();
+ return $this->mParent->msg( 'htmlform-select-badoption' )->parse();
}
}
protected function formatMsg() {
if ( empty( $this->mParams['message'] ) ) {
- $msg = wfMessage( 'edittools' );
+ $msg = $this->mParent->msg( 'edittools' );
} else {
- $msg = wfMessage( $this->mParams['message'] );
+ $msg = $this->mParent->msg( $this->mParams['message'] );
if ( $msg->isDisabled() ) {
- $msg = wfMessage( 'edittools' );
+ $msg = $this->mParent->msg( 'edittools' );
}
}
$msg->inContentLanguage();