r108997 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108996‎ | r108997 | r108998 >
Date:20:07, 15 January 2012
Author:siebrand
Status:deferred (Comments)
Tags:languagegetmagic 
Comment:
Remove use of deprecated LanguageGetMagic hook.
Add FIXME for FlaggedRevs, because it loads the i18n resources in a weird way.
Some misc. whitespace updates.
Modified paths:
  • /trunk/extensions/CSS/CSS.i18n.magic.php (added) (history)
  • /trunk/extensions/CSS/CSS.php (modified) (history)
  • /trunk/extensions/ContributionScores/ContributionScores.i18n.magic.php (added) (history)
  • /trunk/extensions/ContributionScores/ContributionScores.php (modified) (history)
  • /trunk/extensions/DPLforum/DPLforum.i18n.magic.php (added) (history)
  • /trunk/extensions/DPLforum/DPLforum.php (modified) (history)
  • /trunk/extensions/DateDiff/DateDiff.i18n.magic.php (added) (history)
  • /trunk/extensions/DateDiff/DateDiff.php (modified) (history)
  • /trunk/extensions/DynamicPageList/DPLSetup.php (modified) (history)
  • /trunk/extensions/DynamicPageList/DynamicPageList.i18n.magic.php (added) (history)
  • /trunk/extensions/DynamicPageList/DynamicPageList.php (modified) (history)
  • /trunk/extensions/DynamicPageList/DynamicPageListMigration.php (modified) (history)
  • /trunk/extensions/EmbedVideo/EmbedVideo.hooks.php (modified) (history)
  • /trunk/extensions/EmbedVideo/EmbedVideo.i18n.magic.php (added) (history)
  • /trunk/extensions/EmbedVideo/EmbedVideo.php (modified) (history)
  • /trunk/extensions/ExtTab/includes/ET_Initialize.php (modified) (history)
  • /trunk/extensions/ExtTab/includes/ET_ParserFunctions.php (modified) (history)
  • /trunk/extensions/ExtTab/languages/ExtTab.i18n.magic.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.body.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.magic.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.php (modified) (history)
  • /trunk/extensions/FileInfo/FileInfo.i18n.magic.php (added) (history)
  • /trunk/extensions/FileInfo/FileInfo.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php (modified) (history)
  • /trunk/extensions/FormatNum/FormatNum.i18n.magic.php (added) (history)
  • /trunk/extensions/FormatNum/FormatNum.php (modified) (history)
  • /trunk/extensions/GeeQuBox/GeeQuBox.i18n.magic.php (added) (history)
  • /trunk/extensions/GeeQuBox/GeeQuBox.php (modified) (history)
  • /trunk/extensions/Hanp/Hanp.i18n.magic.php (added) (history)
  • /trunk/extensions/Hanp/Hanp.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FormatNum/FormatNum.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'formatnum' => array( 0, 'formatnum' ),
 12+);
Property changes on: trunk/extensions/FormatNum/FormatNum.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/FormatNum/FormatNum.php
@@ -17,17 +17,16 @@
1818 'url'=>'http://www.mediawiki.org/wiki/Extension:FormatNum',
1919 'descriptionmsg' => 'formatnum-desc',
2020 'author'=>'[http://www.dasch-tour.de DaSch]',
21 - 'version'=>'0.2.0',
 21+ 'version'=>'0.3.0',
2222 );
2323 $dir = dirname( __FILE__ ) . '/';
2424
2525 // Internationalization
2626 $wgExtensionMessagesFiles['FormatNum'] = $dir . 'FormatNum.i18n.php';
 27+$wgExtensionMessagesFiles['FormatNumMagic'] = $dir . 'FormatNum.i18n.magic.php';
