r91445 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91444‎ | r91445 | r91446 >
Date:10:45, 5 July 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed CategoryViewer::getSkin() and replaced by static calls to Linker; no use in extensions.
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -86,7 +86,7 @@
8787 $children, $children_start_char,
8888 $showGallery, $imgsNoGalley,
8989 $imgsNoGallery_start_char,
90 - $skin, $imgsNoGallery;
 90+ $imgsNoGallery;
9191
9292 /**
9393 * @var
@@ -201,24 +201,13 @@
202202 }
203203
204204 /**
205 - * @return Skin
206 - */
207 - function getSkin() {
208 - if ( !$this->skin ) {
209 - global $wgUser;
210 - $this->skin = $wgUser->getSkin();
211 - }
212 - return $this->skin;
213 - }
214 -
215 - /**
216205 * Add a subcategory to the internal lists, using a Category object
217206 */
218207 function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
219208 // Subcategory; strip the 'Category' namespace from the link text.
220209 $title = $cat->getTitle();
221210
222 - $link = $this->getSkin()->link( $title, $title->getText() );
 211+ $link = Linker::link( $title, htmlspecialchars( $title->getText() ) );
223212 if ( $title->isRedirect() ) {
224213 // This didn't used to add redirect-in-category, but might
225214 // as well be consistent with the rest of the sections
@@ -276,7 +265,7 @@
277266 $this->gallery->add( $title );
278267 }
279268 } else {
280 - $link = $this->getSkin()->link( $title );
 269+ $link = Linker::link( $title );
281270 if ( $isRedirect ) {
282271 // This seems kind of pointless given 'mw-redirect' class,
283272 // but keeping for back-compatibility with user css.
@@ -295,7 +284,7 @@
296285 function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
297286 global $wgContLang;
298287
299 - $link = $this->getSkin()->link( $title );
 288+ $link = Linker::link( $title );
300289 if ( $isRedirect ) {
301290 // This seems kind of pointless given 'mw-redirect' class,
302291 // but keeping for back-compatiability with user css.
@@ -615,7 +604,7 @@
616605 */
617606 private function pagingLinks( $first, $last, $type = '' ) {
618607 global $wgLang;
619 - $sk = $this->getSkin();
 608+
620609 $limitText = $wgLang->formatNum( $this->limit );
621610
622611 $prevLink = wfMsgExt( 'prevn', array( 'escape', 'parsemag' ), $limitText );
@@ -624,7 +613,7 @@
625614 $prevQuery = $this->query;
626615 $prevQuery["{$type}until"] = $first;
627616 unset( $prevQuery["{$type}from"] );
628 - $prevLink = $sk->linkKnown(
 617+ $prevLink = Linker::linkKnown(
629618 $this->addFragmentToTitle( $this->title, $type ),
630619 $prevLink,
631620 array(),
@@ -638,7 +627,7 @@
639628 $lastQuery = $this->query;
640629 $lastQuery["{$type}from"] = $last;
641630 unset( $lastQuery["{$type}until"] );
642 - $nextLink = $sk->linkKnown(
 631+ $nextLink = Linker::linkKnown(
643632 $this->addFragmentToTitle( $this->title, $type ),
644633 $nextLink,
645634 array(),

Status & tagging log