Moved MAG_XXXX constants to MagicWord.php, changed canonical name for NS 4 to "MetaNa...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 9 Apr 2004 07:02:29 +0000 (07:02 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 9 Apr 2004 07:02:29 +0000 (07:02 +0000)
includes/MagicWord.php
includes/Namespace.php
includes/Title.php
languages/Language.php

index 57e79b8..0861e63 100644 (file)
 
 /*private*/ $wgMagicFound = false;
 
+define("MAG_REDIRECT", 0);
+define("MAG_NOTOC", 1);
+define("MAG_START", 2);
+define("MAG_CURRENTMONTH", 3);
+define("MAG_CURRENTMONTHNAME", 4);
+define("MAG_CURRENTDAY", 5);
+define("MAG_CURRENTDAYNAME", 6);
+define("MAG_CURRENTYEAR", 7);
+define("MAG_CURRENTTIME", 8);
+define("MAG_NUMBEROFARTICLES", 9);
+define("MAG_CURRENTMONTHNAMEGEN", 10);
+define("MAG_MSG", 11);
+define("MAG_SUBST", 12);
+define("MAG_MSGNW", 13);
+define("MAG_NOEDITSECTION", 14);
+define("MAG_END", 15);
+define("MAG_IMG_THUMBNAIL",  16);
+define("MAG_IMG_RIGHT",      17);
+define("MAG_IMG_LEFT",       18);
+define("MAG_IMG_NONE",       19);
+define("MAG_IMG_WIDTH",      20);
+define("MAG_IMG_CENTER",      21);
+define("MAG_INT", 22);
+define("MAG_FORCETOC", 23);
+define("MAG_SITENAME", 24);
+define("MAG_NS", 25);
+define("MAG_LOCALURL", 26);
+define("MAG_LOCALURLE", 27);
+define("MAG_SERVER", 28);
+
+$wgVariableIDs = array(
+       MAG_CURRENTMONTH,
+       MAG_CURRENTMONTHNAME,
+       MAG_CURRENTDAY,
+       MAG_CURRENTDAYNAME,
+       MAG_CURRENTYEAR,
+       MAG_CURRENTTIME,
+       MAG_NUMBEROFARTICLES,
+       MAG_CURRENTMONTHNAMEGEN,
+    MAG_SITENAME,
+       MAG_SERVER
+);
+
 class MagicWord {
        /*private*/ var $mId, $mSynonyms, $mCaseSensitive, $mRegex;
        /*private*/ var $mRegexStart, $mBaseRegex, $mVariableRegex;
index a5bb448..37e580b 100644 (file)
@@ -34,8 +34,8 @@ define("NS_HELP_TALK", 13);
        NS_TALK             => "Talk",
        NS_USER             => "User",
        NS_USER_TALK        => "User_talk",
-       NS_WIKIPEDIA        => "Wikipedia",
-       NS_WIKIPEDIA_TALK   => "Wikipedia_talk",
+       NS_WIKIPEDIA        => "MetaNamespace",
+       NS_WIKIPEDIA_TALK   => "MetaNamespace_talk",
        NS_IMAGE            => "Image",
        NS_IMAGE_TALK       => "Image_talk",
        NS_MEDIAWIKI        => "MediaWiki",
index 18bec83..8b86a24 100644 (file)
@@ -58,14 +58,14 @@ class Title {
                static $trans;
                $fname = "Title::newFromText";
                wfProfileIn( $fname );
-               
+
                # Note - mixing latin1 named entities and unicode numbered
                # ones will result in a bad link.
                if( !isset( $trans ) ) {
                        global $wgInputEncoding;
                        $trans = array_flip( get_html_translation_table( HTML_ENTITIES ) );
                        if( strcasecmp( "utf-8", $wgInputEncoding ) == 0 ) {
-                           $trans = array_map( "utf8_encode", $trans );
+                               $trans = array_map( "utf8_encode", $trans );
                        }
                }
 
@@ -73,7 +73,7 @@ class Title {
                        wfDebugDieBacktrace( "Called with object instead of string." );
                }
                $text = strtr( $text, $trans );
-               
+
                $text = wfMungeToUtf8( $text );
                
                
@@ -82,8 +82,8 @@ class Title {
 
                $t = new Title();
                $t->mDbkeyform = str_replace( " ", "_", $text );
-        $t->mDefaultNamespace = $defaultNamespace;
-        
+               $t->mDefaultNamespace = $defaultNamespace;
+
                wfProfileOut( $fname );
                if ( !is_object( $t ) ) {
                        var_dump( debug_backtrace() );
index a1f583c..e00866c 100644 (file)
 # files for examples.
 #
 
-#--------------------------------------------------------------------------
-# Constants
-#--------------------------------------------------------------------------
-
-# Magic words
-define("MAG_REDIRECT", 0);
-define("MAG_NOTOC", 1);
-define("MAG_START", 2);
-define("MAG_CURRENTMONTH", 3);
-define("MAG_CURRENTMONTHNAME", 4);
-define("MAG_CURRENTDAY", 5);
-define("MAG_CURRENTDAYNAME", 6);
-define("MAG_CURRENTYEAR", 7);
-define("MAG_CURRENTTIME", 8);
-define("MAG_NUMBEROFARTICLES", 9);
-define("MAG_CURRENTMONTHNAMEGEN", 10);
-define("MAG_MSG", 11);
-define("MAG_SUBST", 12);
-define("MAG_MSGNW", 13);
-define("MAG_NOEDITSECTION", 14);
-define("MAG_END", 15);
-define("MAG_IMG_THUMBNAIL",  16);
-define("MAG_IMG_RIGHT",      17);
-define("MAG_IMG_LEFT",       18);
-define("MAG_IMG_NONE",       19);
-define("MAG_IMG_WIDTH",      20);
-define("MAG_IMG_CENTER",      21);
-define("MAG_INT", 22);
-define("MAG_FORCETOC", 23);
-define("MAG_SITENAME", 24);
-define("MAG_NS", 25);
-define("MAG_LOCALURL", 26);
-define("MAG_LOCALURLE", 27);
-define("MAG_SERVER", 28);
-
-$wgVariableIDs = array(
-       MAG_CURRENTMONTH,
-       MAG_CURRENTMONTHNAME,
-       MAG_CURRENTDAY,
-       MAG_CURRENTDAYNAME,
-       MAG_CURRENTYEAR,
-       MAG_CURRENTTIME,
-       MAG_NUMBEROFARTICLES,
-       MAG_CURRENTMONTHNAMEGEN,
-    MAG_SITENAME,
-       MAG_SERVER
-);
-
-
-
 #--------------------------------------------------------------------------
 # Language-specific text
 #--------------------------------------------------------------------------
@@ -768,7 +718,7 @@ Please log in again after you receive it.",
 "blockedtitle" => "User is blocked",
 "blockedtext"  => "Your user name or IP address has been blocked by $1.
 The reason given is this:<br />''$2''<p>You may contact $1 or one of the other
-[[{{ns4}}:Administrators|administrators]] to discuss the block.
+[[{{ns:4}}:Administrators|administrators]] to discuss the block.
 
 Note that you may not use the \"email this user\" feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]].
 
@@ -1011,7 +961,7 @@ to first check if such a file exists.
 <p>To view or search previously uploaded images,
 go to the <a href=\"{{localurle:Special:Imagelist}}\">list of uploaded images</a>.
 Uploads and deletions are logged on the " .
-"<a href=\"{{localurle:Wikipedia:Upload_log}}\">upload log</a>.
+"<a href=\"{{localurle:MetaNamespace:Upload_log}}\">upload log</a>.
 <p>Use the form below to upload new image files for use in
 illustrating your articles.
 On most browsers, you will see a \"Browse...\" button, which will
@@ -1026,8 +976,8 @@ This may take some time if you have a slow internet connection.
 for drawings and other iconic images, and OGG for sounds.
 Please name your files descriptively to avoid confusion.
 To include the image in an article, use a link in the form
-<b>[[image:file.jpg]]</b> or <b>[[image:file.png|alt text]]</b>
-or <b>[[media:file.ogg]]</b> for sounds.
+<b>[[{{ns:6}}:file.jpg]]</b> or <b>[[{{ns:6}}:file.png|alt text]]</b>
+or <b>[[{{ns:-2}}:file.ogg]]</b> for sounds.
 <p>Please note that as with wiki pages, others may edit or
 delete your uploads if they think it serves the encyclopedia, and
 you may be blocked from uploading if you abuse the system.",