2728
2829 # Define a setup function
2930 $wgHooks['ParserFirstCallInit'][] = 'efFormatNumParserFunction_Setup';
30 -# Add a hook to initialise the magic word
31 -$wgHooks['LanguageGetMagic'][] = 'efFormatNumParserFunction_Magic';
3231
3332 function efFormatNumParserFunction_Setup( $parser ) {
3433 # Set a function hook associating the "example" magic word with our function
@@ -35,15 +34,6 @@
3635 return true;
3736 }
3837
39 -function efFormatNumParserFunction_Magic( &$magicWords, $langCode ) {
40 - # Add the magic word
41 - # The first array element is case sensitive, in this case it is not case sensitive
42 - # All remaining elements are synonyms for our parser function
43 - $magicWords['formatnum'] = array( 0, 'formatnum' );
44 - # unless we return true, other parser functions extensions won't get loaded.
45 - return true;
46 -}
47 -
4838 function efFormatNumParserFunction_Render( $parser, $param1 = 0, $param2 = 0, $param3 = '.', $param4 = ',' ) {
4939 # The parser function itself
5040 # The input parameters are wikitext with templates expanded
@@ -61,4 +51,4 @@
6252 break;
6353 }
6454 return $output;
65 -}
\ No newline at end of file
 55+}
Index: trunk/extensions/FileInfo/FileInfo.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'filesize' => array( 0, 'filesize' ),
 12+);
Property changes on: trunk/extensions/FileInfo/FileInfo.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/FileInfo/FileInfo.php
@@ -6,26 +6,18 @@
77
88 // @todo add other file metadata types via {{#fileinfo:...}}
99
 10+$dir = dirname(__FILE__) . '/';
 11+$wgExtensionMessagesFiles['FileInfoMagic'] = $dir . 'FileInfo.i18n.magic.php';
 12+
1013 # Define a setup function
1114 $wgExtensionFunctions[] = 'efFilesizeParserFunction_Setup';
12 -# Add a hook to initialise the magic word
13 -$wgHooks['LanguageGetMagic'][] = 'efFilesizeParserFunction_Magic';
14 -
 15+
1516 function efFilesizeParserFunction_Setup() {
1617 global $wgParser;
1718 # Set a function hook associating the "filesize" magic word with our function
1819 $wgParser->setFunctionHook( 'filesize', 'efFilesizeParserFunction_Render' );
1920 }
20 -
21 -function efFilesizeParserFunction_Magic( &$magicWords, $langCode ) {
22 - # Add the magic word
23 - # The first array element is case sensitive, in this case it is not case sensitive
24 - # All remaining elements are synonyms for our parser function
25 - $magicWords['filesize'] = array( 0, 'filesize' );
26 - # unless we return true, other parser functions extensions won't get loaded.
27 - return true;
28 -}
29 -
 21+
