r108102 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108101‎ | r108102 | r108103 >
Date:23:58, 4 January 2012
Author:yaron
Status:ok (Comments)
Tags:
Comment:
Removed backwards-compatibility for MediaWiki versions less than 1.16, removed unused local "$skin" field
Modified paths:
  • /trunk/extensions/AdminLinks/AdminLinks_body.php (modified) (history)
  • /trunk/extensions/AdminLinks/README (modified) (history)

Diff [purge]

Index: trunk/extensions/AdminLinks/AdminLinks_body.php
@@ -6,20 +6,12 @@
77 */
88
99 class AdminLinks extends SpecialPage {
10 - var $skin;
1110
1211 /**
1312 * Constructor
1413 */
1514 function __construct() {
1615 parent::__construct( 'AdminLinks' );
17 - // deprecated in MW 1.16
18 - global $wgVersion;
19 - if ( version_compare( $wgVersion, '1.16', '<' ) ) {
20 - wfLoadExtensionMessages( 'AdminLinks' );
21 - }
22 - global $wgUser;
23 - $this->skin = $wgUser->getSkin();
2416 }
2517
2618 function createInitialTree() {
@@ -97,12 +89,6 @@
9890 global $wgUser;
9991 // if user is a sysop, add link
10092 if ( $wgUser->isAllowed( 'adminlinks' ) ) {
101 - // deprecated in MW 1.16
102 - global $wgVersion;
103 - if ( version_compare( $wgVersion, '1.16', '<' ) ) {
104 - wfLoadExtensionMessages( 'AdminLinks' );
105 - }
106 -
10793 $al = SpecialPage::getTitleFor( 'AdminLinks' );
10894 $href = $al->getLocalURL();
10995 $admin_links_vals = array(
@@ -271,12 +257,7 @@
272258 $item->label = $desc;
273259 if ( $params != null ) {
274260 global $wgUser;
275 - // linkKnown() method was added in MW 1.16
276 - if ( method_exists( $wgUser->getSkin(), 'linkKnown' ) ) {
277 - $item->text = $wgUser->getSkin()->linkKnown( $page_name, $desc, array(), $params );
278 - } else {
279 - $item->text = $wgUser->getSkin()->makeKnownLinkObj( $page_name, $desc, wfArrayToCGI( $params ) );
280 - }
 261+ $item->text = $wgUser->getSkin()->linkKnown( $page_name, $desc, array(), $params );
281262 } else
282263 $item->text = "[[$page_name|$desc]]";
283264 return $item;
@@ -287,12 +268,7 @@
288269 $item->label = $page_name;
289270 $page = SpecialPage::getPage( $page_name );
290271 global $wgUser;
291 - // linkKnown() method was added in MW 1.16
292 - if ( method_exists( $wgUser->getSkin(), 'linkKnown' ) ) {
293 - $item->text = $wgUser->getSkin()->linkKnown( $page->getTitle(), $page->getDescription() );
294 - } else {
295 - $item->text = $wgUser->getSkin()->makeKnownLinkObj( $page->getTitle(), $page->getDescription() );
296 - }
 272+ $item->text = $wgUser->getSkin()->linkKnown( $page->getTitle(), $page->getDescription() );
297273 return $item;
298274 }
299275
Index: trunk/extensions/AdminLinks/README
@@ -25,7 +25,7 @@
2626
2727 == Requirements ==
2828
29 -This version of the Admin Links extension requires MediaWiki 1.8 or higher.
 29+This version of the Admin Links extension requires MediaWiki 1.16 or higher.
3030
3131 == Installation ==
3232

Comments

#Comment by Jeroen De Dauw (talk | contribs)   02:07, 5 January 2012

"1.8 or higher" o_O

#Comment by Yaron Koren (talk | contribs)   03:08, 5 January 2012

I know - it's hard to imagine that I ever used MediaWiki 1.8, but apparently I did. :)

Status & tagging log