Localisation updates for core and extension messages from translatewiki.net
[lhc/web/wiklou.git] / includes / Skin.php
index f3a37f9..9ecb615 100644 (file)
@@ -288,7 +288,7 @@ abstract class Skin extends ContextSource {
        abstract function outputPage( OutputPage $out = null );
 
        /**
-        * @param $data
+        * @param $data array
         * @return string
         */
        static function makeVariablesScript( $data ) {
@@ -301,6 +301,21 @@ abstract class Skin extends ContextSource {
                }
        }
 
+       /**
+        * Make a <script> tag containing global variables
+        *
+        * @deprecated in 1.19
+        * @param $unused Unused
+        * @return string HTML fragment
+        */
+       public static function makeGlobalVariablesScript( $unused ) {
+               global $wgOut;
+
+               wfDeprecated( __METHOD__, '1.19' );
+
+               return self::makeVariablesScript( $wgOut->getJSVars() );
+       }
+
        /**
         * Get the query to generate a dynamic stylesheet
         *
@@ -531,7 +546,7 @@ abstract class Skin extends ContextSource {
        protected function generateDebugHTML() {
                global $wgShowDebug;
 
-               $html = MWDebug::getDebugHTML();
+               $html = MWDebug::getDebugHTML( $this->getContext() );
 
                if ( $wgShowDebug ) {
                        $listInternals = $this->formatDebugHTML( $this->getOutput()->mDebugtext );
@@ -543,7 +558,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $debugText
+        * @param $debugText string
         * @return string
         */
        private function formatDebugHTML( $debugText ) {
@@ -734,7 +749,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param string $type
+        * @param $type string
         * @return string
         */
        function getCopyright( $type = 'detect' ) {
@@ -775,7 +790,7 @@ abstract class Skin extends ContextSource {
                if ( $forContent ) {
                        $msg = $msgObj->inContentLanguage()->text();
                        if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) {
-                               $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg );
+                               $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $msg );
                        }
                        return $msg;
                } else {
@@ -828,14 +843,14 @@ abstract class Skin extends ContextSource {
        /**
         * Get the timestamp of the latest revision, formatted in user language
         *
-        * @param $page WikiPage object. Used if we're working with the current revision
         * @return String
         */
-       protected function lastModified( $page ) {
-               if ( !$this->isRevisionCurrent() ) {
+       protected function lastModified() {
+               $timestamp = $this->getOutput()->getRevisionTimestamp();
+
+               # No cached timestamp, load it from the database
+               if ( $timestamp === null ) {
                        $timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->getRevisionId() );
-               } else {
-                       $timestamp = $page->getTimestamp();
                }
 
                if ( $timestamp ) {
@@ -866,7 +881,7 @@ abstract class Skin extends ContextSource {
 
                $mp = $this->msg( 'mainpage' )->escaped();
                $mptitle = Title::newMainPage();
-               $url = ( is_object( $mptitle ) ? $mptitle->escapeLocalURL() : '' );
+               $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) : '' );
 
                $logourl = $this->getLogo();
                $s = "<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
@@ -976,7 +991,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $id
+        * @param $id User|int
         * @return bool
         */
        function showEmailUser( $id ) {
@@ -1027,7 +1042,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
+        * @param $name string
         * @param $urlaction string
         * @return String
         */
@@ -1037,8 +1052,8 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
-        * @param $subpage
+        * @param $name string
+        * @param $subpage string
         * @param $urlaction string
         * @return String
         */
@@ -1048,7 +1063,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
+        * @param $name string
         * @param $urlaction string
         * @return String
         */
@@ -1059,7 +1074,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * @param $name
+        * @param $name string
         * @param $urlaction string
         * @return String
         */
@@ -1134,7 +1149,7 @@ abstract class Skin extends ContextSource {
         * make sure we have some title to operate on
         *
         * @param $title Title
-        * @param $name
+        * @param $name string
         */
        static function checkTitle( &$title, $name ) {
                if ( !is_object( $title ) ) {
@@ -1392,7 +1407,7 @@ abstract class Skin extends ContextSource {
                }
 
                $notice = Html::rawElement( 'div', array( 'id' => 'localNotice',
-                       'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $notice );
+                       'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $notice );
                wfProfileOut( __METHOD__ );
                return $notice;
        }