function addSubcategory( $title, $sortkey, $pageLength ) {
global $wgContLang;
// Subcategory; strip the 'Category' namespace from the link text.
- $this->children[] = $this->getSkin()->makeKnownLinkObj(
- $title, $wgContLang->convertHtml( $title->getText() ) );
+ $this->children[] = $this->getSkin()->link(
+ $title,
+ $wgContLang->convertHtml( $title->getText() ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
$this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey );
}
*/
function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
- $titletext = $wgContLang->convert($title);
+ $titletext = $wgContLang->convertHtml( $title->getPrefixedText() );
$this->articles[] = $isRedirect
- ? '<span class="redirect-in-category">' . $this->getSkin()->makeKnownLinkObj( $title, $titletext ) . '</span>'
+ ? '<span class="redirect-in-category">' .
+ $this->getSkin()->link(
+ $title,
+ $titletext,
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ) . '</span>'
: $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
$this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );
}
}
function doCategoryQuery() {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE, 'category' );
if( $this->from != '' ) {
$pageCondition = 'cl_sortkey >= ' . $dbr->addQuotes( $this->from );
$this->flip = false;
$this->addPage( $title, $x->cl_sortkey, $x->page_len, $x->page_is_redirect );
}
}
- $dbr->freeResult( $res );
}
function getCategoryTop() {
- $r = '';
- if( $this->until != '' ) {
- $r .= $this->pagingLinks( $this->title, $this->nextPage, $this->until, $this->limit );
- } elseif( $this->nextPage != '' || $this->from != '' ) {
- $r .= $this->pagingLinks( $this->title, $this->from, $this->nextPage, $this->limit );
- }
- return $r == ''
+ $r = $this->getCategoryBottom();
+ return $r === ''
? $r
: "<br style=\"clear:both;\"/>\n" . $r;
}
*/
function columnList( $articles, $articles_start_char ) {
// divide list into three equal chunks
- $chunk = (int) (count ( $articles ) / 3);
+ $chunk = (int) ( count( $articles ) / 3 );
+ $remaining = count( $articles ) % 3;
// get and display header
$r = '<table width="100%"><tr valign="top">';
$prev_start_char = 'none';
// loop through the chunks
- for($startChunk = 0, $endChunk = $chunk, $chunkIndex = 0;
+ for( $startChunk = 0, $endChunk = $chunk, $chunkIndex = 0;
$chunkIndex < 3;
- $chunkIndex++, $startChunk = $endChunk, $endChunk += $chunk + 1)
+ $chunkIndex++, $startChunk = $endChunk, $endChunk += $remaining == 0 ? $chunk : $chunk + 1 )
{
$r .= "<td>\n";
$atColumnTop = true;
$sk = $this->getSkin();
$limitText = $wgLang->formatNum( $limit );
- $prevLink = wfMsgExt( 'prevn', array( 'escape' ), $limitText );
+ $prevLink = wfMsgExt( 'prevn', array( 'escape', 'parsemag' ), $limitText );
if( $first != '' ) {
- $prevLink = $sk->makeLinkObj( $title, $prevLink,
- wfArrayToCGI( $query + array( 'until' => $first ) ) );
+ $prevQuery = $query;
+ $prevQuery['until'] = $first;
+ $prevLink = $sk->linkKnown(
+ $title,
+ $prevLink,
+ array(),
+ $prevQuery
+ );
}
- $nextLink = wfMsgExt( 'nextn', array( 'escape' ), $limitText );
+ $nextLink = wfMsgExt( 'nextn', array( 'escape', 'parsemag' ), $limitText );
if( $last != '' ) {
- $nextLink = $sk->makeLinkObj( $title, $nextLink,
- wfArrayToCGI( $query + array( 'from' => $last ) ) );
+ $lastQuery = $query;
+ $lastQuery['from'] = $last;
+ $nextLink = $sk->linkKnown(
+ $title,
+ $nextLink,
+ array(),
+ $lastQuery
+ );
}
return "($prevLink) ($nextLink)";