From 8408295b72286f8837e2b462786cc14a3e9a3b00 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Tue, 16 Apr 2013 20:51:18 -0700 Subject: [PATCH] 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 --- includes/specials/SpecialUserlogin.php | 1 + includes/templates/UserloginVForm.php | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) 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 ) ); -- 2.20.1