Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / Skin.php
index f63d4d2..9d1034b 100644 (file)
@@ -315,7 +315,7 @@ abstract class Skin extends ContextSource {
        /**
         * Set the "relevant" title
         * @see self::getRelevantTitle()
-        * @param Title $t Title object to use
+        * @param Title $t
         */
        public function setRelevantTitle( $t ) {
                $this->mRelevantTitle = $t;
@@ -341,7 +341,7 @@ abstract class Skin extends ContextSource {
        /**
         * Set the "relevant" user
         * @see self::getRelevantUser()
-        * @param User $u User object to use
+        * @param User $u
         */
        public function setRelevantUser( $u ) {
                $this->mRelevantUser = $u;
@@ -678,12 +678,15 @@ abstract class Skin extends ContextSource {
        function printSource() {
                $oldid = $this->getRevisionId();
                if ( $oldid ) {
-                       $url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid ) ) );
+                       $canonicalUrl = $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid );
+                       $url = htmlspecialchars( wfExpandIRI( $canonicalUrl ) );
                } else {
                        // oldid not available for non existing pages
                        $url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL() ) );
                }
-               return $this->msg( 'retrievedfrom', '<a href="' . $url . '">' . $url . '</a>' )->text();
+
+               return $this->msg( 'retrievedfrom', '<a dir="ltr" href="' . $url
+                       . '">' . $url . '</a>' )->text();
        }
 
        /**
@@ -799,7 +802,9 @@ abstract class Skin extends ContextSource {
                global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgContLang;
 
                if ( $type == 'detect' ) {
-                       if ( !$this->isRevisionCurrent() && !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled() ) {
+                       if ( !$this->isRevisionCurrent()
+                               && !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled()
+                       ) {
                                $type = 'history';
                        } else {
                                $type = 'normal';
@@ -827,14 +832,21 @@ abstract class Skin extends ContextSource {
                // Allow for site and per-namespace customization of copyright notice.
                $forContent = true;
 
-               wfRunHooks( 'SkinCopyrightFooter', array( $this->getTitle(), $type, &$msg, &$link, &$forContent ) );
+               wfRunHooks(
+                       'SkinCopyrightFooter',
+                       array( $this->getTitle(), $type, &$msg, &$link, &$forContent )
+               );
 
                $msgObj = $this->msg( $msg )->rawParams( $link );
                if ( $forContent ) {
                        $msg = $msgObj->inContentLanguage()->text();
                        if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) {
-                               $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $msg );
+                               $msg = Html::rawElement( 'span', array(
+                                       'lang' => $wgContLang->getHtmlCode(),
+                                       'dir' => $wgContLang->getDir()
+                               ), $msg );
                        }
+
                        return $msg;
                } else {
                        return $msgObj->text();
@@ -878,7 +890,8 @@ abstract class Skin extends ContextSource {
                global $wgStylePath;
 
                $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
-               $text = '<a href="//www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
+               $text = '<a href="//www.mediawiki.org/"><img src="' . $url
+                       . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
                wfRunHooks( 'SkinGetPoweredBy', array( &$text, $this ) );
                return $text;
        }
@@ -934,8 +947,10 @@ abstract class Skin extends ContextSource {
 
        /**
         * Renders a $wgFooterIcons icon according to the method's arguments
-        * @param array $icon The icon to build the html for, see $wgFooterIcons for the format of this array
-        * @param bool|string $withImage Whether to use the icon's image or output a text-only footericon
+        * @param array $icon The icon to build the html for, see $wgFooterIcons
+        *   for the format of this array.
+        * @param bool|string $withImage Whether to use the icon's image or output
+        *   a text-only footericon.
         * @return string HTML
         */
        function makeFooterIcon( $icon, $withImage = 'withImage' ) {
@@ -945,7 +960,8 @@ abstract class Skin extends ContextSource {
                        $url = isset( $icon["url"] ) ? $icon["url"] : null;
                        unset( $icon["url"] );
                        if ( isset( $icon["src"] ) && $withImage === 'withImage' ) {
-                               $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array
+                               // do this the lazy way, just pass icon data as an attribute array
+                               $html = Html::element( 'img', $icon );
                        } else {
                                $html = htmlspecialchars( $icon["alt"] );
                        }
@@ -1044,8 +1060,11 @@ abstract class Skin extends ContextSource {
                } else {
                        $targetUser = User::newFromId( $id );
                }
-               return $this->getUser()->canSendEmail() && # the sending user must have a confirmed email address
-                       $targetUser->canReceiveEmail(); # the target user must have a confirmed email address and allow emails from users
+
+               # The sending user must have a confirmed email address and the target
+               # user must have a confirmed email address and allow emails from users.
+               return $this->getUser()->canSendEmail() &&
+                       $targetUser->canReceiveEmail();
        }
 
        /**
@@ -1244,6 +1263,8 @@ abstract class Skin extends ContextSource {
                if ( $wgEnableSidebarCache ) {
                        $cachedsidebar = $wgMemc->get( $key );
                        if ( $cachedsidebar ) {
+                               wfRunHooks( 'SidebarBeforeOutput', array( $this, &$cachedsidebar ) );
+
                                wfProfileOut( __METHOD__ );
                                return $cachedsidebar;
                        }
@@ -1257,6 +1278,8 @@ abstract class Skin extends ContextSource {
                        $wgMemc->set( $key, $bar, $wgSidebarCacheExpiry );
                }
 
+               wfRunHooks( 'SidebarBeforeOutput', array( $this, &$bar ) );
+
                wfProfileOut( __METHOD__ );
                return $bar;
        }