From: Ori Livneh Date: Wed, 17 Apr 2013 03:51:18 +0000 (-0700) Subject: Set 'skin' template parameter rather than override parent method X-Git-Tag: 1.31.0-rc.0~19981^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=8408295b72286f8837e2b462786cc14a3e9a3b00;p=lhc%2Fweb%2Fwiklou.git Set 'skin' template parameter rather than override parent method 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 --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index e0ddc962ce..c3a954f7b0 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -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 ); diff --git a/includes/templates/UserloginVForm.php b/includes/templates/UserloginVForm.php index 132a7c1cb1..2e90c09f18 100644 --- a/includes/templates/UserloginVForm.php +++ b/includes/templates/UserloginVForm.php @@ -25,17 +25,6 @@ */ 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 ) );