r44930 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44929‎ | r44930 | r44931 >
Date:13:13, 23 December 2008
Author:siebrand
Status:deferred
Tags:
Comment:
* add wfLoadExtensionMessages() to make i18n work
* bump version to RC2
* processed by stylize.php
Modified paths:
  • /trunk/extensions/Piwik/Piwik.php (modified) (history)
  • /trunk/extensions/Piwik/Piwik_specialpage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Piwik/Piwik_specialpage.php
@@ -10,16 +10,21 @@
1111
1212 function execute( $par ) {
1313 global $wgRequest, $wgOut, $wgPiwikURL, $wgScriptPath, $wgPiwikIDSite;
 14+
 15+ wfLoadExtensionMessages( 'Piwik' );
 16+
1417 $this->setHeaders();
15 - $wgOut->setPagetitle('Piwik');
 18+
 19+ $wgOut->setPagetitle( 'Piwik' );
 20+
1621 $selfTitle = $this->getTitle();
17 - $badCharsInURL = array(":", "/");
18 - $goodCharsInURL = array("%3A", "%2F");
19 - $specialcharsURL = str_replace($badCharsInURL, $goodCharsInURL, $wgPiwikURL);
 22+ $badCharsInURL = array( ":", "/" );
 23+ $goodCharsInURL = array( "%3A", "%2F" );
 24+ $specialcharsURL = str_replace( $badCharsInURL, $goodCharsInURL, $wgPiwikURL );
2025
21 - $lastvisits = wfMsg('piwik-lastvisits');
22 - $countries = wfMsg('piwik-countries');
23 - $browsers = wfMsg('piwik-browsers');
 26+ $lastvisits = wfMsg( 'piwik-lastvisits' );
 27+ $countries = wfMsg( 'piwik-countries' );
 28+ $browsers = wfMsg( 'piwik-browsers' );
2429
2530 // checking
2631 $piwikpage = <<<PIWIK
@@ -32,6 +37,6 @@
3338
3439 PIWIK;
3540
36 - $wgOut->addHTML($piwikpage);
 41+ $wgOut->addHTML( $piwikpage );
3742 }
3843 }
Index: trunk/extensions/Piwik/Piwik.php
@@ -14,7 +14,7 @@
1515
1616 $wgExtensionCredits['specialpage'][] = array(
1717 'name' => 'Piwik Integration',
18 - 'version' => '0.2.5rev0.7.5 (1.0-RC1)',
 18+ 'version' => '0.2.5rev0.7.5 (1.0-RC2)',
1919 'svn-date' => '$LastChangedDate$',
2020 'svn-revision' => '$LastChangedRevision$',
2121 'author' => 'Isb1009',
@@ -33,17 +33,17 @@
3434 $wgPiwikUsePageTitle = false;
3535 $wgPiwikActionName = "";
3636
37 -function efPiwikHookText(&$skin, &$text='') {
 37+function efPiwikHookText( &$skin, &$text = '' ) {
3838 $text .= efAddPiwik();
3939 return true;
4040 }
4141
4242 function efAddPiwik() {
4343 global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName, $wgTitle, $wgPiwikUsePageTitle;
44 - if (!$wgUser->isAllowed('bot') || !$wgPiwikIgnoreBots) {
45 - if (!$wgUser->isAllowed('protect') || !$wgPiwikIgnoreSysops) {
46 - if ( !empty($wgPiwikIDSite) AND !empty($wgPiwikURL)) {
47 -if ($wgPiwikUsePageTitle == true ) {
 44+ if ( !$wgUser->isAllowed( 'bot' ) || !$wgPiwikIgnoreBots ) {
 45+ if ( !$wgUser->isAllowed( 'protect' ) || !$wgPiwikIgnoreSysops ) {
 46+ if ( !empty( $wgPiwikIDSite ) AND !empty( $wgPiwikURL ) ) {
 47+if ( $wgPiwikUsePageTitle == true ) {
4848 $wgPiwikPageTitle = $wgTitle->getPrefixedText();
4949
5050 $wgPiwikFinalActionName = $wgPiwikActionName;
@@ -80,11 +80,11 @@
8181
8282 return $funcOutput;
8383 }
84 -$dir = dirname(__FILE__) . '/';
 84+$dir = dirname( __FILE__ ) . '/';
8585 $wgAutoloadClasses['Piwik'] = $dir . 'Piwik_specialpage.php'; # Tell MediaWiki to load the extension body.
8686 $wgExtensionMessagesFiles['Piwik'] = $dir . 'Piwik.i18n.php';
8787 $wgExtensionAliasesFiles['Piwik'] = $dir . 'Piwik.alias.php';
8888 $wgSpecialPages['Piwik'] = 'Piwik'; # Let MediaWiki know about your new special page.
8989
90 -///Alias for efAddPiwik - backwards compatibility.
 90+// /Alias for efAddPiwik - backwards compatibility.
9191 function addPiwik() { return efAddPiwik(); }

Status & tagging log