Index: trunk/extensions/Piwik/Piwik_specialpage.php |
— | — | @@ -10,16 +10,21 @@ |
11 | 11 | |
12 | 12 | function execute( $par ) { |
13 | 13 | global $wgRequest, $wgOut, $wgPiwikURL, $wgScriptPath, $wgPiwikIDSite; |
| 14 | + |
| 15 | + wfLoadExtensionMessages( 'Piwik' ); |
| 16 | + |
14 | 17 | $this->setHeaders(); |
15 | | - $wgOut->setPagetitle('Piwik'); |
| 18 | + |
| 19 | + $wgOut->setPagetitle( 'Piwik' ); |
| 20 | + |
16 | 21 | $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 ); |
20 | 25 | |
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' ); |
24 | 29 | |
25 | 30 | // checking |
26 | 31 | $piwikpage = <<<PIWIK |
— | — | @@ -32,6 +37,6 @@ |
33 | 38 | |
34 | 39 | PIWIK; |
35 | 40 | |
36 | | - $wgOut->addHTML($piwikpage); |
| 41 | + $wgOut->addHTML( $piwikpage ); |
37 | 42 | } |
38 | 43 | } |
Index: trunk/extensions/Piwik/Piwik.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | |
16 | 16 | $wgExtensionCredits['specialpage'][] = array( |
17 | 17 | 'name' => 'Piwik Integration', |
18 | | - 'version' => '0.2.5rev0.7.5 (1.0-RC1)', |
| 18 | + 'version' => '0.2.5rev0.7.5 (1.0-RC2)', |
19 | 19 | 'svn-date' => '$LastChangedDate$', |
20 | 20 | 'svn-revision' => '$LastChangedRevision$', |
21 | 21 | 'author' => 'Isb1009', |
— | — | @@ -33,17 +33,17 @@ |
34 | 34 | $wgPiwikUsePageTitle = false; |
35 | 35 | $wgPiwikActionName = ""; |
36 | 36 | |
37 | | -function efPiwikHookText(&$skin, &$text='') { |
| 37 | +function efPiwikHookText( &$skin, &$text = '' ) { |
38 | 38 | $text .= efAddPiwik(); |
39 | 39 | return true; |
40 | 40 | } |
41 | 41 | |
42 | 42 | function efAddPiwik() { |
43 | 43 | 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 ) { |
48 | 48 | $wgPiwikPageTitle = $wgTitle->getPrefixedText(); |
49 | 49 | |
50 | 50 | $wgPiwikFinalActionName = $wgPiwikActionName; |
— | — | @@ -80,11 +80,11 @@ |
81 | 81 | |
82 | 82 | return $funcOutput; |
83 | 83 | } |
84 | | -$dir = dirname(__FILE__) . '/'; |
| 84 | +$dir = dirname( __FILE__ ) . '/'; |
85 | 85 | $wgAutoloadClasses['Piwik'] = $dir . 'Piwik_specialpage.php'; # Tell MediaWiki to load the extension body. |
86 | 86 | $wgExtensionMessagesFiles['Piwik'] = $dir . 'Piwik.i18n.php'; |
87 | 87 | $wgExtensionAliasesFiles['Piwik'] = $dir . 'Piwik.alias.php'; |
88 | 88 | $wgSpecialPages['Piwik'] = 'Piwik'; # Let MediaWiki know about your new special page. |
89 | 89 | |
90 | | -///Alias for efAddPiwik - backwards compatibility. |
| 90 | +// /Alias for efAddPiwik - backwards compatibility. |
91 | 91 | function addPiwik() { return efAddPiwik(); } |