r11922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11921‎ | r11922 | r11923 >
Date:16:02, 3 December 2005
Author:hashar
Status:old
Tags:
Comment:
code feel'n look
Modified paths:
  • /trunk/extensions/SiteMatrix.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SiteMatrix.php
@@ -5,7 +5,7 @@
66 # Not a valid entry point, skip unless MEDIAWIKI is defined
77 if (defined('MEDIAWIKI')) {
88
9 -$wgExtensionFunctions[] = "wfSiteMatrix";
 9+$wgExtensionFunctions[] = 'wfSiteMatrix';
1010 $wgExtensionCredits['specialpage'][] = array(
1111 'name' => 'SiteMatrix',
1212 'description' => 'display a list of wikimedia wikis'
@@ -13,12 +13,12 @@
1414
1515 function wfSiteMatrix() {
1616 global $IP;
17 -require_once( "$IP/includes/SpecialPage.php" );
 17+require_once( $IP.'/includes/SpecialPage.php' );
1818
19 -class SiteMatrixPage extends SpecialPage
20 -{
 19+class SiteMatrixPage extends SpecialPage {
 20+
2121 function SiteMatrixPage() {
22 - SpecialPage::SpecialPage("SiteMatrix");
 22+ SpecialPage::SpecialPage('SiteMatrix');
2323 }
2424
2525 function execute( $par ) {
@@ -68,9 +68,9 @@
6969 # Construct the HTML
7070
7171 # Header row
72 - $s = "<table><tr>";
 72+ $s = '<table><tr>';
7373 foreach ( $names as $name ) {
74 - $s .= "<td><strong>$name</strong></td>";
 74+ $s .= '<td><strong>' . $name . '</strong></td>';
7575 }
7676 $s .= "</tr>\n";
7777
@@ -79,13 +79,13 @@
8080 $s .= "<tr>";
8181 $langhost = str_replace( '_', '-', $lang );
8282 foreach ( $names as $site => $name ) {
83 - $url = "http://$langhost." . $hosts[$site] . "/";
 83+ $url = "http://$langhost." . $hosts[$site] . '/';
8484 if ( empty( $matrix[$site][$lang] ) ) {
8585 # Non-existent wiki
86 - $s .= "<td><a href=\"$url\" class=\"new\">$lang</a></td>";
 86+ $s .= '<td><a href="' . $url . '" class="new">' . $lang . '</a></td>';
8787 } else {
8888 # Wiki exists
89 - $s .= "<td><a href=\"$url\">$lang</a></td>";
 89+ $s .= '<td><a href="' . $url . '">' . $lang . '</a></td>';
9090 }
9191 }
9292 $s .= "</tr>\n";
@@ -93,19 +93,19 @@
9494 $s .= "</table>\n";
9595
9696 # Specials
97 - $s .= "<ul>";
 97+ $s .= '<ul>';
9898 foreach ( $specials as $lang ) {
9999 $langhost = str_replace( '_', '-', $lang );
100 - $s .= "<li><a href=\"http://$langhost.wikipedia.org/\">$lang</a></li>\n";
 100+ $s .= '<li><a href="http://' . $langhost . '.wikipedia.org/">' . $lang . "</a></li>\n";
101101 }
102 - $s .= "</ul>";
 102+ $s .= '</ul>';
103103 $wgOut->addHTML( $s );
104104 }
105105 }
106106
107107 SpecialPage::addPage( new SiteMatrixPage );
108108 global $wgMessageCache;
109 -$wgMessageCache->addMessage( "sitematrix", "List of Wikimedia wikis" );
 109+$wgMessageCache->addMessage( 'sitematrix', 'List of Wikimedia wikis' );
110110
111111 } # End of extension function
112112 } # End of invocation protection

Status & tagging log