From 75932b439ddadafb4ce1762301d54caf0601a435 Mon Sep 17 00:00:00 2001 From: Robin Pepermans Date: Sun, 11 Sep 2011 21:07:17 +0000 Subject: [PATCH] * r96737: set OutputPage->addWikiText() as an interface message by default * r96760: use 'noflip' for $flip in OutputPage->addInlineStyle() so it's always a string * Add some parameter documentation --- includes/ImagePage.php | 2 ++ includes/OutputPage.php | 18 ++++++++++-------- includes/parser/Parser.php | 5 +++++ includes/specials/SpecialVersion.php | 3 ++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 956977e07f..f461fa7314 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -784,6 +784,8 @@ EOT /** * Display an error with a wikitext description + * + * @param $description String */ function showError( $description ) { global $wgOut; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 8821465b42..e24cc2fd17 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1311,8 +1311,9 @@ class OutputPage extends ContextSource { * * @param $text String * @param $linestart Boolean: is this the start of a line? + * @param $interface Boolean: is this text in the user interface language? */ - public function addWikiText( $text, $linestart = true, $interface = false ) { + public function addWikiText( $text, $linestart = true, $interface = true ) { $title = $this->getTitle(); // Work arround E_STRICT $this->addWikiTextTitle( $text, $title, $linestart, /*tidy*/false, $interface ); } @@ -1941,8 +1942,7 @@ class OutputPage extends ContextSource { $this->enableClientCache( false ); $this->mRedirect = ''; $this->mBodytext = ''; - $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ), - /*linestart*/true, /*interface*/true ); + $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) ); } /** @@ -2081,8 +2081,7 @@ class OutputPage extends ContextSource { } else { $this->setPageTitle( wfMsg( 'badaccess' ) ); } - $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ), - /*linestart*/true, /*interface*/true ); + $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) ); } else { // Wiki is read only throw new ReadOnlyError; @@ -2958,9 +2957,9 @@ $distantTemplates /** * Adds inline CSS styles * @param $style_css Mixed: inline CSS - * @param $flip False or String: Set to 'flip' to flip the CSS if needed + * @param $flip String: Set to 'flip' to flip the CSS if needed */ - public function addInlineStyle( $style_css, $flip = false ) { + public function addInlineStyle( $style_css, $flip = 'noflip' ) { if( $flip === 'flip' && $this->getLang()->isRTL() ) { # If wanted, and the interface is right-to-left, flip the CSS $style_css = CSSJanus::transform( $style_css, true, false ); @@ -3049,6 +3048,9 @@ $distantTemplates return $ret; } + /** + * @return Array + */ public function buildCssLinksArray() { $links = array(); @@ -3223,7 +3225,7 @@ $distantTemplates } $s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s ); } - $this->addWikiText( $s, /*linestart*/true, /*interface*/true ); + $this->addWikiText( $s ); } /** diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 1f6f7166c0..68356e48ff 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -530,6 +530,11 @@ class Parser { * * , etc. are parsed as for template transclusion, * comments, templates, arguments, tags hooks and parser functions are untouched. + * + * @param $text String + * @param $title Title + * @param $options ParserOptions + * @return String */ public function getPreloadText( $text, Title $title, ParserOptions $options ) { # Parser (re)initialisation diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index bb7daca841..0bd994815d 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -64,7 +64,7 @@ class SpecialVersion extends SpecialPage { $text .= $this->getWgHooks(); } - $out->addWikiText( $text, /*linestart*/true, /*interface*/true ); + $out->addWikiText( $text ); $out->addHTML( $this->IPInfo() ); if ( $this->getRequest()->getVal( 'easteregg' ) ) { @@ -154,6 +154,7 @@ class SpecialVersion extends SpecialPage { /** * Return a string of the MediaWiki version with SVN revision if available. * + * @param $flags String * @return mixed */ public static function getVersion( $flags = '' ) { -- 2.20.1