* @param $text String
* @param $linestart Boolean: is this the start of a line?
*/
- public function addWikiText( $text, $linestart = true ) {
+ public function addWikiText( $text, $linestart = true, $interface = false ) {
$title = $this->getTitle(); // Work arround E_STRICT
- $this->addWikiTextTitle( $text, $title, $linestart );
+ $this->addWikiTextTitle( $text, $title, $linestart, /*tidy*/false, $interface );
}
/**
* @param $title Title object
* @param $linestart Boolean: is this the start of a line?
* @param $tidy Boolean: whether to use tidy
+ * @param $interface Boolean: whether it is an interface message
+ * (for example disables conversion)
*/
- public function addWikiTextTitle( $text, &$title, $linestart, $tidy = false ) {
+ public function addWikiTextTitle( $text, &$title, $linestart, $tidy = false, $interface = false ) {
global $wgParser;
wfProfileIn( __METHOD__ );
$popts = $this->parserOptions();
$oldTidy = $popts->setTidy( $tidy );
+ $popts->setInterfaceMessage( (bool) $interface );
$parserOutput = $wgParser->parse(
$text, $title, $popts,
$this->enableClientCache( false );
$this->mRedirect = '';
$this->mBodytext = '';
- $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) );
+ $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ),
+ /*linestart*/true, /*interface*/true );
}
/**
} else {
$this->setPageTitle( wfMsg( 'badaccess' ) );
}
- $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
+ $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ),
+ /*linestart*/true, /*interface*/true );
} else {
// Wiki is read only
throw new ReadOnlyError;
}
$s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s );
}
- $this->addWikiText( $s );
+ $this->addWikiText( $s, /*linestart*/true, /*interface*/true );
}
/**
'yourrealname' => 'Real name:',
'yourlanguage' => 'Language:',
'yourvariant' => 'Content language variant:',
-'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.',
+'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.',
'yournick' => 'New signature:',
'prefs-help-signature' => 'Comments on talk pages should be signed with "<nowiki>~~~~</nowiki>" which will be converted into your signature and a timestamp.',
'badsig' => 'Invalid raw signature.