summaryrefslogtreecommitdiff
path: root/includes/CategoryPage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/CategoryPage.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/CategoryPage.php')
-rw-r--r--includes/CategoryPage.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php
index 4ac24b5f..03ecb5dc 100644
--- a/includes/CategoryPage.php
+++ b/includes/CategoryPage.php
@@ -20,7 +20,8 @@ class CategoryPage extends Article {
if ( isset( $diff ) && $diffOnly )
return Article::view();
- if(!wfRunHooks('CategoryPageView', array(&$this))) return;
+ if( !wfRunHooks( 'CategoryPageView', array( &$this ) ) )
+ return;
if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
$this->openShowCategory();
@@ -28,10 +29,6 @@ class CategoryPage extends Article {
Article::view();
- # If the article we've just shown is in the "Image" namespace,
- # follow it with the history list and link list for the image
- # it describes.
-
if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
$this->closeShowCategory();
}
@@ -79,7 +76,7 @@ class CategoryViewer {
$this->from = $from;
$this->until = $until;
$this->limit = $wgCategoryPagingLimit;
- $this->cat = Category::newFromName( $title->getDBKey() );
+ $this->cat = Category::newFromTitle( $title );
}
/**
@@ -192,9 +189,10 @@ class CategoryViewer {
*/
function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
+ $titletext = $wgContLang->convert( $title->getPrefixedText() );
$this->articles[] = $isRedirect
- ? '<span class="redirect-in-category">' . $this->getSkin()->makeKnownLinkObj( $title ) . '</span>'
- : $this->getSkin()->makeSizeLinkObj( $pageLength, $title );
+ ? '<span class="redirect-in-category">' . $this->getSkin()->makeKnownLinkObj( $title, $titletext ) . '</span>'
+ : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
$this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );
}
@@ -208,7 +206,7 @@ class CategoryViewer {
}
function doCategoryQuery() {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE, 'category' );
if( $this->from != '' ) {
$pageCondition = 'cl_sortkey >= ' . $dbr->addQuotes( $this->from );
$this->flip = false;
@@ -316,7 +314,7 @@ class CategoryViewer {
$countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' );
return "<div id=\"mw-category-media\">\n" .
- '<h2>' . wfMsg( 'category-media-header', htmlspecialchars($this->title->getText()) ) . "</h2>\n" .
+ '<h2>' . wfMsg( 'category-media-header', htmlspecialchars( $this->title->getText() ) ) . "</h2>\n" .
$countmsg . $this->gallery->toHTML() . "\n</div>";
} else {
return '';
@@ -451,12 +449,12 @@ class CategoryViewer {
$sk = $this->getSkin();
$limitText = $wgLang->formatNum( $limit );
- $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) );
+ $prevLink = wfMsgExt( 'prevn', array( 'escape', 'parsemag' ), $limitText );
if( $first != '' ) {
$prevLink = $sk->makeLinkObj( $title, $prevLink,
wfArrayToCGI( $query + array( 'until' => $first ) ) );
}
- $nextLink = htmlspecialchars( wfMsg( 'nextn', $limitText ) );
+ $nextLink = wfMsgExt( 'nextn', array( 'escape', 'parsemag' ), $limitText );
if( $last != '' ) {
$nextLink = $sk->makeLinkObj( $title, $nextLink,
wfArrayToCGI( $query + array( 'from' => $last ) ) );