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

Revision: 90905
Author:   aaron
Date:     2011-06-27 20:36:59 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
* Fixed 'Fatal error: Class 'SpecialMyuploads' not found in 
C:\wamp\www\MW_trunk\includes\SpecialPageFactory.php on line 318'
* Made use of $this->getUser() with special pages rather than wgUser
* Broke long lines

Modified Paths:
--------------
    trunk/phase3/includes/AutoLoader.php
    trunk/phase3/includes/SpecialPage.php

Modified: trunk/phase3/includes/AutoLoader.php
===================================================================
--- trunk/phase3/includes/AutoLoader.php        2011-06-27 20:19:15 UTC (rev 
90904)
+++ trunk/phase3/includes/AutoLoader.php        2011-06-27 20:36:59 UTC (rev 
90905)
@@ -203,6 +203,7 @@
        'SpecialMycontributions' => 'includes/SpecialPage.php',
        'SpecialMypage' => 'includes/SpecialPage.php',
        'SpecialMytalk' => 'includes/SpecialPage.php',
+       'SpecialMyuploads' => 'includes/SpecialPage.php',
        'SpecialPage' => 'includes/SpecialPage.php',
        'SpecialPageFactory' => 'includes/SpecialPageFactory.php',
        'SpecialRedirectToSpecial' => 'includes/SpecialPage.php',

Modified: trunk/phase3/includes/SpecialPage.php
===================================================================
--- trunk/phase3/includes/SpecialPage.php       2011-06-27 20:19:15 UTC (rev 
90904)
+++ trunk/phase3/includes/SpecialPage.php       2011-06-27 20:36:59 UTC (rev 
90905)
@@ -321,7 +321,10 @@
         * @param $file String: file which is included by execute(). It is also 
constructed from $name by default
         * @param $includable Bool: whether the page can be included in normal 
pages
         */
-       public function __construct( $name = '', $restriction = '', $listed = 
true, $function = false, $file = 'default', $includable = false ) {
+       public function __construct(
+               $name = '', $restriction = '', $listed = true,
+               $function = false, $file = 'default', $includable = false
+       ) {
                $this->init( $name, $restriction, $listed, $function, $file, 
$includable );
        }
 
@@ -569,7 +572,8 @@
                        $msg = $summaryMessageKey;
                }
                if ( !wfMessage( $msg )->isBlank() and ! $this->including() ) {
-                       $this->getOutput()->wrapWikiMsg( "<div 
class='mw-specialpage-summary'>\n$1\n</div>", $msg );
+                       $this->getOutput()->wrapWikiMsg(
+                               "<div 
class='mw-specialpage-summary'>\n$1\n</div>", $msg );
                }
 
        }
@@ -691,7 +695,8 @@
         * @see wfMessage
         */
        public function msg( /* $args */ ) {
-               return call_user_func_array( 'wfMessage', func_get_args() 
)->title( $this->getFullTitle() );
+               return call_user_func_array( 'wfMessage',
+                       func_get_args() )->title( $this->getFullTitle() );
        }
 
        /**
@@ -751,10 +756,12 @@
                $form = new HTMLForm( $this->fields, $this->getContext() );
                $form->setSubmitCallback( array( $this, 'onSubmit' ) );
                $form->setWrapperLegend( wfMessage( strtolower( 
$this->getName() ) . '-legend' ) );
-               $form->addHeaderText( wfMessage( strtolower( $this->getName() ) 
. '-text' )->parseAsBlock() );
+               $form->addHeaderText(
+                       wfMessage( strtolower( $this->getName() ) . '-text' 
)->parseAsBlock() );
 
                // Retain query parameters (uselang etc)
-               $params = array_diff_key( 
$this->getRequest()->getQueryValues(), array( 'title' => null ) );
+               $params = array_diff_key(
+                       $this->getRequest()->getQueryValues(), array( 'title' 
=> null ) );
                $form->addHiddenField( 'redirectparams', wfArrayToCGI( $params 
) );
 
                $form->addPreText( $this->preText() );
@@ -868,7 +875,9 @@
  */
 class IncludableSpecialPage extends SpecialPage
 {
-       function __construct( $name, $restriction = '', $listed = true, 
$function = false, $file = 'default' ) {
+       function __construct(
+               $name, $restriction = '', $listed = true, $function = false, 
$file = 'default'
+       ) {
                parent::__construct( $name, $restriction, $listed, $function, 
$file, true );
        }
 
@@ -946,10 +955,12 @@
 }
 
 abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
-
        var $redirName, $redirSubpage;
 
-       function __construct( $name, $redirName, $redirSubpage = false, 
$allowedRedirectParams = array(), $addedRedirectParams = array() ) {
+       function __construct(
+               $name, $redirName, $redirSubpage = false,
+               $allowedRedirectParams = array(), $addedRedirectParams = array()
+       ) {
                parent::__construct( $name );
                $this->redirName = $redirName;
                $this->redirSubpage = $redirSubpage;
@@ -1013,11 +1024,10 @@
        }
 
        function getRedirect( $subpage ) {
-               global $wgUser;
                if ( strval( $subpage ) !== '' ) {
-                       return Title::makeTitle( NS_USER, $wgUser->getName() . 
'/' . $subpage );
+                       return Title::makeTitle( NS_USER, 
$this->getUser()->getName() . '/' . $subpage );
                } else {
-                       return Title::makeTitle( NS_USER, $wgUser->getName() );
+                       return Title::makeTitle( NS_USER, 
$this->getUser()->getName() );
                }
        }
 }
@@ -1034,11 +1044,10 @@
        }
 
        function getRedirect( $subpage ) {
-               global $wgUser;
                if ( strval( $subpage ) !== '' ) {
-                       return Title::makeTitle( NS_USER_TALK, 
$wgUser->getName() . '/' . $subpage );
+                       return Title::makeTitle( NS_USER_TALK, 
$this->getUser()->getName() . '/' . $subpage );
                } else {
-                       return Title::makeTitle( NS_USER_TALK, 
$wgUser->getName() );
+                       return Title::makeTitle( NS_USER_TALK, 
$this->getUser()->getName() );
                }
        }
 }
@@ -1055,8 +1064,7 @@
        }
 
        function getRedirect( $subpage ) {
-               global $wgUser;
-               return SpecialPage::getTitleFor( 'Contributions', 
$wgUser->getName() );
+               return SpecialPage::getTitleFor( 'Contributions', 
$this->getUser()->getName() );
        }
 }
 
@@ -1070,8 +1078,7 @@
        }
 
        function getRedirect( $subpage ) {
-               global $wgUser;
-               return SpecialPage::getTitleFor( 'Listfiles', 
$wgUser->getName() );
+               return SpecialPage::getTitleFor( 'Listfiles', 
$this->getUser()->getName() );
        }
 }
 


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

Reply via email to