r104260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104259‎ | r104260 | r104261 >
Date:00:06, 26 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Wrap some long lines

Spaces to tabs

Remove other trailing whitespace
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -258,7 +258,8 @@
259259 }
260260 $fragmentDelimiter = ( !empty( $parsedUrl['fragment'] ) ) ? '#' : '';
261261 $queryDelimiter = ( !empty( $parsedUrl['query'] ) ) ? '?' : '';
262 - $targetUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path'] . $queryDelimiter . $parsedUrl['query'] . $fragmentDelimiter . $parsedUrl['fragment'];
 262+ $targetUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path']
 263+ . $queryDelimiter . $parsedUrl['query'] . $fragmentDelimiter . $parsedUrl['fragment'];
263264 $output->setSquidMaxage( 1200 );
264265 $output->redirect( $targetUrl, '301' );
265266 }
@@ -338,9 +339,9 @@
339340
340341 self::$dir = $wgContLang->getDir();
341342 self::$code = $wgContLang->getCode();
342 -
 343+
343344 $languageUrls = array();
344 -
 345+
345346 $languageUrls[] = array(
346347 'href' => self::$currentURL,
347348 'text' => self::$htmlTitle,
@@ -348,12 +349,12 @@
349350 'class' => 'interwiki-' . $wgLanguageCode,
350351 'lang' => $wgLanguageCode,
351352 );
352 -
353 - foreach( $wgOut->getLanguageLinks() as $l ) {
 353+
 354+ foreach( $wgOut->getLanguageLinks() as $l ) {
354355 $tmp = explode( ':', $l, 2 );
355356 $class = 'interwiki-' . $tmp[0];
356357 $lang = $tmp[0];
357 - unset( $tmp );
 358+ unset( $tmp );
358359 $nt = Title::newFromText( $l );
359360 if ( $nt ) {
360361 $parsedUrl = wfParseUrl( $nt->getFullURL() );
@@ -363,11 +364,15 @@
364365 }
365366 $fragmentDelimiter = ( isset( $parsedUrl['fragment'] ) && $parsedUrl['fragment'] !== null ) ? '#' : '';
366367 $queryDelimiter = ( isset( $parsedUrl['query'] ) && $parsedUrl['query'] !== null ) ? '?' : '';
367 - $languageUrl = $parsedUrl['scheme'] . $parsedUrl['delimiter'] . $parsedUrl['host'] . $parsedUrl['path'] . $queryDelimiter . $parsedUrl['query'] . $fragmentDelimiter . $parsedUrl['fragment'];
 368+ $languageUrl = $parsedUrl['scheme'] . $parsedUrl['delimiter'] . $parsedUrl['host']
 369+ . $parsedUrl['path'] . $queryDelimiter . $parsedUrl['query']
 370+ . $fragmentDelimiter . $parsedUrl['fragment'];
368371
369372 $languageUrls[] = array(
370373 'href' => $languageUrl,
371 - 'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ? $wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ),
 374+ 'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != ''
 375+ ? $wgContLang->getLanguageName( $nt->getInterwiki() )
 376+ : $l ),
372377 'language' => $wgContLang->getLanguageName( $lang ),
373378 'class' => $class,
374379 'lang' => $lang,
@@ -378,7 +383,9 @@
379384 self::$languageUrls = $languageUrls;
380385
381386 $nonMobileServerBaseURL = str_replace( $wgMobileDomain, '.', $wgServer );
382 - self::$mobileRedirectFormAction = ( $wgMobileRedirectFormAction !== false ) ? $wgMobileRedirectFormAction : "{$nonMobileServerBaseURL}/w/mobileRedirect.php";
 387+ self::$mobileRedirectFormAction = ( $wgMobileRedirectFormAction !== false )
 388+ ? $wgMobileRedirectFormAction
 389+ : "{$nonMobileServerBaseURL}/w/mobileRedirect.php";
383390
384391 self::$mainPageUrl = Title::newMainPage()->getLocalUrl();
385392 self::$randomPageUrl = $this->getRelativeURL( SpecialPage::getTitleFor( 'Randompage' )->getLocalUrl() );
@@ -1065,7 +1072,7 @@
10661073 wfProfileOut( __METHOD__ );
10671074 return $contentHtml;
10681075 }
1069 -
 1076+
10701077 /**
10711078 * @param $token string
10721079 * @param $action string
@@ -1076,19 +1083,19 @@
10771084 $password = self::$messages['mobile-frontend-password'];
10781085 $login = self::$messages['mobile-frontend-login'];
10791086 $loginHtml = Html::input( 'wpName', null, 'text', array(
1080 - 'class' => 'loginText',
1081 - 'id' => 'wpName1',
1082 - 'tabindex' => '1',
1083 - 'size' => '20',
1084 - 'required') );
 1087+ 'class' => 'loginText',
 1088+ 'id' => 'wpName1',
 1089+ 'tabindex' => '1',
 1090+ 'size' => '20',
 1091+ 'required') );
10851092 $passwordHtml = Html::input( 'wpPassword', null, 'password', array(
1086 - 'class' => 'loginPassword',
1087 - 'id' => 'wpPassword1',
1088 - 'tabindex' => '2',
1089 - 'size' => '20') );
 1093+ 'class' => 'loginPassword',
 1094+ 'id' => 'wpPassword1',
 1095+ 'tabindex' => '2',
 1096+ 'size' => '20') );
10901097 $buttonHtml = Html::input( 'wpLoginAttempt', $login, 'submit', array(
1091 - 'id' => 'wpLoginAttempt',
1092 - 'tabindex' => '3') );
 1098+ 'id' => 'wpLoginAttempt',
 1099+ 'tabindex' => '3') );
10931100 $form = <<<EOT
10941101 <form name="userlogin" method="post" action="{$action}">
10951102 <table class="user-login">
@@ -1118,7 +1125,7 @@
11191126 EOT;
11201127 return $this->getDomDocumentNodeByTagName( $form, 'form' );
11211128 }
1122 -
 1129+
11231130 /**
11241131 * @param $html string
11251132 * @param $tagName string
@@ -1126,7 +1133,7 @@
11271134 */
11281135 private function getDomDocumentNodeByTagName( $html, $tagName ) {
11291136 libxml_use_internal_errors( true );
1130 - $dom = new DOMDocument();
 1137+ $dom = new DOMDocument();
11311138 $dom->loadHTML( $html );
11321139 libxml_use_internal_errors( false );
11331140 $dom->preserveWhiteSpace = false;
@@ -1153,9 +1160,9 @@
11541161 $this->doc->encoding = 'UTF-8';
11551162
11561163 $itemToRemoveRecords = $this->parseItemsToRemove();
1157 -
 1164+
11581165 $ptLogout = $this->doc->getElementById( 'pt-logout' );
1159 -
 1166+
11601167 if ( $ptLogout ) {
11611168 $ptLogoutLink = $ptLogout->firstChild;
11621169 $logoutHtml = $this->doc->saveXML( $ptLogoutLink, LIBXML_NOEMPTYTAG );
@@ -1268,7 +1275,7 @@
12691276
12701277 $redLink->parentNode->replaceChild( $spanNode, $redLink );
12711278 }
1272 -
 1279+
12731280 if ( self::$title == 'Special:UserLogin' ) {
12741281 if ( isset( $wpLoginToken ) && isset( $action ) && isset( $userlogin ) ) {
12751282 $login = $this->renderLogin( $wpLoginToken, $action );
@@ -1276,7 +1283,7 @@
12771284 $userlogin->appendChild( $loginNode );
12781285 }
12791286 }
1280 -
 1287+
12811288 $content = $this->doc->getElementById( 'content' );
12821289
12831290 $contentHtml = $this->doc->saveXML( $content, LIBXML_NOEMPTYTAG );
@@ -1359,17 +1366,17 @@
13601367 wfProfileOut( __METHOD__ );
13611368 return $applicationHtml;
13621369 }
1363 -
 1370+
13641371 public static function buildLanguageSelection() {
13651372 global $wgLanguageCode;
1366 - $output = Html::openElement( 'select',
1367 - array( 'id' => 'languageselection',
 1373+ $output = Html::openElement( 'select',
 1374+ array( 'id' => 'languageselection',
13681375 'onchange' => 'javascript:navigateToLanguageSelection();' ) );
13691376 foreach (self::$languageUrls as $languageUrl) {
13701377 if ( $languageUrl['lang'] == $wgLanguageCode ) {
13711378 $output .= Html::element( 'option',
13721379 array( 'value' => $languageUrl['href'], 'selected' => 'selected' ),
1373 - $languageUrl['language'] );
 1380+ $languageUrl['language'] );
13741381 } else {
13751382 $output .= Html::element( 'option',
13761383 array( 'value' => $languageUrl['href'] ),

Status & tagging log