fix typo, DieDebug -> DebugDie
[lhc/web/wiklou.git] / includes / CategoryPage.php
index a3e7a71..911f017 100644 (file)
@@ -9,7 +9,8 @@
 if( !defined( 'MEDIAWIKI' ) )
        die();
 
-if( $wgCategoryMagicGallery ) 
+if( $wgCategoryMagicGallery )
+       /** */
        require_once('ImageGallery.php');
 
 /**
@@ -232,8 +233,8 @@ class CategoryPage extends Article {
                        $chunkIndex < 3;
                        $chunkIndex++, $startChunk = $endChunk, $endChunk += $chunk + 1)
                {
-
-                       $r .= '<td><ul>';
+                       $r .= "<td>\n";
+                       $atColumnTop = true;
 
                        // output all articles in category
                        for ($index = $startChunk ;
@@ -245,16 +246,24 @@ class CategoryPage extends Article {
                                         ($articles_start_char[$index] != $articles_start_char[$index - 1]) )
 
                                {
+                                       if( $atColumnTop ) {
+                                               $atColumnTop = false;
+                                       } else {
+                                               $r .= "</ul>\n";
+                                       }
                                        $cont_msg = "";
                                        if ( $articles_start_char[$index] == $prev_start_char )
                                                $cont_msg = wfMsg('listingcontinuesabbrev');
-                                       $r .= "</ul><h3>{$articles_start_char[$index]}$cont_msg</h3>\n<ul>";
+                                       $r .= "<h3>{$articles_start_char[$index]}$cont_msg</h3>\n<ul>";
                                        $prev_start_char = $articles_start_char[$index];
                                }
 
                                $r .= "<li>{$articles[$index]}</li>";
                        }
-                       $r .= '</ul></td>';
+                       if( !$atColumnTop ) {
+                               $r .= "</ul>\n";
+                       }
+                       $r .= "</td>\n";
 
 
                }