r79935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79934‎ | r79935 | r79936 >
Date:13:08, 10 January 2011
Author:ialex
Status:deferred
Tags:
Comment:
Drop back compat code
Modified paths:
  • /trunk/extensions/SkinPerNamespace/SkinPerNamespace.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SkinPerNamespace/SkinPerNamespace.php
@@ -1,11 +1,10 @@
22 <?php
3 -
43 /**
54 * Extension based on SkinPerPage to allow a customized skin per namespace
65 *
7 - * Require MediaWiki 1.13.0 for the new version of BeforePageDisplay hook, will
8 - * produce a warning on older versions.
 6+ * Require MediaWiki 1.15.0 or greater.
97 *
 8+ * @file
109 * @author Alexandre Emsenhuber
1110 * @license GPLv2
1211 */
@@ -17,7 +16,7 @@
1817 'path' => __FILE__,
1918 'name' => 'SkinPerNamespace',
2019 'url' => 'http://www.mediawiki.org/wiki/Extension:SkinPerNamespace',
21 - 'version' => '2009-04-25',
 20+ 'version' => '2011-01-10',
2221 'description' => 'Allow a per-namespace skin',
2322 'author' => 'Alexandre Emsenhuber',
2423
@@ -51,13 +50,12 @@
5251 */
5352 function efSkinPerPageBeforePageDisplayHook( &$out, &$skin ){
5453 global $wgSkinPerNamespace, $wgSkinPerSpecialPage,
55 - $wgSkinPerNamespaceOverrideLoggedIn, $wgUser, $wgTitle;
 54+ $wgSkinPerNamespaceOverrideLoggedIn, $wgUser;
5655
5756 if( !$wgSkinPerNamespaceOverrideLoggedIn && $wgUser->isLoggedIn() )
5857 return true;
5958
60 - $title = is_callable( array( $out, 'getTitle' ) ) ? # 1.15 +
61 - $out->getTitle() : $wgTitle;
 59+ $title = $out->getTitle();
6260 $ns = $title->getNamespace();
6361 $skinName = null;
6462
@@ -74,8 +72,7 @@
7573
7674 if( $skinName !== null ) {
7775 $skin = Skin::newFromKey( $skinName );
78 - if( is_callable( array( $skin, 'setTitle' ) ) ) # 1.15 +
79 - $skin->setTitle( $out->getTitle() );
 76+ $skin->setTitle( $out->getTitle() );
8077 }
8178
8279 return true;

Status & tagging log