3022 function efFilesizeParserFunction_Render( &$parser, $filename = '' ) {
3123 # The parser function itself
3224 # The input parameters are wikitext with templates expanded
Index: trunk/extensions/DynamicPageList/DynamicPageList.php
@@ -60,11 +60,10 @@
6161
6262 $wgHooks['ParserFirstCallInit'][] = 'ExtDynamicPageList::setupDPL';
6363
64 -$wgHooks['LanguageGetMagic'][] = 'ExtDynamicPageList__languageGetMagic';
65 -
6664 $wgExtensionMessagesFiles['DynamicPageList'] = dirname( __FILE__ ) . '/DynamicPageList.i18n.php';
 65+$wgExtensionMessagesFiles['DynamicPageListMagic'] = dirname( __FILE__ ) . '/DynamicPageList.i18n.magic.php';
6766
68 -$DPLVersion = '1.8.9';
 67+$DPLVersion = '1.9.0';
6968
7069 $wgExtensionCredits['parserhook'][] = array(
7170 'path' => __FILE__,
Index: trunk/extensions/DynamicPageList/DPLSetup.php
@@ -401,10 +401,6 @@
402402 * when making changes here you must update the version field in DynamicPageList.php and DynamicPageListMigration.php !
403403 */
404404
405 -// changed back to global functions due to trouble with older MW installations, g.s.
406 -function ExtDynamicPageList__languageGetMagic( &$magicWords, $langCode ) {
407 - return ExtDynamicPageList::languageGetMagic( $magicWords, $langCode );
408 -}
409405 function ExtDynamicPageList__endReset( &$parser, $text ) {
410406 return ExtDynamicPageList::endReset( $parser, $text );
411407 }
@@ -1256,19 +1252,6 @@
12571253 self::$modulesLoaded = true;
12581254 }
12591255
1260 - public static function languageGetMagic( &$magicWords, $langCode ) {
1261 - # Add the magic word
1262 - # The first array element is case sensitivity, in this case it is not case sensitive
1263 - # All remaining elements are synonyms for our parser function
1264 - $magicWords['dpl'] = array( 0, 'dpl' );
1265 - $magicWords['dplnum'] = array( 0, 'dplnum' );
1266 - $magicWords['dplchapter'] = array( 0, 'dplchapter' );
1267 - $magicWords['dplmatrix'] = array( 0, 'dplmatrix' );
1268 - $magicWords['DynamicPageList'] = array( 0, 'DynamicPageList' );
1269 - # unless we return true, other parser functions extensions won't get loaded.
1270 - return true;
1271 - }
1272 -
12731256 // ------------------------------------------------------------------------------------- ENTRY parser TAG intersection
12741257 public static function intersectionTag( $input, $params, $parser ) {
12751258 self::behaveLikeIntersection( true );
Index: trunk/extensions/DynamicPageList/DynamicPageListMigration.php
@@ -41,9 +41,9 @@
4242
4343 $wgHooks['ParserFirstCallIntit'][] = 'ExtDynamicPageList::setupMigration';
4444
45 -$wgHooks['LanguageGetMagic'][] = 'ExtDynamicPageList__languageGetMagic';
 45+$wgExtensionMessagesFiles['DynamicPageListMagic'] = dirname( __FILE__ ) . '/DynamicPageList.i18n.magic.php';
4646
47 -$DPLVersion = '1.8.9';
 47+$DPLVersion = '1.9.0';
4848
4949 $wgExtensionCredits['parserhook'][] = array(
5050 'path' => __FILE__,
Index: trunk/extensions/DynamicPageList/DynamicPageList.i18n.magic.php
@@ -0,0 +1,15 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'dpl' => array( 0, 'dpl' ),
 12+ 'dplnum' => array( 0, 'dplnum' ),
 13+ 'dplchapter' => array( 0, 'dplchapter' ),
 14+ 'dplmatrix' => array( 0, 'dplmatrix' ),
 15+ 'DynamicPageList' => array( 0, 'DynamicPageList' ),
 16+);
Property changes on: trunk/extensions/DynamicPageList/DynamicPageList.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
117 + native
Added: svn:keywords
218 + Id
Index: trunk/extensions/FCKeditor/FCKeditor.body.php
@@ -75,12 +75,6 @@
7676 return $this->excludedNamespaces;
7777 }
7878
79 - public static function onLanguageGetMagic( &$magicWords, $langCode ) {
80 - $magicWords['NORICHEDITOR'] = array( 0, '__NORICHEDITOR__' );
81 -
82 - return true;
83 - }
84 -
8579 public static function onParserBeforeInternalParse( &$parser, &$text, &$strip_state ) {
8680 MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );
8781
@@ -706,5 +700,4 @@
707701
708702 return true;
709703 }
710 -
711704 }
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'NORICHEDITOR' => array( 0, '__NORICHEDITOR__' ),
 12+);
Property changes on: trunk/extensions/FCKeditor/FCKeditor.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/FCKeditor/FCKeditor.php
@@ -86,6 +86,7 @@
8787
8888 // Path to internationalization file
8989 $wgExtensionMessagesFiles['FCKeditor'] = $dir . 'FCKeditor.i18n.php';
 90+$wgExtensionMessagesFiles['FCKeditorMagic'] = $dir . 'FCKeditor.i18n.magic.php';
9091
9192 // Initialize FCKeditor and the MediaWiki extension
9293 // @fixme something like this should be delayed until it's actually time
@@ -107,7 +108,6 @@
108109 $wgHooks['EditPageBeforePreviewText'][] = array( $oFCKeditorExtension, 'onEditPageBeforePreviewText' );
109110 $wgHooks['EditPagePreviewTextEnd'][] = array( $oFCKeditorExtension, 'onEditPagePreviewTextEnd' );
110111 $wgHooks['CustomEditor'][] = array( $oFCKeditorExtension, 'onCustomEditor' );
111 -$wgHooks['LanguageGetMagic'][] = 'FCKeditor_MediaWiki::onLanguageGetMagic';
112112 $wgHooks['ParserBeforeStrip'][] = 'FCKeditor_MediaWiki::onParserBeforeStrip';
113113 $wgHooks['ParserBeforeInternalParse'][] = 'FCKeditor_MediaWiki::onParserBeforeInternalParse';
114114 $wgHooks['EditPageBeforeConflictDiff'][] = 'FCKeditor_MediaWiki::onEditPageBeforeConflictDiff';
Index: trunk/extensions/DPLforum/DPLforum.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'forumlink' => array( 0, 'forumlink' ),
 12+);
