Followup r91672: remove commented-out reference to removed file (rtl.css)
[lhc/web/wiklou.git] / includes / Skin.php
index 4b06e1d..3dc7a3c 100644 (file)
@@ -473,6 +473,7 @@ abstract class Skin {
         * @return String
         */
        function getPageClasses( $title ) {
+               global $wgRequest;
                $numeric = 'ns-' . $title->getNamespace();
 
                if ( $title->getNamespace() == NS_SPECIAL ) {
@@ -491,8 +492,13 @@ abstract class Skin {
                }
 
                $name = Sanitizer::escapeClass( 'page-' . $title->getPrefixedText() );
-
-               return "$numeric $type $name";
+               
+               if ( $wgRequest->getVal('action') ) {
+                       $action = 'action-' . $wgRequest->getVal('action');
+               } else {
+                       $action = 'action-view';
+               }
+               return "$numeric $type $name $action";
        }
 
        /**
@@ -516,7 +522,7 @@ abstract class Skin {
        }
 
        function getCategoryLinks() {
-               global $wgUseCategoryBrowser, $wgContLang;
+               global $wgUseCategoryBrowser;
 
                $out = $this->getContext()->getOutput();
 
@@ -524,26 +530,20 @@ 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>";
+               $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
@@ -558,7 +558,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>';
                }
 
@@ -754,7 +754,9 @@ abstract class Skin {
 
                if ( $this->getContext()->getUser()->isAllowed( 'deletedhistory' ) &&
                        ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) {
-                       $n = $this->getTitle()->isDeleted();
+
+                       $includeSuppressed = $this->getContext()->getUser()->isAllowed( 'suppressrevision' );
+                       $n = $this->getTitle()->isDeleted( $includeSuppressed );
 
                        if ( $n ) {
                                if ( $this->getContext()->getUser()->isAllowed( 'undelete' ) ) {
@@ -1328,7 +1330,7 @@ abstract class Skin {
                                        $bar[$heading][] = array_merge( array(
                                                'text' => $text,
                                                'href' => $href,
-                                               'id' => 'n-' . strtr( $line[1], ' ', '-' ),
+                                               'id' => 'n-' . Sanitizer::escapeId( strtr( $line[1], ' ', '-' ), 'noninitial' ),
                                                'active' => false
                                        ), $extraAttribs );
                                } elseif ( ( substr( $line, 0, 2 ) == '{{' ) && ( substr( $line, -2 ) == '}}' ) ) {
@@ -1430,7 +1432,7 @@ abstract class Skin {
         * @return String: HTML fragment
         */
        private function getCachedNotice( $name ) {
-               global $wgRenderHashAppend, $parserMemc;
+               global $wgRenderHashAppend, $parserMemc, $wgContLang;
 
                wfProfileIn( __METHOD__ );
 
@@ -1472,7 +1474,8 @@ abstract class Skin {
                        $notice = $parsed;
                }
 
-               $notice = '<div id="localNotice">' .$notice . '</div>';
+               $notice = Html::rawElement( 'div', array( 'id' => 'localNotice',
+                       'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $notice );
                wfProfileOut( __METHOD__ );
                return $notice;
        }