* (bug 12968) Render redirect wikilinks in a redirect class for customization via...
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 12 Feb 2008 18:01:42 +0000 (18:01 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 12 Feb 2008 18:01:42 +0000 (18:01 +0000)
Based on a patch by Cobi
This works for logged in users who have set a threshold > 0 in its preferences. This way no extra database query is necessary.
Highly resource-intensive javascripts are now obsolete (see example in bugreport)

RELEASE-NOTES
includes/Linker.php

index 249f36b..3c9324b 100644 (file)
@@ -159,6 +159,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   $wgDefaultRobotPolicy setting.
 * (bug 12239) Use different separators for autocomments
 * (bug 12857) Patrol link on new pages should clear floats
+* (bug 12968) Render redirect wikilinks in a redirect class for customization
+  via user/site CSS.
 
 === Bug fixes in 1.12 ===
 
index 0fd5df3..30a5f18 100644 (file)
@@ -76,18 +76,21 @@ class Linker {
         * Return the CSS colour of a known link
         *
         * @param mixed $s
-        * @param integer $id 
-        * @param integer $threshold
+        * @param integer $threshold user defined threshold
+        * @return string $colour CSS class
         */
        function getLinkColour( $s, $threshold ) {
-               if( $threshold > 0 && $s!=false ) {
-                       $colour = (     $s->page_len >= $threshold || 
-                                       $s->page_is_redirect ||
-                                       !Namespace::isContent( $s->page_namespace ) 
-                           ? '' : 'stub' );
+               if( $s == false ) {
+                       return '';
                }
-               else {
-                       $colour = '';
+
+               $colour = '';
+               if ( $s->page_is_redirect ) {
+                       # Page is a redirect
+                       $colour = 'mw-redirect';
+               } elseif ( $threshold > 0 && $s->page_len < $threshold && Namespace::isContent( $s->page_namespace ) ) {
+                       # Page is a stub
+                       $colour = 'stub';
                }
                return $colour;
        }