X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=305a8e5113b02cd002d7dd2b7131bd4d33669089;hb=5775d5e5c15098da4c1ebc121e678cee95ecaafa;hp=4027bef09f62791d710086ba07a5b8939455e249;hpb=6b942271c7c9f49cee617cc664c6704ba7bedea8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 4027bef09f..305a8e5113 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -29,12 +29,12 @@ class CategoryViewer extends ContextSource { $imgsNoGallery; /** - * @var Array + * @var array */ var $nextPage; /** - * @var Array + * @var array */ var $flip; @@ -69,14 +69,16 @@ class CategoryViewer extends ContextSource { * Constructor * * @since 1.19 $context is a second, required parameter - * @param $title Title - * @param $context IContextSource + * @param Title $title + * @param IContextSource $context * @param array $from An array with keys page, subcat, * and file for offset of results of each section (since 1.17) * @param array $until An array with 3 keys for until of each section (since 1.17) - * @param $query Array + * @param array $query */ - function __construct( $title, IContextSource $context, $from = array(), $until = array(), $query = array() ) { + function __construct( $title, IContextSource $context, $from = array(), + $until = array(), $query = array() + ) { global $wgCategoryPagingLimit; $this->title = $title; $this->setContext( $context ); @@ -160,9 +162,9 @@ class CategoryViewer extends ContextSource { /** * Add a subcategory to the internal lists, using a Category object - * @param $cat Category - * @param $sortkey - * @param $pageLength + * @param Category $cat + * @param string $sortkey + * @param int $pageLength */ function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) { // Subcategory; strip the 'Category' namespace from the link text. @@ -208,10 +210,10 @@ class CategoryViewer extends ContextSource { /** * Add a page in the image namespace - * @param $title Title - * @param $sortkey - * @param $pageLength - * @param $isRedirect bool + * @param Title $title + * @param string $sortkey + * @param int $pageLength + * @param bool $isRedirect */ function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; @@ -238,10 +240,10 @@ class CategoryViewer extends ContextSource { /** * Add a miscellaneous page - * @param $title - * @param $sortkey - * @param $pageLength - * @param $isRedirect bool + * @param Title $title + * @param string $sortkey + * @param int $pageLength + * @param bool $isRedirect */ function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; @@ -423,7 +425,12 @@ class CategoryViewer extends ContextSource { $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' ); $r .= "
\n"; - $r .= '

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

\n"; + $r .= '

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

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'file' ); if ( $this->showGallery ) { @@ -442,12 +449,14 @@ class CategoryViewer extends ContextSource { * of the output. * * @param string $type 'page', 'subcat', or 'file' - * @return String: HTML output, possibly empty if there are no other pages + * @return string HTML output, possibly empty if there are no other pages */ private function getSectionPagingLinks( $type ) { if ( isset( $this->until[$type] ) && $this->until[$type] !== null ) { return $this->pagingLinks( $this->nextPage[$type], $this->until[$type], $type ); - } elseif ( $this->nextPage[$type] !== null || ( isset( $this->from[$type] ) && $this->from[$type] !== null ) ) { + } elseif ( $this->nextPage[$type] !== null + || ( isset( $this->from[$type] ) && $this->from[$type] !== null ) + ) { return $this->pagingLinks( $this->from[$type], $this->nextPage[$type], $type ); } else { return ''; @@ -465,10 +474,10 @@ class CategoryViewer extends ContextSource { * Format a list of articles chunked by letter, either as a * bullet list or a columnar format, depending on the length. * - * @param $articles Array - * @param $articles_start_char Array - * @param $cutoff Int - * @return String + * @param array $articles + * @param array $articles_start_char + * @param int $cutoff + * @return string * @private */ function formatList( $articles, $articles_start_char, $cutoff = 6 ) { @@ -498,9 +507,9 @@ class CategoryViewer extends ContextSource { * More distant TODO: Scrap this and use CSS columns, whenever IE finally * supports those. * - * @param $articles Array - * @param $articles_start_char Array - * @return String + * @param array $articles + * @param string[] $articles_start_char + * @return string * @private */ static function columnList( $articles, $articles_start_char ) { @@ -554,15 +563,16 @@ class CategoryViewer extends ContextSource { /** * Format a list of articles chunked by letter in a bullet list. - * @param $articles Array - * @param $articles_start_char Array - * @return String + * @param array $articles + * @param string[] $articles_start_char + * @return string * @private */ static function shortList( $articles, $articles_start_char ) { $r = '

' . htmlspecialchars( $articles_start_char[0] ) . "

\n"; $r .= '

" . htmlspecialchars( $articles_start_char[$index] ) . "

\n