* (bug 1662) Implemented a new magic word, {{CURRENTMONTHABBREV}} which returns
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Thu, 24 Mar 2005 03:00:06 +0000 (03:00 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Thu, 24 Mar 2005 03:00:06 +0000 (03:00 +0000)
  the abbreviation of the current month, cleaned up the sourcecode while I was
  at it to always display CURRENTMONTH, CURRENTMONTHNAME, CURRENTMONTHNAMEGEN
  and CURRENTMONTHABBREV in that order that's mnemonics for you.

includes/MagicWord.php
includes/Parser.php
languages/Language.php

index 143666a..bb4cf49 100644 (file)
@@ -15,50 +15,52 @@ 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);
-define('MAG_IMG_FRAMED', 29);
-define('MAG_PAGENAME', 30);
-define('MAG_PAGENAMEE', 31);
-define('MAG_NAMESPACE', 32);
-define('MAG_TOC', 33);
-define('MAG_GRAMMAR', 34);
-define('MAG_NOTITLECONVERT', 35);
-define('MAG_NOCONTENTCONVERT', 36);
-define('MAG_CURRENTWEEK', 37);
-define('MAG_CURRENTDOW', 38);
+define('MAG_CURRENTMONTHNAMEGEN', 5);
+define('MAG_CURRENTMONTHABBREV', 6);
+define('MAG_CURRENTDAY', 7);
+define('MAG_CURRENTDAYNAME', 8);
+define('MAG_CURRENTYEAR', 9);
+define('MAG_CURRENTTIME', 10);
+define('MAG_NUMBEROFARTICLES', 11);
+define('MAG_MSG', 12);
+define('MAG_SUBST', 13);
+define('MAG_MSGNW', 14);
+define('MAG_NOEDITSECTION', 15);
+define('MAG_END', 16);
+define('MAG_IMG_THUMBNAIL',  17);
+define('MAG_IMG_RIGHT',      18);
+define('MAG_IMG_LEFT',       19);
+define('MAG_IMG_NONE',       20);
+define('MAG_IMG_WIDTH',      21);
+define('MAG_IMG_CENTER',      22);
+define('MAG_INT', 23);
+define('MAG_FORCETOC', 24);
+define('MAG_SITENAME', 25);
+define('MAG_NS', 26);
+define('MAG_LOCALURL', 27);
+define('MAG_LOCALURLE', 28);
+define('MAG_SERVER', 29);
+define('MAG_IMG_FRAMED', 30);
+define('MAG_PAGENAME', 31);
+define('MAG_PAGENAMEE', 32);
+define('MAG_NAMESPACE', 33);
+define('MAG_TOC', 34);
+define('MAG_GRAMMAR', 35);
+define('MAG_NOTITLECONVERT', 36);
+define('MAG_NOCONTENTCONVERT', 37);
+define('MAG_CURRENTWEEK', 38);
+define('MAG_CURRENTDOW', 39);
 
 $wgVariableIDs = array(
        MAG_CURRENTMONTH,
        MAG_CURRENTMONTHNAME,
+       MAG_CURRENTMONTHNAMEGEN,
+       MAG_CURRENTMONTHABBREV,
        MAG_CURRENTDAY,
        MAG_CURRENTDAYNAME,
        MAG_CURRENTYEAR,
        MAG_CURRENTTIME,
        MAG_NUMBEROFARTICLES,
-       MAG_CURRENTMONTHNAMEGEN,
        MAG_SITENAME,
        MAG_SERVER,
        MAG_PAGENAME,
index 596d20b..91c97a8 100644 (file)
@@ -1712,6 +1712,8 @@ class Parser
                                return $varCache[$index] = $wgContLang->getMonthName( date('n') );
                        case MAG_CURRENTMONTHNAMEGEN:
                                return $varCache[$index] = $wgContLang->getMonthNameGen( date('n') );
+                       case MAG_CURRENTMONTHABBREV:
+                               return $varCache[$index] = $wgContLang->getMonthAbbreviation( date('n') );
                        case MAG_CURRENTDAY:
                                return $varCache[$index] = $wgContLang->formatNum( date('j') );
                        case MAG_PAGENAME:
index c7c37f2..400611d 100644 (file)
@@ -209,12 +209,13 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_START                => array( 0,    '__START__'              ),
        MAG_CURRENTMONTH         => array( 1,    'CURRENTMONTH'           ),
        MAG_CURRENTMONTHNAME     => array( 1,    'CURRENTMONTHNAME'       ),
+       MAG_CURRENTMONTHNAMEGEN  => array( 1,    'CURRENTMONTHNAMEGEN'    ),
+       MAG_CURRENTMONTHABBREV   => array( 1,    'CURRENTMONTHABBREV'     ),
        MAG_CURRENTDAY           => array( 1,    'CURRENTDAY'             ),
        MAG_CURRENTDAYNAME       => array( 1,    'CURRENTDAYNAME'         ),
        MAG_CURRENTYEAR          => array( 1,    'CURRENTYEAR'            ),
        MAG_CURRENTTIME          => array( 1,    'CURRENTTIME'            ),
        MAG_NUMBEROFARTICLES     => array( 1,    'NUMBEROFARTICLES'       ),
-       MAG_CURRENTMONTHNAMEGEN  => array( 1,    'CURRENTMONTHNAMEGEN'    ),
        MAG_PAGENAME             => array( 1,    'PAGENAME'               ),
        MAG_PAGENAMEE            => array( 1,    'PAGENAMEE'              ),
        MAG_NAMESPACE            => array( 1,    'NAMESPACE'              ),