Index: trunk/extensions/SkinPerNamespace/SkinPerNamespace.php |
— | — | @@ -1,11 +1,10 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Extension based on SkinPerPage to allow a customized skin per namespace |
6 | 5 | * |
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. |
9 | 7 | * |
| 8 | + * @file |
10 | 9 | * @author Alexandre Emsenhuber |
11 | 10 | * @license GPLv2 |
12 | 11 | */ |
— | — | @@ -17,7 +16,7 @@ |
18 | 17 | 'path' => __FILE__, |
19 | 18 | 'name' => 'SkinPerNamespace', |
20 | 19 | 'url' => 'http://www.mediawiki.org/wiki/Extension:SkinPerNamespace', |
21 | | - 'version' => '2009-04-25', |
| 20 | + 'version' => '2011-01-10', |
22 | 21 | 'description' => 'Allow a per-namespace skin', |
23 | 22 | 'author' => 'Alexandre Emsenhuber', |
24 | 23 | |
— | — | @@ -51,13 +50,12 @@ |
52 | 51 | */ |
53 | 52 | function efSkinPerPageBeforePageDisplayHook( &$out, &$skin ){ |
54 | 53 | global $wgSkinPerNamespace, $wgSkinPerSpecialPage, |
55 | | - $wgSkinPerNamespaceOverrideLoggedIn, $wgUser, $wgTitle; |
| 54 | + $wgSkinPerNamespaceOverrideLoggedIn, $wgUser; |
56 | 55 | |
57 | 56 | if( !$wgSkinPerNamespaceOverrideLoggedIn && $wgUser->isLoggedIn() ) |
58 | 57 | return true; |
59 | 58 | |
60 | | - $title = is_callable( array( $out, 'getTitle' ) ) ? # 1.15 + |
61 | | - $out->getTitle() : $wgTitle; |
| 59 | + $title = $out->getTitle(); |
62 | 60 | $ns = $title->getNamespace(); |
63 | 61 | $skinName = null; |
64 | 62 | |
— | — | @@ -74,8 +72,7 @@ |
75 | 73 | |
76 | 74 | if( $skinName !== null ) { |
77 | 75 | $skin = Skin::newFromKey( $skinName ); |
78 | | - if( is_callable( array( $skin, 'setTitle' ) ) ) # 1.15 + |
79 | | - $skin->setTitle( $out->getTitle() ); |
| 76 | + $skin->setTitle( $out->getTitle() ); |
80 | 77 | } |
81 | 78 | |
82 | 79 | return true; |