* r96737: set OutputPage->addWikiText() as an interface message by default
authorRobin Pepermans <robin@users.mediawiki.org>
Sun, 11 Sep 2011 21:07:17 +0000 (21:07 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Sun, 11 Sep 2011 21:07:17 +0000 (21:07 +0000)
* r96760: use 'noflip' for $flip in OutputPage->addInlineStyle() so it's always a string
* Add some parameter documentation

includes/ImagePage.php
includes/OutputPage.php
includes/parser/Parser.php
includes/specials/SpecialVersion.php

index 956977e..f461fa7 100644 (file)
@@ -784,6 +784,8 @@ EOT
 
        /**
         * Display an error with a wikitext description
+        *
+        * @param $description String
         */
        function showError( $description ) {
                global $wgOut;
index 8821465..e24cc2f 100644 (file)
@@ -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 );
        }
 
        /**
index 1f6f716..68356e4 100644 (file)
@@ -530,6 +530,11 @@ class Parser {
         *
         * <noinclude>, <includeonly> 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
index bb7daca..0bd9948 100644 (file)
@@ -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 = '' ) {