Property changes on: trunk/extensions/DPLforum/DPLforum.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/DPLforum/DPLforum.php
@@ -40,7 +40,7 @@
4141 'path' => __FILE__,
4242 'name' => 'DPLforum',
4343 'author' => 'Ross McClure',
44 - 'version' => '3.3.3',
 44+ 'version' => '3.4.0',
4545 'url' => 'https://www.mediawiki.org/wiki/Extension:DPLforum',
4646 'descriptionmsg' => 'dplforum-desc',
4747 );
@@ -51,12 +51,12 @@
5252
5353 // Hooked functions
5454 $wgHooks['ParserFirstCallInit'][] = 'wfDPLinit';
55 -$wgHooks['LanguageGetMagic'][] = 'wfDPLmagic';
5655 $wgHooks['CanonicalNamespaces'][] = 'wfDPLforumCanonicalNamespaces';
5756
5857 // Set up i18n and autoload the main class
5958 $dir = dirname( __FILE__ ) . '/';
6059 $wgExtensionMessagesFiles['DPLforum'] = $dir . 'DPLforum.i18n.php';
 60+$wgExtensionMessagesFiles['DPLforumMagic'] = $dir . 'DPLforum.i18n.magic.php';
6161 $wgExtensionMessagesFiles['DPLforumNamespaces'] = $dir . 'DPLforum.namespaces.php';
6262 $wgAutoloadClasses['DPLForum'] = $dir . 'DPLforum_body.php';
6363
@@ -66,14 +66,6 @@
6767 return true;
6868 }
6969
70 -function wfDPLmagic( &$magicWords, $langCode = 'en' ) {
71 - switch( $langCode ) {
72 - default:
73 - $magicWords['forumlink'] = array( 0, 'forumlink' );
74 - }
75 - return true;
76 -}
77 -
7870 function parseForum( $input, $argv, $parser ) {
7971 $f = new DPLForum();
8072 return $f->parse( $input, $parser );
@@ -90,4 +82,4 @@
9183 $list[NS_FORUM] = 'Forum';
9284 $list[NS_FORUM_TALK] = 'Forum_talk';
9385 return true;
94 -}
\ No newline at end of file
 86+}
