* A new magic word, {{PATH}}, returns $wgScriptPath
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 19 Jun 2005 16:09:00 +0000 (16:09 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 19 Jun 2005 16:09:00 +0000 (16:09 +0000)
RELEASE-NOTES
includes/MagicWord.php
includes/Parser.php
languages/Language.php

index 080133f..0ac6e60 100644 (file)
@@ -298,6 +298,7 @@ Various bugfixes, small features, and a few experimental things:
 * (bug 2277) Added Friulian language file
 * (bug 2457) The "Special page" href now links to the current special page
   rather than to "".
+* A new magic word, {{PATH}}, returns $wgScriptPath
 * Special:Imagelist displays titles with " " instead of "_"
 * Less gratuitous munging of content sample in delete summary
 * badaccess/badaccesstext to supercede sysop*, developer* messages
index 224facb..a0bff75 100644 (file)
@@ -52,6 +52,7 @@ define('MAG_NOCONTENTCONVERT',                37);
 define('MAG_CURRENTWEEK',              38);
 define('MAG_CURRENTDOW',               39);
 define('MAG_REVISIONID',               40);
+define('MAG_PATH',                     41);
 
 $wgVariableIDs = array(
        MAG_CURRENTMONTH,
@@ -65,6 +66,7 @@ $wgVariableIDs = array(
        MAG_NUMBEROFARTICLES,
        MAG_SITENAME,
        MAG_SERVER,
+       MAG_PATH,
        MAG_PAGENAME,
        MAG_PAGENAMEE,
        MAG_NAMESPACE,
index 1167711..d5e6a69 100644 (file)
@@ -1851,7 +1851,7 @@ class Parser
         * @access private
         */
        function getVariableValue( $index ) {
-               global $wgContLang, $wgSitename, $wgServer, $wgArticle;
+               global $wgContLang, $wgSitename, $wgServer, $wgArticle, $wgScriptPath;
                
                /**
                 * Some of these require message or data lookups and can be
@@ -1896,6 +1896,8 @@ class Parser
                                return $wgSitename;
                        case MAG_SERVER:
                                return $wgServer;
+                       case MAG_PATH:
+                               return $wgScriptPath;
                        default:
                                return NULL;
                }
index a5eaee3..3fd52b5 100644 (file)
@@ -230,6 +230,7 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_LOCALURL             => array( 0,    'LOCALURL:'              ),
        MAG_LOCALURLE            => array( 0,    'LOCALURLE:'             ),
        MAG_SERVER               => array( 0,    'SERVER'                 ),
+       MAG_PATH                 => array( 0,    'PATH'                   ),
        MAG_GRAMMAR              => array( 0,    'GRAMMAR:'               ),
        MAG_NOTITLECONVERT       => array( 0,    '__NOTITLECONVERT__', '__NOTC__'),
        MAG_NOCONTENTCONVERT     => array( 0,    '__NOCONTENTCONVERT__', '__NOCC__'),