Merge "make rebuildtextindex script aware of content models."
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 87ea943..01a12c0 100644 (file)
@@ -122,7 +122,7 @@ class SpecialVersion extends SpecialPage {
                        'Alexandre Emsenhuber', 'Siebrand Mazeland', 'Chad Horohoe',
                        'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
                        'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
                        'Alexandre Emsenhuber', 'Siebrand Mazeland', 'Chad Horohoe',
                        'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
                        'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
-                       'Timo Tijhof',
+                       'Timo Tijhof', 'Daniel Kinzler', 'Jeroen De Dauw',
                        '[[Special:Version/Credits|' .
                        wfMessage( 'version-poweredby-others' )->text() .
                        ']]'
                        '[[Special:Version/Credits|' .
                        wfMessage( 'version-poweredby-others' )->text() .
                        ']]'
@@ -236,7 +236,7 @@ class SpecialVersion extends SpecialPage {
         * @return string wgVersion + a link to subversion revision of svn BASE
         */
        private static function getVersionLinkedSvn() {
         * @return string wgVersion + a link to subversion revision of svn BASE
         */
        private static function getVersionLinkedSvn() {
-               global $wgVersion, $IP;
+               global $IP;
 
                $info = self::getSvnInfo( $IP );
                if( !isset( $info['checkout-rev'] ) ) {
 
                $info = self::getSvnInfo( $IP );
                if( !isset( $info['checkout-rev'] ) ) {
@@ -250,19 +250,33 @@ class SpecialVersion extends SpecialPage {
                )->text();
 
                if ( isset( $info['viewvc-url'] ) ) {
                )->text();
 
                if ( isset( $info['viewvc-url'] ) ) {
-                       $version = "$wgVersion [{$info['viewvc-url']} $linkText]";
+                       $version = "[{$info['viewvc-url']} $linkText]";
                } else {
                } else {
-                       $version = "$wgVersion $linkText";
+                       $version = $linkText;
                }
 
                }
 
-               return $version;
+               return self::getwgVersionLinked() . " $version";
+       }
+
+       /**
+        * @return string
+        */
+       private static function getwgVersionLinked() {
+               global $wgVersion;
+               $versionUrl = "";
+               if( wfRunHooks( 'SpecialVersionVersionUrl', array( $wgVersion, &$versionUrl ) ) ) {
+                       $versionParts = array();
+                       preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts );
+                       $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}";
+               }
+               return "[$versionUrl $wgVersion]";
        }
 
        /**
         * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars. False on failure
         */
        private static function getVersionLinkedGit() {
        }
 
        /**
         * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars. False on failure
         */
        private static function getVersionLinkedGit() {
-               global $wgVersion, $IP;
+               global $IP;
 
                $gitInfo = new GitInfo( $IP );
                $headSHA1 = $gitInfo->getHeadSHA1();
 
                $gitInfo = new GitInfo( $IP );
                $headSHA1 = $gitInfo->getHeadSHA1();
@@ -275,7 +289,7 @@ class SpecialVersion extends SpecialPage {
                if ( $viewerUrl !== false ) {
                        $shortSHA1 = "[$viewerUrl $shortSHA1]";
                }
                if ( $viewerUrl !== false ) {
                        $shortSHA1 = "[$viewerUrl $shortSHA1]";
                }
-               return "$wgVersion $shortSHA1";
+               return self::getwgVersionLinked() . " $shortSHA1";
        }
 
        /**
        }
 
        /**
@@ -761,25 +775,39 @@ class SpecialVersion extends SpecialPage {
                return $repo->getHeadSHA1();
        }
 
                return $repo->getHeadSHA1();
        }
 
+
        /**
         * Get the list of entry points and their URLs
         * @return string Wikitext
         */
        public function getEntryPointInfo() {
                global $wgArticlePath, $wgScriptPath;
        /**
         * Get the list of entry points and their URLs
         * @return string Wikitext
         */
        public function getEntryPointInfo() {
                global $wgArticlePath, $wgScriptPath;
+               $scriptPath = $wgScriptPath ? $wgScriptPath : "/";
                $entryPoints = array(
                        'version-entrypoints-articlepath' => $wgArticlePath,
                $entryPoints = array(
                        'version-entrypoints-articlepath' => $wgArticlePath,
-                       'version-entrypoints-scriptpath' => $wgScriptPath,
+                       'version-entrypoints-scriptpath' => $scriptPath,
                        'version-entrypoints-index-php' => wfScript( 'index' ),
                        'version-entrypoints-api-php' => wfScript( 'api' ),
                        'version-entrypoints-load-php' => wfScript( 'load' ),
                );
 
                        'version-entrypoints-index-php' => wfScript( 'index' ),
                        'version-entrypoints-api-php' => wfScript( 'api' ),
                        'version-entrypoints-load-php' => wfScript( 'load' ),
                );
 
+               $language = $this->getLanguage();
+               $thAttribures = array(
+                       'dir' => $language->getDir(),
+                       'lang' => $language->getCode()
+               );
                $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) .
                $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) .
-                       Html::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'mw-version-entrypoints-table' ) ) .
+                       Html::openElement( 'table',
+                               array(
+                                       'class' => 'wikitable plainlinks',
+                                       'id' => 'mw-version-entrypoints-table',
+                                       'dir' => 'ltr',
+                                       'lang' => 'en'
+                               )
+                       ) .
                        Html::openElement( 'tr' ) .
                        Html::openElement( 'tr' ) .
-                       Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
-                       Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-url' )->text() ) .
+                       Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
+                       Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-url' )->text() ) .
                        Html::closeElement( 'tr' );
 
                foreach ( $entryPoints as $message => $value ) {
                        Html::closeElement( 'tr' );
 
                foreach ( $entryPoints as $message => $value ) {