Index: trunk/extensions/EmbedVideo/EmbedVideo.hooks.php
@@ -15,32 +15,18 @@
1616 public static function setup( $parser ) {
1717 # Setup parser hooks. ev is the primary hook, evp is supported for
1818 # legacy purposes
19 - global $wgVersion;
20 - $prefix = version_compare($wgVersion, '1.7', '<') ? '#' : '';
21 - EmbedVideo::addMagicWord($prefix, "ev", "EmbedVideo::parserFunction_ev");
22 - EmbedVideo::addMagicWord($prefix, "evp", "EmbedVideo::parserFunction_evp");
 19+ EmbedVideo::addMagicWord("ev", "EmbedVideo::parserFunction_ev");
 20+ EmbedVideo::addMagicWord("evp", "EmbedVideo::parserFunction_evp");
2321
2422 return true;
2523 }
2624
27 - private static function addMagicWord($prefix, $word, $function) {
 25+ private static function addMagicWord($word, $function) {
2826 global $wgParser;
29 - $wgParser->setFunctionHook($prefix . $word, $function);
 27+ $wgParser->setFunctionHook($word, $function);
3028 }
3129
3230 /**
33 - * Adds magic words for parser functions.
34 - * @param Array $magicWords
35 - * @param $langCode
36 - * @return Boolean Always true
37 - */
38 - public static function parserFunctionMagic(&$magicWords, $langCode='en') {
39 - $magicWords['evp'] = array(0, 'evp');
40 - $magicWords['ev'] = array(0, 'ev');
41 - return true;
42 - }
43 -
44 - /**
4531 * Embeds video of the chosen service, legacy support for 'evp' version of
4632 * the tag
4733 * @param Parser $parser Instance of running Parser.
Index: trunk/extensions/EmbedVideo/EmbedVideo.i18n.magic.php
@@ -0,0 +1,12 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'evp' => array( 0, 'evp' ),
 12+ 'ev' => array( 0, 'ev' ),
 13+);
Property changes on: trunk/extensions/EmbedVideo/EmbedVideo.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
114 + native
Added: svn:keywords
215 + Id
Index: trunk/extensions/EmbedVideo/EmbedVideo.php
@@ -24,23 +24,13 @@
2525 'author' => array( 'Jim R. Wilson', 'Andrew Whitworth' ),
2626 'url' => 'https://www.mediawiki.org/wiki/Extension:EmbedVideo',
2727 'descriptionmsg' => 'embedvideo-desc',
28 - 'version' => '1.0'
 28+ 'version' => '1.1'
2929 );
3030
3131 $dir = dirname(__FILE__) . '/';
32 -require_once($dir . "EmbedVideo.hooks.php");
 32+require_once($dir . "EmbedVideo.hooks.php"); // @todo FIXME: Use autoloader to load classes.
3333 require_once($dir . "EmbedVideo.Services.php");
34 -$wgExtensionMessagesFiles['embedvideo'] = $dir . 'EmbedVideo.i18n.php';
 34+$wgExtensionMessagesFiles['EmbedVideo'] = $dir . 'EmbedVideo.i18n.php';
 35+$wgExtensionMessagesFiles['EmbedVideoMagic'] = $dir . 'EmbedVideo.i18n.magic.php';
3536
36 -
3737 $wgHooks['ParserFirstCallInit'][] = "EmbedVideo::setup";
38 -if (version_compare($wgVersion, '1.7', '<')) {
39 - # Hack solution to resolve 1.6 array parameter nullification for hook args
40 - function wfEmbedVideoLanguageGetMagic( &$magicWords ) {
41 - EmbedVideo::parserFunctionMagic( $magicWords );
42 - return true;
43 - }
44 - $wgHooks['LanguageGetMagic'][] = 'wfEmbedVideoLanguageGetMagic';
45 -} else {
46 - $wgHooks['LanguageGetMagic'][] = 'EmbedVideo::parserFunctionMagic';
47 -}
Index: trunk/extensions/ExtTab/includes/ET_Initialize.php
@@ -14,11 +14,10 @@
1515
1616 global $wgExtensionFunctions, $wgHooks, $wgAutoloadClasses, $smwgExtTabEnableLocalEdit;
1717 $wgExtensionFunctions[] = 'smwgExtTabSetupExtension';
18 -$wgHooks['LanguageGetMagic'][] = 'ETParserFunctions::languageGetMagic';
1918
 19+$wgExtensionMessagesFiles['ExtTabMagic'] = $smwgExtTabIP . '/languages/ExtTab.i18n.magic.php';
2020 $wgAutoloadClasses['ETParserFunctions'] = $smwgExtTabIP . '/includes/ET_ParserFunctions.php';
2121
22 -
2322 function smwfExtTabInitMessages() {
2423 global $smwgExtTabMessagesInitialized;
2524 if ( isset( $smwgExtTabMessagesInitialized ) ) return; // prevent double init
@@ -111,9 +110,10 @@
112111 // Register Credits
113112 $wgExtensionCredits['parserhook'][] = array(
114113 'name' => 'Semantic&nbsp;ExtTab&nbsp;Extension', 'version' => SMW_EXTTAB_VERSION,
115 - 'author' => "Ning Hu, Justin Zhang, [http://smwforum.ontoprise.com/smwforum/index.php/Jesse_Wang Jesse Wang], sponsored by [http://projecthalo.com Project Halo], [http://www.vulcan.com Vulcan Inc.]",
116 - 'url' => 'http://wiking.vulcan.com/dev',
117 - 'description' => 'Tab control based on ExtJS.' );
 114+ 'author' => "Ning Hu, Justin Zhang, [http://smwforum.ontoprise.com/smwforum/index.php/Jesse_Wang Jesse Wang], sponsored by [http://projecthalo.com Project Halo], [http://www.vulcan.com Vulcan Inc.]",
 115+ 'url' => 'http://wiking.vulcan.com/dev',
 116+ 'description' => 'Tab control based on ExtJS.',
 117+ );
118118
119119 return true;
120120 }
Index: trunk/extensions/ExtTab/includes/ET_ParserFunctions.php
@@ -4,14 +4,6 @@
55 */
66
77 class ETParserFunctions {
8 - static function languageGetMagic( &$magicWords, $langCode = "en" ) {
9 - switch ( $langCode ) {
10 - default:
11 - $magicWords['tab'] = array ( 0, 'tab' );
12 - }
13 - return true;
14 - }
15 -
168 static function registerFunctions( &$parser ) {
179 $parser->setFunctionHook( 'tab', array( 'ETParserFunctions', 'renderTabWidget' ), SFH_OBJECT_ARGS );
1810 $parser->setHook( "embedwiki", array( 'ETParserFunctions', 'embedWiki' ) );
@@ -138,5 +130,4 @@
139131 $str .= '</div>';
140132 return array( $str, 'noparse' => true, 'isHTML' => false );
141133 }
142 -
143134 }
Index: trunk/extensions/ExtTab/languages/ExtTab.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'tab' => array( 0, 'tab' ),
 12+);
