r109515 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109514‎ | r109515 | r109516 >
Date:10:41, 19 January 2012
Author:siebrand
Status:deferred
Tags:languagegetmagic 
Comment:
Follow-up r109402: remove use of $wgLiveletsMagic and just use the string per CR.
Update message documentation.
Modified paths:
  • /trunk/extensions/Livelets/Livelets.i18n.php (modified) (history)
  • /trunk/extensions/Livelets/Livelets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Livelets/Livelets.i18n.php
@@ -20,11 +20,7 @@
2121 * @author Raymond
2222 */
2323 $messages['qqq'] = array(
24 - 'livelets-desc' => "{{desc}}
25 -
26 -Further description on http://www.mediawiki.org/wiki/Extension:Livelets
27 -
28 -According to that page, the functionality of this extension is not limited to the Main Page but can be used in all pages. ''Therefore, the phrase \"the main page content\" '''should be translated as \"the main content of the page\",''' not as \"the content of the main page\".''",
 24+ 'livelets-desc' => "{{desc}} Further description on https://www.mediawiki.org/wiki/Extension:Livelets. According to that page, the functionality of this extension is not limited to the Main Page but can be used in all pages. ''Therefore, the phrase \"the main page content\" '''should be translated as \"the main content of the page\",''' not as \"the content of the main page\".''",
2925 );
3026
3127 /** Asturian (Asturianu)
Index: trunk/extensions/Livelets/Livelets.php
@@ -14,11 +14,8 @@
1515 die( 'This is not a valid entry point to MediaWiki.' );
1616 }
1717
18 -define( 'LIVELETS_VERSION', '1.1.0, 2012-01-18' );
 18+define( 'LIVELETS_VERSION', '1.1.0, 2012-01-19' );
1919
20 -# the parser-function name for doing live-transclusions
21 -$wgLiveletsMagic = 'live';
22 -
2320 # Settings for the event-driven live method
2421 $wgLiveletsUseSWF = false; # Set this to true to use SWF to make livelets fully event-driven (no polling for change)
2522 $wgLiveletsSwfBg = '#ffffff'; # The background colour of the embedded SWF
@@ -32,6 +29,7 @@
3330 'url' => 'https://www.mediawiki.org/wiki/Extension:Livelets',
3431 'version' => LIVELETS_VERSION
3532 );
 33+
3634 $dir = dirname( __FILE__ );
3735 $wgExtensionMessagesFiles['Livelets'] = "$dir/Livelets.i18n.php";
3836 $wgExtensionMessagesFiles['LiveletsMagic'] = "$dir/Livelets.i18n.magic.php";
@@ -65,10 +63,10 @@
6664
6765 # Called at extension setup time
6866 function setup() {
69 - global $wgOut, $wgParser, $wgLiveletsMagic, $wgLiveletsUseSwf;
 67+ global $wgOut, $wgParser, $wgLiveletsUseSwf;
7068
7169 # Activate the parser-function
72 - $wgParser->setFunctionHook( $wgLiveletsMagic, array( $this, 'renderContainer' ) );
 70+ $wgParser->setFunctionHook( 'live', array( $this, 'renderContainer' ) );
7371
7472 # Embed the SWF if enabled (SWF must be requested from Livelets.pl)
7573 if ( $wgLiveletsUseSwf ) {
@@ -100,12 +98,10 @@
10199
102100 # This early hook called from the Ajax bypass whereby the parser has yet to process wikitext
103101 function onArticleAfterFetchContent( &$article, &$content ) {
104 - global $wgLiveletsMagic;
105 -
106102 # Replace the wikitext with just the content of the requested livelet
107103 foreach( $this->examineBraces( $content ) as $brace ) {
108 - if ( $brace['NAME'] == "#$wgLiveletsMagic:" && --$this->request_id < 0 ) {
109 - $len = strlen( $wgLiveletsMagic );
 104+ if ( $brace['NAME'] == "#live:" && --$this->request_id < 0 ) {
 105+ $len = strlen( 'live' );
110106 $content = substr( $content, $brace['OFFSET'] + $len + 4, $brace['LENGTH'] - $len - 6 );
111107 break;
112108 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109402Remove use of deprecated LanguageGetMagic hook....siebrand17:12, 18 January 2012

Status & tagging log