r60426 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60425‎ | r60426 | r60427 >
Date:14:59, 27 December 2009
Author:ialex
Status:ok
Tags:
Comment:
Added --prefix option to maintenance/language/checkLanguage.php to add interwiki prefix to links (when using --links option)
Modified paths:
  • /trunk/phase3/maintenance/language/checkLanguage.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/checkLanguage.inc
@@ -7,6 +7,7 @@
88 protected $code = null;
99 protected $level = 2;
1010 protected $doLinks = false;
 11+ protected $linksPrefix = '';
1112 protected $wikiCode = 'en';
1213 protected $checkAll = false;
1314 protected $output = 'plain';
@@ -42,6 +43,10 @@
4344 $this->includeExif = !isset( $options['noexif'] );
4445 $this->checkAll = isset( $options['all'] );
4546
 47+ if ( isset( $options['prefix'] ) ) {
 48+ $this->linksPrefix = $options['prefix'];
 49+ }
 50+
4651 if ( isset( $options['wikilang'] ) ) {
4752 $this->wikiCode = $options['wikilang'];
4853 }
@@ -190,6 +195,7 @@
191196 * help: Show this help.
192197 * level: Show the following display level (default: 2).
193198 * links: Link the message values (default off).
 199+ * prefix: prefix to add to links.
194200 * wikilang: For the links, what is the content language of the wiki to display the output in (default en).
195201 * whitelist: Do only the following checks (form: code,code).
196202 * blacklist: Don't do the following checks (form: code,code).
@@ -316,9 +322,9 @@
317323 if ( $this->doLinks ) {
318324 $displayKey = ucfirst( $key );
319325 if ( $code == $this->wikiCode ) {
320 - return "[[MediaWiki:$displayKey|$key]]";
 326+ return "[[{$this->linksPrefix}MediaWiki:$displayKey|$key]]";
321327 } else {
322 - return "[[MediaWiki:$displayKey/$code|$key]]";
 328+ return "[[{$this->linksPrefix}MediaWiki:$displayKey/$code|$key]]";
323329 }
324330 } else {
325331 return $key;

Status & tagging log