Set 'skin' template parameter rather than override parent method
authorOri Livneh <ori@wikimedia.org>
Wed, 17 Apr 2013 03:51:18 +0000 (20:51 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 17 Apr 2013 06:13:56 +0000 (06:13 +0000)
BaseTemplate's getSkin() method is perfectly adequate if you simply set a
skin value where it expects it. Doing so obviates the need to reimplement
getSkin() in UserloginTemplateVForm and UsercreateTemplateVForm.

Change-Id: Icd22de2218fc96cb67c11d0c1763b607743fe3b6

includes/specials/SpecialUserlogin.php
includes/templates/UserloginVForm.php

index e0ddc96..c3a954f 100644 (file)
@@ -1131,6 +1131,7 @@ class LoginForm extends SpecialPage {
                        : is_array( $wgPasswordResetRoutes ) && in_array( true, array_values( $wgPasswordResetRoutes ) );
 
                $template->set( 'header', '' );
+               $template->set( 'skin', $this->getSkin() );
                $template->set( 'name', $this->mUsername );
                $template->set( 'password', $this->mPassword );
                $template->set( 'retype', $this->mRetype );
index 132a7c1..2e90c09 100644 (file)
  */
 class UserloginTemplateVForm extends BaseTemplate {
 
-       /**
-        * Get the Skin object related to this object, so that BaseTemplate msg 31
-        * methods work.
-        *
-        * @return Skin object
-        */
-       public function getSkin() {
-               global $wgOut;
-               return $wgOut->getSkin();
-       }
-
        function execute() {
                global $wgCookieExpiration;
                $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) );