}
}
- $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text();
+ $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
if ( $this->missingComment ) {
$out->wrapWikiMsg( "<div id='mw-missingcommenttext'>\n$1\n</div>", 'missingcommenttext' );
* @return string
*/
public function getPreviewText() {
- global $wgRawHtml, $wgLang;
+ global $wgRawHtml;
global $wgAllowUserCss, $wgAllowUserJs;
$out = $this->context->getOutput();
# provide a anchor link to the editform
$continueEditing = '<span class="mw-continue-editing">' .
- '[[#' . self::EDITFORM_ID . '|' . $wgLang->getArrow() . ' ' .
+ '[[#' . self::EDITFORM_ID . '|' .
+ $this->context->getLanguage()->getArrow() . ' ' .
$this->context->msg( 'continue-editing' )->text() . ']]</span>';
if ( $this->mTriedSave && !$this->mTokenOk ) {
if ( $this->mTokenOkExceptSuffix ) {
*
* @return string
*/
- private function getSaveButtonLabel() {
+ protected function getSubmitButtonLabel() {
$labelAsPublish =
- $this->mArticle->getContext()->getConfig()->get( 'EditSubmitButtonLabelPublish' );
+ $this->context->getConfig()->get( 'EditSubmitButtonLabelPublish' );
// Can't use $this->isNew as that's also true if we're adding a new section to an extant page
$newPage = !$this->mTitle->exists();
public function getEditButtons( &$tabindex ) {
$buttons = [];
- $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text();
+ $buttonLabel = $this->context->msg( $this->getSubmitButtonLabel() )->text();
$attribs = [
'name' => 'wpSave',
* @param string|array|bool $match Text (or array of texts) which triggered one or more filters
*/
public function spamPageWithContent( $match = false ) {
- global $wgLang;
$this->textbox2 = $this->textbox1;
if ( is_array( $match ) ) {
- $match = $wgLang->listToText( $match );
+ $match = $this->context->getLanguage()->listToText( $match );
}
$out = $this->context->getOutput();
$out->prepareErrorPage( $this->context->msg( 'spamprotectiontitle' ) );
* @since 1.29
*/
protected function addLongPageWarningHeader() {
- global $wgMaxArticleSize, $wgLang;
+ global $wgMaxArticleSize;
if ( $this->contentLength === false ) {
$this->contentLength = strlen( $this->textbox1 );
}
$out = $this->context->getOutput();
+ $lang = $this->context->getLanguage();
if ( $this->tooBig || $this->contentLength > $wgMaxArticleSize * 1024 ) {
$out->wrapWikiMsg( "<div class='error' id='mw-edit-longpageerror'>\n$1\n</div>",
[
'longpageerror',
- $wgLang->formatNum( round( $this->contentLength / 1024, 3 ) ),
- $wgLang->formatNum( $wgMaxArticleSize )
+ $lang->formatNum( round( $this->contentLength / 1024, 3 ) ),
+ $lang->formatNum( $wgMaxArticleSize )
]
);
} else {
$out->wrapWikiMsg( "<div id='mw-edit-longpage-hint'>\n$1\n</div>",
[
'longpage-hint',
- $wgLang->formatSize( strlen( $this->textbox1 ) ),
+ $lang->formatSize( strlen( $this->textbox1 ) ),
strlen( $this->textbox1 )
]
);
protected function addExplainConflictHeader( OutputPage $out ) {
$out->wrapWikiMsg(
"<div class='mw-explainconflict'>\n$1\n</div>",
- [ 'explainconflict', $this->context->msg( $this->getSaveButtonLabel() )->text() ]
+ [ 'explainconflict', $this->context->msg( $this->getSubmitButtonLabel() )->text() ]
);
}