Property changes on: trunk/extensions/ExtTab/languages/ExtTab.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/CSS/CSS.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'css' => array( 0, 'css' ),
 12+);
Property changes on: trunk/extensions/CSS/CSS.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/CSS/CSS.php
@@ -16,17 +16,16 @@
1717 * @licence GNU General Public Licence 2.0 or later
1818 */
1919
20 -if ( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' );
 20+if ( !defined( 'MEDIAWIKI' ) ) {
 21+ die( 'Not an entry point.' );
 22+}
2123
22 -define( 'CSS_VERSION', '3.0, 2011-11-18' );
 24+define( 'CSS_VERSION', '3.1, 2012-01-15' );
2325
24 -$wgCSSMagic = 'css';
2526 $wgCSSPath = false;
2627 $wgCSSIdentifier = 'css-extension';
2728
2829 $wgHooks['ParserFirstCallInit'][] = 'wfCSSParserFirstCallInit';
29 -// FIXME: LanguageGetMagic is deprecated.
30 -$wgHooks['LanguageGetMagic'][] = 'wfCSSLanguageGetMagic';
3130 $wgHooks['RawPageViewBeforeOutput'][] = 'wfCSSRawPageViewBeforeOutput';
3231
3332 $wgExtensionCredits['parserhook'][] = array(
@@ -39,6 +38,7 @@
4039 );
4140
4241 $wgExtensionMessagesFiles['CSS'] = dirname( __FILE__ ) . '/' . 'CSS.i18n.php';
 42+$wgExtensionMessagesFiles['CSSMagic'] = dirname( __FILE__ ) . '/' . 'CSS.i18n.magic.php';
4343
4444 $wgResourceModules['ext.CSS'] = array(
4545 'scripts' => 'verifyCSSLoad.js',
@@ -110,19 +110,13 @@
111111 }
112112
113113 function wfCSSParserFirstCallInit( $parser ) {
114 - global $wgCSSMagic;
115 - $parser->setFunctionHook( $wgCSSMagic, 'wfCSSRender' );
 114+ $parser->setFunctionHook( 'css', 'wfCSSRender' );
116115 return true;
117116 }
118117
119 -function wfCSSLanguageGetMagic( &$magicWords, $langCode = 0 ) {
120 - global $wgCSSMagic;
121 - $magicWords[$wgCSSMagic] = array( $langCode, $wgCSSMagic );
122 - return true;
123 -}
124 -
125118 function wfCSSRawPageViewBeforeOutput( &$rawPage, &$text ) {
126119 global $wgCSSIdentifier;
 120+
127121 if ( $rawPage->getRequest()->getBool( $wgCSSIdentifier ) ) {
128122 $text = Sanitizer::checkCss( $text );
129123 }
Index: trunk/extensions/DateDiff/DateDiff.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'dates' => array( 0, 'dates' ),
 12+);
Property changes on: trunk/extensions/DateDiff/DateDiff.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/DateDiff/DateDiff.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 /**
54 * DateDiff extension.
65 *
@@ -15,9 +14,10 @@
1615 die( 'Not an entry point.' );
1716 }
1817
19 -define( 'Datediff_VERSION', '0.1.1' );
 18+define( 'Datediff_VERSION', '0.2.0' );
2019
2120 $wgExtensionMessagesFiles['DateDiff'] = dirname( __FILE__ ) . '/DateDiff.i18n.php';
 21+$wgExtensionMessagesFiles['DateDiffMagic'] = dirname( __FILE__ ) . '/DateDiff.i18n.magic.php';
2222
2323 // Extension credits that show up on Special:Version
2424 $wgExtensionCredits['parserhook'][] = array(
@@ -33,21 +33,12 @@
3434 );
3535
3636 $wgHooks['ParserFirstCallInit'][] = 'efDDDateDiff';
37 -$wgHooks['LanguageGetMagic'][] = 'efDDDatesFunctionMagic';
3837
3938 function efDDDateDiff( Parser &$parser ) {
4039 $parser->setFunctionHook( 'dates', 'efDDCalcDates' );
4140 return true;
4241 }
4342
44 -/**
45 - * Adds the magic words for the parser functions.
46 - */
47 -function efDDDatesFunctionMagic( &$magicWords, $langCode ) {
48 - $magicWords['dates'] = array( 0, 'dates' );
49 - return true;
50 -}
51 -
5243 function efDDCalcDates( &$parser ) {
5344 $params = func_get_args();
5445
@@ -80,4 +71,4 @@
8172 }
8273
8374 return implode( ',', $days );
84 -}
\ No newline at end of file
 75+}
