X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=ddd01eb5c2276a6cd78bb0f4ecaab94eaed72339;hb=bbffc62c58972a34ee617ce135e37ec936272341;hp=cfebdd1f1e42918acaac2491a0e0f0a4d74fea68;hpb=216d661d3b0098b93926b485fb986e66d9cb0bad;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index cfebdd1f1e..ddd01eb5c2 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -1,7 +1,24 @@ msg( 'category-empty' )->parseAsBlock(); } $lang = $this->getLanguage(); @@ -159,6 +176,7 @@ class CategoryViewer extends ContextSource { * @deprecated since 1.17 kept for compatibility, please use addSubcategoryObject instead */ function addSubcategory( Title $title, $sortkey, $pageLength ) { + wfDeprecated( __METHOD__, '1.17' ); $this->addSubcategoryObject( Category::newFromTitle( $title ), $sortkey, $pageLength ); } @@ -171,7 +189,8 @@ class CategoryViewer extends ContextSource { * * @param Title $title * @param string $sortkey The human-readable sortkey (before transforming to icu or whatever). - */ + * @return string + */ function getSubcategorySortChar( $title, $sortkey ) { global $wgContLang; @@ -350,7 +369,7 @@ class CategoryViewer extends ContextSource { if ( $rescnt > 0 ) { # Showing subcategories $r .= "
\n"; - $r .= '

' . wfMsg( 'subcategories' ) . "

\n"; + $r .= '

' . $this->msg( 'subcategories' )->text() . "

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'subcat' ); $r .= $this->formatList( $this->children, $this->children_start_char ); @@ -364,7 +383,7 @@ class CategoryViewer extends ContextSource { * @return string */ function getPagesSection() { - $ti = htmlspecialchars( $this->title->getText() ); + $ti = wfEscapeWikiText( $this->title->getText() ); # Don't show articles section if there are none. $r = ''; @@ -379,7 +398,7 @@ class CategoryViewer extends ContextSource { if ( $rescnt > 0 ) { $r = "
\n"; - $r .= '

' . wfMsg( 'category_header', $ti ) . "

\n"; + $r .= '

' . $this->msg( 'category_header', $ti )->text() . "

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'page' ); $r .= $this->formatList( $this->articles, $this->articles_start_char ); @@ -400,7 +419,7 @@ class CategoryViewer extends ContextSource { $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' ); $r .= "
\n"; - $r .= '

' . wfMsg( 'category-media-header', htmlspecialchars( $this->title->getText() ) ) . "

\n"; + $r .= '

' . $this->msg( 'category-media-header', wfEscapeWikiText( $this->title->getText() ) )->text() . "

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'file' ); if ( $this->showGallery ) { @@ -485,10 +504,11 @@ class CategoryViewer extends ContextSource { # Split into three columns $columns = array_chunk( $columns, ceil( count( $columns ) / 3 ), true /* preserve keys */ ); - $ret = '
'; + $ret = ''; $prevchar = null; foreach ( $columns as $column ) { + $ret .= '\n\n"; } - $ret .= '
'; $colContents = array(); # Kind of like array_flip() here, but we keep duplicates in an @@ -518,10 +538,10 @@ class CategoryViewer extends ContextSource { $prevchar = $char; } - $ret .= ""; + $ret .= "
'; + $ret .= '
'; return $ret; } @@ -556,7 +576,7 @@ class CategoryViewer extends ContextSource { * @return String HTML */ private function pagingLinks( $first, $last, $type = '' ) { - $prevLink = wfMessage( 'prevn' )->numParams( $this->limit )->escaped(); + $prevLink = $this->msg( 'prevn' )->numParams( $this->limit )->escaped(); if ( $first != '' ) { $prevQuery = $this->query; @@ -570,7 +590,7 @@ class CategoryViewer extends ContextSource { ); } - $nextLink = wfMessage( 'nextn' )->numParams( $this->limit )->escaped(); + $nextLink = $this->msg( 'nextn' )->numParams( $this->limit )->escaped(); if ( $last != '' ) { $lastQuery = $this->query; @@ -584,7 +604,7 @@ class CategoryViewer extends ContextSource { ); } - return "($prevLink) ($nextLink)"; + return $this->msg('categoryviewer-pagedlinks')->rawParams($prevLink, $nextLink)->escaped(); } /** @@ -668,8 +688,8 @@ class CategoryViewer extends ContextSource { $this->cat->refreshCounts(); } else { # Case 3: hopeless. Don't give a total count at all. - return wfMessage( "category-$type-count-limited" )->numParams( $rescnt )->parseAsBlock(); + return $this->msg( "category-$type-count-limited" )->numParams( $rescnt )->parseAsBlock(); } - return wfMessage( "category-$type-count" )->numParams( $rescnt, $totalcnt )->parseAsBlock(); + return $this->msg( "category-$type-count" )->numParams( $rescnt, $totalcnt )->parseAsBlock(); } }