r96812 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96811‎ | r96812 | r96813 >
Date:21:07, 11 September 2011
Author:robin
Status:ok
Tags:
Comment:
* 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
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -530,6 +530,11 @@
531531 *
532532 * <noinclude>, <includeonly> etc. are parsed as for template transclusion,
533533 * comments, templates, arguments, tags hooks and parser functions are untouched.
 534+ *
 535+ * @param $text String
 536+ * @param $title Title
 537+ * @param $options ParserOptions
 538+ * @return String
534539 */
535540 public function getPreloadText( $text, Title $title, ParserOptions $options ) {
536541 # Parser (re)initialisation
Index: trunk/phase3/includes/ImagePage.php
@@ -784,6 +784,8 @@
785785
786786 /**
787787 * Display an error with a wikitext description
 788+ *
 789+ * @param $description String
788790 */
789791 function showError( $description ) {
790792 global $wgOut;
Index: trunk/phase3/includes/OutputPage.php
@@ -1311,8 +1311,9 @@
13121312 *
13131313 * @param $text String
13141314 * @param $linestart Boolean: is this the start of a line?
 1315+ * @param $interface Boolean: is this text in the user interface language?
13151316 */
1316 - public function addWikiText( $text, $linestart = true, $interface = false ) {
 1317+ public function addWikiText( $text, $linestart = true, $interface = true ) {
13171318 $title = $this->getTitle(); // Work arround E_STRICT
13181319 $this->addWikiTextTitle( $text, $title, $linestart, /*tidy*/false, $interface );
13191320 }
@@ -1941,8 +1942,7 @@
19421943 $this->enableClientCache( false );
19431944 $this->mRedirect = '';
19441945 $this->mBodytext = '';
1945 - $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ),
1946 - /*linestart*/true, /*interface*/true );
 1946+ $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) );
19471947 }
19481948
19491949 /**
@@ -2081,8 +2081,7 @@
20822082 } else {
20832083 $this->setPageTitle( wfMsg( 'badaccess' ) );
20842084 }
2085 - $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ),
2086 - /*linestart*/true, /*interface*/true );
 2085+ $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
20872086 } else {
20882087 // Wiki is read only
20892088 throw new ReadOnlyError;
@@ -2958,9 +2957,9 @@
29592958 /**
29602959 * Adds inline CSS styles
29612960 * @param $style_css Mixed: inline CSS
2962 - * @param $flip False or String: Set to 'flip' to flip the CSS if needed
 2961+ * @param $flip String: Set to 'flip' to flip the CSS if needed
29632962 */
2964 - public function addInlineStyle( $style_css, $flip = false ) {
 2963+ public function addInlineStyle( $style_css, $flip = 'noflip' ) {
29652964 if( $flip === 'flip' && $this->getLang()->isRTL() ) {
29662965 # If wanted, and the interface is right-to-left, flip the CSS
29672966 $style_css = CSSJanus::transform( $style_css, true, false );
@@ -3049,6 +3048,9 @@
30503049 return $ret;
30513050 }
30523051
 3052+ /**
 3053+ * @return Array
 3054+ */
30533055 public function buildCssLinksArray() {
30543056 $links = array();
30553057
@@ -3223,7 +3225,7 @@
32243226 }
32253227 $s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s );
32263228 }
3227 - $this->addWikiText( $s, /*linestart*/true, /*interface*/true );
 3229+ $this->addWikiText( $s );
32283230 }
32293231
32303232 /**
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -64,7 +64,7 @@
6565 $text .= $this->getWgHooks();
6666 }
6767
68 - $out->addWikiText( $text, /*linestart*/true, /*interface*/true );
 68+ $out->addWikiText( $text );
6969 $out->addHTML( $this->IPInfo() );
7070
7171 if ( $this->getRequest()->getVal( 'easteregg' ) ) {
@@ -154,6 +154,7 @@
155155 /**
156156 * Return a string of the MediaWiki version with SVN revision if available.
157157 *
 158+ * @param $flags String
158159 * @return mixed
159160 */
160161 public static function getVersion( $flags = '' ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96737Correctly parse interface messages as such, so it doesn't get converted accor...robin20:05, 10 September 2011
r96760* Per Aaron on r96261, use string 'flip' instead of boolean...robin23:51, 10 September 2011

Status & tagging log