Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -370,10 +370,8 @@ |
371 | 371 | */ |
372 | 372 | static function canWeCheckDB() { |
373 | 373 | 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 |
378 | 376 | } |
379 | 377 | return true; # Should work now |
380 | 378 | } |
— | — | @@ -514,7 +512,12 @@ |
515 | 513 | } |
516 | 514 | |
517 | 515 | /** |
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 |
519 | 522 | * @return String |
520 | 523 | */ |
521 | 524 | public static function getSubdomain( $lang, $project, $title = '', $protocol = true ) { |
— | — | @@ -551,10 +554,10 @@ |
552 | 555 | if( $dbstate == 'existing' ) { |
553 | 556 | $url = self::getSubdomain( $prefix['lang'], $prefix['project'] ); |
554 | 557 | } else { |
555 | | - $params = 'redirectfrom=infopage'; |
| 558 | + $params['redirectfrom'] = 'infopage'; |
556 | 559 | $uselang = $wgRequest->getVal( 'uselang' ); |
557 | 560 | if( $uselang ) { |
558 | | - $params .= '&uselang=' . $uselang; |
| 561 | + $params['uselang'] = $uselang; |
559 | 562 | } |
560 | 563 | $mainpage = Title::newFromText( |
561 | 564 | self::getMainPage( $prefix['lang'], $prefix['prefix'] ) |
— | — | @@ -605,11 +608,11 @@ |
606 | 609 | return false; |
607 | 610 | } |
608 | 611 | global $wgLogo; |
609 | | - # return if MediaWiki: Incubator-logo-wx/xx(x) does not exists |
610 | 612 | $prefixForPageTitle = preg_replace('/\//', '-', strtolower( $setLogo['prefix'] ) ); |
611 | 613 | $file = wfFindFile( wfMsgForContentNoTrans( 'Incubator-logo-' . $prefixForPageTitle ) ); |
612 | 614 | 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 |
614 | 617 | global $wmincProjects; |
615 | 618 | $project = $setLogo['project']; |
616 | 619 | $projectForFile = preg_replace('/ /', '-', strtolower( $wmincProjects[$project] ) ); |
— | — | @@ -621,9 +624,7 @@ |
622 | 625 | } |
623 | 626 | return false; |
624 | 627 | } |
625 | | - if ( $file == null ) { |
626 | | - return false; |
627 | | - } |
| 628 | + # Use MediaWiki:Incubator-logo-wx-xx(x) |
628 | 629 | $thumb = $file->transform( array( 'width' => 135, 'height' => 135 ) ); |
629 | 630 | $wgLogo = $thumb->getUrl(); |
630 | 631 | return true; |
Index: trunk/extensions/WikimediaIncubator/InfoPage.php |
— | — | @@ -73,9 +73,9 @@ |
74 | 74 | $otherProjects = $wmincProjects + $wmincSisterProjects; |
75 | 75 | foreach( $otherProjects as $code => $name ) { |
76 | 76 | $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>'; |
78 | 78 | } |
79 | | - unset($listOtherProjects[$this->mProjectCode]); |
| 79 | + unset( $listOtherProjects[$this->mProjectCode] ); |
80 | 80 | return '<ul class="wminc-infopage-otherprojects">' . |
81 | 81 | implode( '', $listOtherProjects ) . '</ul>'; |
82 | 82 | } |
— | — | @@ -83,9 +83,9 @@ |
84 | 84 | public function listMultilingualProjects() { |
85 | 85 | global $wmincMultilingualProjects; |
86 | 86 | if( !is_array( $wmincMultilingualProjects ) ) { return; } |
87 | | - foreach($wmincMultilingualProjects as $url => $name) { |
| 87 | + foreach( $wmincMultilingualProjects as $url => $name ) { |
88 | 88 | $list[$url] = '<li>' . $this->makeLogo( $name, true, |
89 | | - 75, NULL, 'http://'.$url.'/') . '</li>'; |
| 89 | + 75, null, 'http://'.$url.'/') . '</li>'; |
90 | 90 | } |
91 | 91 | return '<ul class="wminc-infopage-multilingualprojects">' . |
92 | 92 | implode( '', $list ) . '</ul>'; |