$this->children = array();
$this->children_start_char = array();
if ( $this->showGallery ) {
- $this->gallery = new ImageGallery();
+ $this->gallery = ImageGalleryBase::factory();
$this->gallery->setHideBadImages();
+ $this->gallery->setContext( $this->getContext() );
} else {
$this->imgsNoGallery = array();
$this->imgsNoGallery_start_char = array();
$link = Linker::link( $title );
if ( $isRedirect ) {
// This seems kind of pointless given 'mw-redirect' class,
- // but keeping for back-compatiability with user css.
+ // but keeping for back-compatibility with user css.
$link = '<span class="redirect-in-category">' . $link . '</span>';
}
$this->articles[] = $link;
$r = '';
# @todo FIXME: Here and in the other two sections: we don't need to bother
- # with this rigamarole if the entire category contents fit on one page
+ # with this rigmarole if the entire category contents fit on one page
# and have already been retrieved. We can just use $rescnt in that
# case and save a query and some logic.
$dbcnt = $this->cat->getPageCount() - $this->cat->getSubcatCount()
$first = true;
foreach ( $colContents as $char => $articles ) {
- $ret .= '<h3>' . htmlspecialchars( $char );
+ # Change space to non-breaking space to keep headers aligned
+ $h3char = $char === ' ' ? ' ' : htmlspecialchars( $char );
+
+ $ret .= '<h3>' . $h3char;
if ( $first && $char === $prevchar ) {
# We're continuing a previous chunk at the top of a new
# column, so add " cont." after the letter.
* Create paging links, as a helper method to getSectionPagingLinks().
*
* @param string $first The 'until' parameter for the generated URL
- * @param string $last The 'from' parameter for the genererated URL
+ * @param string $last The 'from' parameter for the generated URL
* @param string $type A prefix for parameters, 'page' or 'subcat' or
* 'file'
* @return String HTML
* returned? This function says what. Each type is considered independently
* of the other types.
*
- * Note for grepping: uses the messages category-article-count,
- * category-article-count-limited, category-subcat-count,
- * category-subcat-count-limited, category-file-count,
- * category-file-count-limited.
- *
* @param int $rescnt The number of items returned by our database query.
* @param int $dbcnt The number of items according to the category table.
* @param string $type 'subcat', 'article', or 'file'
$this->cat->refreshCounts();
} else {
# Case 3: hopeless. Don't give a total count at all.
+ # Give grep a chance to find the usages: category-subcat-count-limited,
+ # category-article-count-limited, category-file-count-limited
return $this->msg( "category-$type-count-limited" )->numParams( $rescnt )->parseAsBlock();
}
+ # Give grep a chance to find the usages:
+ # category-subcat-count, category-article-count, category-file-count
return $this->msg( "category-$type-count" )->numParams( $rescnt, $totalcnt )->parseAsBlock();
}
}