r92790 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92789‎ | r92790 | r92791 >
Date:20:43, 21 July 2011
Author:robin
Status:ok
Tags:
Comment:
Some documentation/syntax/whitespace fixes per Nikerabbit on r92559
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)
  • /trunk/extensions/WikimediaIncubator/InfoPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -370,10 +370,8 @@
371371 */
372372 static function canWeCheckDB() {
373373 global $wmincExistingWikis, $wmincProjectDatabases;
374 - if( !is_array( $wmincProjectDatabases ) ) {
375 - return false; # We don't know the database names of the projects
376 - } elseif( !isset( $wmincExistingWikis ) || !is_array( $wmincExistingWikis ) ) {
377 - return false; # No list of databases
 374+ if( !is_array( $wmincProjectDatabases ) || !is_array( $wmincExistingWikis ) ) {
 375+ return false; # We don't know the databases
378376 }
379377 return true; # Should work now
380378 }
@@ -514,7 +512,12 @@
515513 }
516514
517515 /**
518 - * TODO: add support for secure server?
 516+ * This forms a URL based on the language and project, and optionally title.
 517+ * TODO: add support for secure server, or are links automatically converted?
 518+ * @param $lang Language code
 519+ * @param $project Project code (or project name)
 520+ * @param $title Optional title on the target wiki
 521+ * @param $protocol Whether to include the protocol
519522 * @return String
520523 */
521524 public static function getSubdomain( $lang, $project, $title = '', $protocol = true ) {
@@ -551,10 +554,10 @@
552555 if( $dbstate == 'existing' ) {
553556 $url = self::getSubdomain( $prefix['lang'], $prefix['project'] );
554557 } else {
555 - $params = 'redirectfrom=infopage';
 558+ $params['redirectfrom'] = 'infopage';
556559 $uselang = $wgRequest->getVal( 'uselang' );
557560 if( $uselang ) {
558 - $params .= '&uselang=' . $uselang;
 561+ $params['uselang'] = $uselang;
559562 }
560563 $mainpage = Title::newFromText(
561564 self::getMainPage( $prefix['lang'], $prefix['prefix'] )
@@ -605,11 +608,11 @@
606609 return false;
607610 }
608611 global $wgLogo;
609 - # return if MediaWiki: Incubator-logo-wx/xx(x) does not exists
610612 $prefixForPageTitle = preg_replace('/\//', '-', strtolower( $setLogo['prefix'] ) );
611613 $file = wfFindFile( wfMsgForContentNoTrans( 'Incubator-logo-' . $prefixForPageTitle ) );
612614 if( !$file ) {
613 - # Try a general, default logo for that project
 615+ # if MediaWiki:Incubator-logo-wx-xx(x) doesn't exist,
 616+ # try a general, default logo for that project
614617 global $wmincProjects;
615618 $project = $setLogo['project'];
616619 $projectForFile = preg_replace('/ /', '-', strtolower( $wmincProjects[$project] ) );
@@ -621,9 +624,7 @@
622625 }
623626 return false;
624627 }
625 - if ( $file == null ) {
626 - return false;
627 - }
 628+ # Use MediaWiki:Incubator-logo-wx-xx(x)
628629 $thumb = $file->transform( array( 'width' => 135, 'height' => 135 ) );
629630 $wgLogo = $thumb->getUrl();
630631 return true;
Index: trunk/extensions/WikimediaIncubator/InfoPage.php
@@ -73,9 +73,9 @@
7474 $otherProjects = $wmincProjects + $wmincSisterProjects;
7575 foreach( $otherProjects as $code => $name ) {
7676 $listOtherProjects[$code] = '<li>' . $this->makeLogo( $name, true,
77 - 75, NULL, IncubatorTest::getSubdomain( $this->mLangCode, $name ) ) . '</li>';
 77+ 75, null, IncubatorTest::getSubdomain( $this->mLangCode, $name ) ) . '</li>';
7878 }
79 - unset($listOtherProjects[$this->mProjectCode]);
 79+ unset( $listOtherProjects[$this->mProjectCode] );
8080 return '<ul class="wminc-infopage-otherprojects">' .
8181 implode( '', $listOtherProjects ) . '</ul>';
8282 }
@@ -83,9 +83,9 @@
8484 public function listMultilingualProjects() {
8585 global $wmincMultilingualProjects;
8686 if( !is_array( $wmincMultilingualProjects ) ) { return; }
87 - foreach($wmincMultilingualProjects as $url => $name) {
 87+ foreach( $wmincMultilingualProjects as $url => $name ) {
8888 $list[$url] = '<li>' . $this->makeLogo( $name, true,
89 - 75, NULL, 'http://'.$url.'/') . '</li>';
 89+ 75, null, 'http://'.$url.'/') . '</li>';
9090 }
9191 return '<ul class="wminc-infopage-multilingualprojects">' .
9292 implode( '', $list ) . '</ul>';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92559Major update of stable features from development code....robin19:51, 19 July 2011

Status & tagging log