r82630 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82629‎ | r82630 | r82631 >
Date:20:49, 22 February 2011
Author:yaron
Status:deferred
Tags:
Comment:
Switched from Linker::makeKnownLinkObj() to Linker::linkKnown() when possible; added link to Special:ListFiles
Modified paths:
  • /trunk/extensions/AdminLinks/AdminLinks_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AdminLinks/AdminLinks_body.php
@@ -42,7 +42,8 @@
4343 $main_row->addItem( ALItem::newFromSpecialPage( 'Listusers' ) );
4444 $ul = SpecialPage::getTitleFor( 'Userlogin' );
4545 $al = SpecialPage::getTitleFor( 'AdminLinks' );
46 - $main_row->addItem( AlItem::newFromPage( $ul, wfMsg( 'adminlinks_createuser' ), "type=signup&returnto=$al" ) );
 46+ $main_row->addItem( AlItem::newFromPage( $ul, wfMsg( 'adminlinks_createuser' ),
 47+ array( 'type' => 'signup', 'returnto' => $al->getPrefixedText() ) ) );
4748 $main_row->addItem( ALItem::newFromSpecialPage( 'Userrights' ) );
4849 $users_section->addRow( $main_row );
4950 $tree->addSection( $users_section );
@@ -51,6 +52,7 @@
5253 $browse_search_section = new ALSection( wfMsg( 'adminlinks_browsesearch' ) );
5354 $main_row = new ALRow( 'main' );
5455 $main_row->addItem( ALItem::newFromSpecialPage( 'Allpages' ) );
 56+ $main_row->addItem( ALItem::newFromSpecialPage( 'Listfiles' ) );
5557 $main_row->addItem( ALItem::newFromSpecialPage( 'Search' ) );
5658 $browse_search_section->addRow( $main_row );
5759 $tree->addSection( $browse_search_section );
@@ -250,7 +252,12 @@
251253 $item->label = $desc;
252254 if ( $params != null ) {
253255 global $wgUser;
254 - $item->text = $wgUser->getSkin()->makeKnownLinkObj( $page_name, $desc, $params );
 256+ // linkKnown() method was added in MW 1.16
 257+ if ( method_exists( $wgUser->getSkin(), 'linkKnown' ) ) {
 258+ $item->text = $wgUser->getSkin()->linkKnown( $page_name, $desc, array(), $params );
 259+ } else {
 260+ $item->text = $wgUser->getSkin()->makeKnownLinkObj( $page_name, $desc, wfArrayToCGI( $params ) );
 261+ }
255262 } else
256263 $item->text = "[[$page_name|$desc]]";
257264 return $item;
@@ -261,7 +268,12 @@
262269 $item->label = $page_name;
263270 $page = SpecialPage::getPage( $page_name );
264271 global $wgUser;
265 - $item->text = $wgUser->getSkin()->makeKnownLinkObj( $page->getTitle(), $page->getDescription() );
 272+ // linkKnown() method was added in MW 1.16
 273+ if ( method_exists( $wgUser->getSkin(), 'linkKnown' ) ) {
 274+ $item->text = $wgUser->getSkin()->linkKnown( $page->getTitle(), $page->getDescription() );
 275+ } else {
 276+ $item->text = $wgUser->getSkin()->makeKnownLinkObj( $page->getTitle(), $page->getDescription() );
 277+ }
266278 return $item;
267279 }
268280

Status & tagging log