http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65344

Revision: 65344
Author:   siebrand
Date:     2010-04-20 21:27:41 +0000 (Tue, 20 Apr 2010)

Log Message:
-----------
stylize.php, trailing whitespace removed

Modified Paths:
--------------
    trunk/extensions/CategoryStepper/CategoryStepper.css
    trunk/extensions/CategoryStepper/CategoryStepper.i18n.php
    trunk/extensions/CategoryStepper/CategoryStepper.php

Modified: trunk/extensions/CategoryStepper/CategoryStepper.css
===================================================================
--- trunk/extensions/CategoryStepper/CategoryStepper.css        2010-04-20 
21:24:33 UTC (rev 65343)
+++ trunk/extensions/CategoryStepper/CategoryStepper.css        2010-04-20 
21:27:41 UTC (rev 65344)
@@ -1,6 +1,6 @@
 /**
  * Style file for the CategoryStepper extension.
- * 
+ *
  * @addtogroup Extensions
  */
 

Modified: trunk/extensions/CategoryStepper/CategoryStepper.i18n.php
===================================================================
--- trunk/extensions/CategoryStepper/CategoryStepper.i18n.php   2010-04-20 
21:24:33 UTC (rev 65343)
+++ trunk/extensions/CategoryStepper/CategoryStepper.i18n.php   2010-04-20 
21:27:41 UTC (rev 65344)
@@ -1,8 +1,7 @@
 <?php
-
 /**
  * Internationalisation file for CategoryStepper extension.
- * 
+ *
  * @addtogroup Extensions
  */
 

Modified: trunk/extensions/CategoryStepper/CategoryStepper.php
===================================================================
--- trunk/extensions/CategoryStepper/CategoryStepper.php        2010-04-20 
21:24:33 UTC (rev 65343)
+++ trunk/extensions/CategoryStepper/CategoryStepper.php        2010-04-20 
21:27:41 UTC (rev 65344)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Displays a category stepper box allowing one to navigate forward and
  * backwards alphabetically through one or more categories a page is in,
@@ -16,7 +15,7 @@
  */
 
 // If this is run directly from the web die as this is not a valid entry point.
-if( !defined( 'MEDIAWIKI' ) ) die( 'Invalid entry point.' );
+if ( !defined( 'MEDIAWIKI' ) ) die( 'Invalid entry point.' );
 
 // Extension credits.
 $wgExtensionCredits[ 'other' ][] = array(
@@ -55,13 +54,12 @@
  * @return true
  */
 function efCategoryStepper( $out, $text ) {
-
        // Get various variables needed for this extension.
        global $wgCategoryStepper, $wgTitle, $wgArticlePath, $wgRequest, $IP,
                $wgUser, $wgOut;
 
        // Only render on the actual view page; not edit, delete etc.
-       if( $wgRequest->getBool( 'action' ) ) return true;
+       if ( $wgRequest->getBool( 'action' ) ) return true;
 
        // Load messages into the message cache.
        wfLoadExtensionMessages( 'CategoryStepper' );
@@ -71,33 +69,31 @@
 
        // If $wgCategoryStepper is not an array then fallback to the MediaWiki
        // namespace page.
-       if( !is_array( $wgCategoryStepper ) ) {
+       if ( !is_array( $wgCategoryStepper ) ) {
                $things = wfMsg( 'categorystepper' );
                $things = explode( "\n", str_replace( "\r", "\n", str_replace( 
"\r\n", "\n", $things ) ) ); // Ensure line-endings are \n
-               foreach( $things as $row ) {
+               foreach ( $things as $row ) {
                        $row = ltrim( $row, '* ' ); // Remove the asterix (and 
a space if found) from the start of the line.
                        $row = explode( '|', $row );
-                       if( !isset( $row[ 1 ] ) ) $row[ 1 ] = $row[ 0 ];
+                       if ( !isset( $row[ 1 ] ) ) $row[ 1 ] = $row[ 0 ];
                        $wgCategoryStepper[ $row[ 0 ] ] = $row[ 1 ];
                }
        }
 
        // Loop through all the categories.
-       foreach( $wgCategoryStepper as $name => $title ) {
-
+       foreach ( $wgCategoryStepper as $name => $title ) {
                // Check if the current page is in this category and if so 
render the box.
-               if( $dbr->fetchRow( $dbr->select( "categorylinks", "*", array( 
"cl_from" => $wgTitle->getArticleID(), "cl_to" => $name ) ) ) ) {
-
+               if ( $dbr->fetchRow( $dbr->select( "categorylinks", "*", array( 
"cl_from" => $wgTitle->getArticleID(), "cl_to" => $name ) ) ) ) {
                        $prev = false;
                        $nextI = false;
 
                        // Get an array of pages in this category.
                        $res = $dbr->select( "categorylinks", "cl_from", array( 
"cl_to" => $name ), 'Database::select', array( 'ORDER BY' => "cl_sortkey" ) );
-                       while( $row = $dbr->fetchRow( $res ) ) {
-                               if( isset( $donext ) ) {
+                       while ( $row = $dbr->fetchRow( $res ) ) {
+                               if ( isset( $donext ) ) {
                                        $nextI = $row[ 'cl_from' ];
                                        break;
-                               } elseif( $row[ 'cl_from' ] == 
$wgTitle->getArticleID() ) {
+                               } elseif ( $row[ 'cl_from' ] == 
$wgTitle->getArticleID() ) {
                                        $prevI = $prev;
                                        $donext = true;
                                }
@@ -105,7 +101,7 @@
                        }
 
                        // Get the title of the element before this.
-                       if( $prevI ) {
+                       if ( $prevI ) {
                                $prevtitle = Title::newFromId( $prevI );
                                $previous = 
$wgUser->getSkin()->makeKnownLinkObj( $prevtitle );
                        } else {
@@ -113,7 +109,7 @@
                        }
 
                        // Get the title of the element after this.
-                       if( $nextI ) {
+                       if ( $nextI ) {
                                $nexttitle = Title::newFromId( $nextI );
                                $next = $wgUser->getSkin()->makeKnownLinkObj( 
$nexttitle );
                        } else {
@@ -141,9 +137,8 @@
        }
 
        // Add style file to the output headers if it exists.
-       if( file_exists( "$IP/skins/CategoryStepper.css" ) ) $wgOut->addStyle( 
'CategoryStepper.css' );
+       if ( file_exists( "$IP/skins/CategoryStepper.css" ) ) $wgOut->addStyle( 
'CategoryStepper.css' );
 
        // Return true so things don't break.
        return true;
-
 }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to