Index: trunk/extensions/GeeQuBox/GeeQuBox.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'geequbox' => array( 0, 'geequbox' ),
 12+);
Property changes on: trunk/extensions/GeeQuBox/GeeQuBox.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/GeeQuBox/GeeQuBox.php
@@ -23,7 +23,7 @@
2424 $wgExtensionCredits['parserhook'][] = array(
2525 'path' => __FILE__,
2626 'name' => 'GeeQuBox',
27 - 'version' => '0.02.1',
 27+ 'version' => '0.03.0',
2828 'author' => array( '[http://www.mediawiki.org/wiki/User:Clausekwis David Raison]' ),
2929 'url' => 'https://www.mediawiki.org/wiki/Extension:GeeQuBox',
3030 'descriptionmsg' => 'geequbox-desc'
@@ -41,27 +41,22 @@
4242 'remoteExtPath' => EXTPATH
4343 );
4444
45 -
4645 // defaults
4746 $wgGqbDefaultWidth = 640;
4847
4948 $wgExtensionMessagesFiles['GeeQuBox'] = dirname(__FILE__) .'/GeeQuBox.i18n.php';
50 -$wgHooks['LanguageGetMagic'][] = 'wfGeeQuBoxLanguageGetMagic';
 49+$wgExtensionMessagesFiles['GeeQuBoxMagic'] = dirname(__FILE__) .'/GeeQuBox.i18n.magic.php';
5150
5251 $gqb = new GeeQuBox;
5352 $wgHooks['BeforeParserrenderImageGallery'][] = array($gqb,'gqbAnalyse');
5453 $wgHooks['BeforePageDisplay'][] = array($gqb,'gqbAddLightbox');
5554
56 -function wfGeeQuBoxLanguageGetMagic( &$magicWords, $langCode = 'en' ) {
57 - $magicWords['geequbox'] = array( 0, 'geequbox' );
58 - return true;
59 -}
 55+// @todo FIXME: Put this class in a separate file.
6056
6157 /**
6258 * Class that handles all GeeQuBox operations.
6359 */
6460 class GeeQuBox {
65 -
6661 private static $_page;
6762 private $_hasGallery;
6863
@@ -93,7 +88,6 @@
9489 } else return false;
9590 }
9691
97 -
9892 private function _gqbAddScripts() {
9993 global $wgExtensionAssetsPath;
10094
@@ -157,6 +151,4 @@
158152
159153 return 'href="'. $iPath .'" title="'. htmlspecialchars( $title ) .'" class="image"';
160154 }
161 -
162155 }
163 -
Index: trunk/extensions/ContributionScores/ContributionScores.php
@@ -15,7 +15,7 @@
1616 'url' => 'https://www.mediawiki.org/wiki/Extension:Contribution_Scores',
1717 'author' => 'Tim Laqua',
1818 'descriptionmsg' => 'contributionscores-desc',
19 - 'version' => '1.14'
 19+ 'version' => '1.15'
