Render category links as an HTML list. Bug 12261. Based on patch by Thana & Bergi...
authorLeo Koppelkamm <diebuche@users.mediawiki.org>
Wed, 13 Jul 2011 10:41:21 +0000 (10:41 +0000)
committerLeo Koppelkamm <diebuche@users.mediawiki.org>
Wed, 13 Jul 2011 10:41:21 +0000 (10:41 +0000)
includes/Skin.php
languages/messages/MessagesEn.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc
skins/CologneBlue.php
skins/Nostalgia.php
skins/common/shared.css

index 20ba348..87c1b02 100644 (file)
@@ -530,26 +530,23 @@ abstract class Skin {
                        return '';
                }
 
-               # Separator
-               $sep = wfMsgExt( 'catseparator', array( 'parsemag', 'escapenoentities' ) );
-
                // Use Unicode bidi embedding override characters,
                // to make sure links don't smash each other up in ugly ways.
                $dir = $wgContLang->getDir();
-               $embed = "<span dir='$dir'>";
-               $pop = '</span>';
+               $embed = "<li dir='$dir'>";
+               $pop = "</li>";
 
                $allCats = $out->getCategoryLinks();
                $s = '';
                $colon = wfMsgExt( 'colon-separator', 'escapenoentities' );
 
                if ( !empty( $allCats['normal'] ) ) {
-                       $t = $embed . implode( "{$pop} {$sep} {$embed}" , $allCats['normal'] ) . $pop;
+                       $t = $embed . implode( "{$pop} {$embed}" , $allCats['normal'] ) . $pop;
 
                        $msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escapenoentities' ), count( $allCats['normal'] ) );
                        $s .= '<div id="mw-normal-catlinks">' .
                                Linker::link( Title::newFromText( wfMsgForContent( 'pagecategorieslink' ) ), $msg )
-                               . $colon . $t . '</div>';
+                               . $colon . '<ul>' . $t . '</ul>' . '</div>';
                }
 
                # Hidden categories
@@ -564,7 +561,7 @@ abstract class Skin {
 
                        $s .= "<div id=\"mw-hidden-catlinks\" class=\"$class\">" .
                                wfMsgExt( 'hidden-categories', array( 'parsemag', 'escapenoentities' ), count( $allCats['hidden'] ) ) .
-                               $colon . $embed . implode( "$pop $sep $embed", $allCats['hidden'] ) . $pop .
+                               $colon . '<ul>' . $embed . implode( "{$pop} {$embed}" , $allCats['hidden'] ) . $pop . '</ul>' .
                                '</div>';
                }
 
index f831a94..b3f294d 100644 (file)
@@ -510,7 +510,6 @@ $preloadedMessages = array(
        'accesskey-t-specialpages',
        'accesskey-t-whatlinkshere',
        'anonnotice',
-       'catseparator',
        'colon-separator',
        'currentevents',
        'currentevents-url',
@@ -4293,7 +4292,6 @@ Please confirm that you really want to recreate this page.",
 'confirm-unwatch-top'    => 'Remove this page to your watchlist?',
 
 # Separators for various lists, etc.
-'catseparator'        => '|', # only translate this message to other languages if you have to change it
 'semicolon-separator' => ';&#32;', # only translate this message to other languages if you have to change it
 'comma-separator'     => ',&#32;', # only translate this message to other languages if you have to change it
 'colon-separator'     => ':&#32;', # only translate this message to other languages if you have to change it
index 01db6f3..caf62cc 100644 (file)
@@ -378,7 +378,6 @@ $wgOptionalMessages = array(
        'hebrew-calendar-m12-gen',
        'version-api',
        'version-svn-revision',
-       'catseparator',
        'semicolon-separator',
        'comma-separator',
        'colon-separator',
index b9decd6..f996d4d 100644 (file)
@@ -3192,7 +3192,6 @@ $wgMessageStructure = array(
                'confirm-purge-bottom',
        ),
        'separators' => array(
-               'catseparator',
                'semicolon-separator',
                'comma-separator',
                'colon-separator',
index bc4fc72..859db2c 100644 (file)
@@ -77,7 +77,7 @@ class CologneBlueTemplate extends LegacyTemplate {
 
                $s .= '<font size="-1"><span id="langlinks">';
                $s .= str_replace( '<br />', '', $this->otherLanguages() );
-               $cat = $this->getSkin()->getCategoryLinks();
+               $cat = '<div id="catlinks" class="catlinks">' . $this->getSkin()->getCategoryLinks() . '</div>';
                if( $cat ) {
                        $s .= "<br />$cat\n";
                }
index 24dc90b..c23e289 100644 (file)
@@ -54,7 +54,7 @@ class NostalgiaTemplate extends LegacyTemplate {
                        $s .= '<br />' . $ol;
                }
 
-               $cat = $this->getSkin()->getCategoryLinks();
+               $cat = '<div id="catlinks" class="catlinks">' . $this->getSkin()->getCategoryLinks() . '</div>';
                if( $cat ) {
                        $s .= '<br />' . $cat;
                }
index 3898b99..b08853c 100644 (file)
@@ -178,6 +178,27 @@ input#wpSummary {
 .thumbcaption { text-align: left; }
 .magnify { float: right; }
 
+/**
+ * Categories
+ */
+#catlinks ul, #catlinks li {
+       display:inline;
+       margin: 0px;
+       list-style:none;
+       list-style-type:none;
+       list-style-image:none;
+}
+
+#catlinks li {
+       padding: 0 .7em;
+       border-left: 1px solid #AAA;
+}
+
+#catlinks li:first-child {
+       padding-left: .4em;
+       border-left: none;
+}
+
 /**
  * Hidden categories
  */