* (bug 18449) Fixed items number per column on category pages when the total is divisible by 3

This commit is contained in:
Alexandre Emsenhuber 2009-04-16 16:31:29 +00:00
parent c0bb2cb46f
commit f25769622e
2 changed files with 6 additions and 3 deletions

View file

@ -346,6 +346,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* (bug 18441) rebuildrecentchanges.inc no longer ignores $wgLogRestrictions * (bug 18441) rebuildrecentchanges.inc no longer ignores $wgLogRestrictions
* (bug 18317) Bolded selections in 1 | 3 | etc days on RecentChanges now use * (bug 18317) Bolded selections in 1 | 3 | etc days on RecentChanges now use
<strong> instead of hardcoded styles <strong> instead of hardcoded styles
* (bug 18449) Fixed items number per column on category pages when the total is
divisible by 3
== API changes in 1.15 == == API changes in 1.15 ==
* (bug 16858) Revamped list=deletedrevs to make listing deleted contributions * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

View file

@ -363,6 +363,7 @@ class CategoryViewer {
function columnList( $articles, $articles_start_char ) { function columnList( $articles, $articles_start_char ) {
// divide list into three equal chunks // divide list into three equal chunks
$chunk = (int) ( count( $articles ) / 3 ); $chunk = (int) ( count( $articles ) / 3 );
$remaining = count( $articles ) % 3;
// get and display header // get and display header
$r = '<table width="100%"><tr valign="top">'; $r = '<table width="100%"><tr valign="top">';
@ -372,7 +373,7 @@ class CategoryViewer {
// loop through the chunks // loop through the chunks
for( $startChunk = 0, $endChunk = $chunk, $chunkIndex = 0; for( $startChunk = 0, $endChunk = $chunk, $chunkIndex = 0;
$chunkIndex < 3; $chunkIndex < 3;
$chunkIndex++, $startChunk = $endChunk, $endChunk += $chunk + 1) $chunkIndex++, $startChunk = $endChunk, $endChunk += $remaining == 0 ? $chunk : $chunk + 1 )
{ {
$r .= "<td>\n"; $r .= "<td>\n";
$atColumnTop = true; $atColumnTop = true;