r99259 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99258‎ | r99259 | r99260 >
Date:21:15, 7 October 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added link to Special:Log; changed section headers from <h4> to <h2>, to match new-ish MediaWiki convention
Modified paths:
  • /trunk/extensions/AdminLinks/AdminLinks_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AdminLinks/AdminLinks_body.php
@@ -31,6 +31,7 @@
3232 $main_row->addItem( ALItem::newFromSpecialPage( 'Statistics' ) );
3333 $main_row->addItem( ALItem::newFromSpecialPage( 'Version' ) );
3434 $main_row->addItem( ALItem::newFromSpecialPage( 'Specialpages' ) );
 35+ $main_row->addItem( ALItem::newFromSpecialPage( 'Log' ) );
3536 $main_row->addItem( ALItem::newFromSpecialPage( 'Allmessages' ) );
3637 $main_row->addItem( ALItem::newFromEditLink( 'Sidebar', wfMsg( 'adminlinks_editsidebar' ) ) );
3738 $main_row->addItem( ALItem::newFromEditLink( 'Common.css', wfMsg( 'adminlinks_editcss' ) ) );
@@ -86,10 +87,10 @@
8788 * For administrators, add a link to the special 'AdminLinks' page
8889 * among the user's "personal URLs" at the top, if they have
8990 * the 'adminlinks' permission.
90 - *
 91+ *
9192 * @param array $personal_urls
9293 * @param Title $title
93 - *
 94+ *
9495 * @return true
9596 */
9697 public static function addURLToUserLinks( array &$personal_urls, Title &$title ) {
@@ -101,7 +102,7 @@
102103 if ( version_compare( $wgVersion, '1.16', '<' ) ) {
103104 wfLoadExtensionMessages( 'AdminLinks' );
104105 }
105 -
 106+
106107 $al = SpecialPage::getTitleFor( 'AdminLinks' );
107108 $href = $al->getLocalURL();
108109 $admin_links_vals = array(
@@ -109,7 +110,7 @@
110111 'href' => $href,
111112 'active' => ( $href == $title->getLocalURL() )
112113 );
113 -
 114+
114115 // find the location of the 'my preferences' link, and
115116 // add the link to 'AdminLinks' right before it.
116117 // this is a "key-safe" splice - it preserves both the
@@ -121,9 +122,8 @@
122123 $prefs_location = array_search( 'preferences', $tab_keys );
123124 array_splice( $tab_keys, $prefs_location, 0, 'adminlinks' );
124125 array_splice( $tab_values, $prefs_location, 0, array( $admin_links_vals ) );
125 -
 126+
126127 $personal_urls = array();
127 -
128128 for ( $i = 0; $i < count( $tab_keys ); $i++ ) {
129129 $personal_urls[$tab_keys[$i]] = $tab_values[$i];
130130 }
@@ -211,7 +211,7 @@
212212 }
213213
214214 function toString() {
215 - $text = ' <h4 class="mw-specialpagesgroup">' . $this->header . "</h4>\n";
 215+ $text = ' <h2 class="mw-specialpagesgroup">' . $this->header . "</h2>\n";
216216 foreach ( $this->rows as $row ) {
217217 $text .= $row->toString();
218218 }
@@ -311,5 +311,5 @@
312312 $item->text = "<a class=\"external text\" rel=\"nofollow\" href=\"$url\">$label</a>";
313313 return $item;
314314 }
315 -
 315+
316316 }

Status & tagging log