2020 );
2121
2222 $dir = dirname( __FILE__ ) . '/';
@@ -35,9 +35,8 @@
3636
3737 $wgExtensionMessagesFiles['ContributionScores'] = $dir . 'ContributionScores.i18n.php';
3838 $wgExtensionMessagesFiles['ContributionScoresAlias'] = $dir . 'ContributionScores.alias.php';
 39+$wgExtensionMessagesFiles['ContributionScoresMagic'] = $dir . 'ContributionScores.i18n.magic.php';
3940
40 -$wgHooks['LanguageGetMagic'][] = 'efContributionScores_LanguageGetMagic';
41 -
4241 $wgHooks['ParserFirstCallInit'][] = 'efContributionScores_Setup';
4342
4443 function efContributionScores_Setup( &$parser ) {
@@ -45,11 +44,6 @@
4645 return true;
4746 }
4847
49 -function efContributionScores_LanguageGetMagic( &$magicWords, $langCode ) {
50 - $magicWords['cscore'] = array( 0, 'cscore' );
51 - return true;
52 -}
53 -
5448 function efContributionScores_Render( &$parser, $usertext, $metric = 'score' ) {
5549 global $wgContribScoreDisableCache;
5650
Index: trunk/extensions/ContributionScores/ContributionScores.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'cscore' => array( 0, 'cscore' ),
 12+);
Property changes on: trunk/extensions/ContributionScores/ContributionScores.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/Hanp/Hanp.php
@@ -15,24 +15,19 @@
1616 $wgExtensionCredits['other'][] = array(
1717 'path' => __FILE__,
1818 'name' => 'Hangul particle chooser',
19 - 'version' => '2008-09-21',
 19+ 'version' => '2012-01-15',
2020 'author' => 'Niklas Laxström',
2121 'url' => 'https://bugzilla.wikimedia.org/show_bug.cgi?id=13712',
2222 'descriptionmsg' => 'hanp-desc',
2323 );
2424
2525 $dir = dirname( __FILE__ ) . '/';
26 -$wgExtensionMessagesFiles['hanp'] = $dir . 'Hanp.i18n.php';
 26+$wgExtensionMessagesFiles['Hanp'] = $dir . 'Hanp.i18n.php';
 27+$wgExtensionMessagesFiles['HanpMagic'] = $dir . 'Hanp.i18n.magic.php';
2728 $wgAutoloadClasses['Hanp'] = $dir . 'Hanp.body.php';
28 -$wgHooks['LanguageGetMagic'][] = 'efHanpLanguageGetMagic';
2929 $wgHooks['ParserFirstCallInit'][] = 'efHanpInit';
3030
3131 function efHanpInit( &$parser ) {
3232 $parser->setFunctionHook( 'hanp', array( 'Hanp', 'hangulParticle' ) );
3333 return true;
3434 }
35 -
36 -function efHanpLanguageGetMagic( &$magicWords, $langCode = 'en' ) {
37 - $magicWords['hanp'] = array( 0, 'hanp' );
38 - return true;
39 -}
Index: trunk/extensions/Hanp/Hanp.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'hanp' => array( 0, 'hanp' ),
 12+);
Property changes on: trunk/extensions/Hanp/Hanp.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php
@@ -246,6 +246,7 @@
247247 if ( $wgFlaggedRevsProtection ) {
248248 # Add pending changes related magic words
249249 $wgHooks['ParserFirstCallInit'][] = 'FlaggedRevsHooks::onParserFirstCallInit';
 250+ // @todo FIXME: Use $wgExtensionMessagesFiles instead of LanguageGetMagic hook.
250251 $wgHooks['LanguageGetMagic'][] = 'FlaggedRevsHooks::onLanguageGetMagic';
251252 $wgHooks['ParserGetVariableValueSwitch'][] = 'FlaggedRevsHooks::onParserGetVariableValueSwitch';
252253 $wgHooks['MagicWordwgVariableIDs'][] = 'FlaggedRevsHooks::onMagicWordwgVariableIDs';

Follow-up revisions

RevisionCommit summaryAuthorDate
r109571Merge branch 'magic'johnduhart21:21, 19 January 2012

Comments

#Comment by Reedy (talk | contribs)   15:20, 16 January 2012

bug 33757 logged as a TODO for Aaron so it doesn't just disappear into oblivion

Status & tagging log