r85551 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85550‎ | r85551 | r85552 >
Date:17:08, 6 April 2011
Author:ialex
Status:deferred
Tags:
Comment:
Use Skin::getTitle() instead of $wgTitle
Modified paths:
  • /trunk/extensions/Piwik/Piwik.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Piwik/Piwik.php
@@ -34,17 +34,17 @@
3535 $wgPiwikSpecialPageDate = 'yesterday';
3636
3737 function efPiwikHookText( $skin, &$text = '' ) {
38 - $text .= efAddPiwik();
 38+ $text .= efAddPiwik( $skin->getTitle() );
3939 return true;
4040 }
4141
42 -function efAddPiwik() {
43 - global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName, $wgTitle, $wgPiwikUsePageTitle;
 42+function efAddPiwik( $title ) {
 43+ global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName, $wgPiwikUsePageTitle;
4444 if ( !$wgUser->isAllowed( 'bot' ) || !$wgPiwikIgnoreBots ) {
4545 if ( !$wgUser->isAllowed( 'protect' ) || !$wgPiwikIgnoreSysops ) {
4646 if ( !empty( $wgPiwikIDSite ) AND !empty( $wgPiwikURL ) ) {
47 - if ( $wgPiwikUsePageTitle == true ) {
48 - $wgPiwikPageTitle = $wgTitle->getPrefixedText();
 47+ if ( $wgPiwikUsePageTitle ) {
 48+ $wgPiwikPageTitle = $title->getPrefixedText();
4949
5050 $wgPiwikFinalActionName = $wgPiwikActionName;
5151 $wgPiwikFinalActionName .= $wgPiwikPageTitle;
@@ -94,6 +94,3 @@
9595 $wgExtensionMessagesFiles['Piwik'] = $dir . 'Piwik.i18n.php';
9696 $wgExtensionAliasesFiles['Piwik'] = $dir . 'Piwik.alias.php';
9797 $wgSpecialPages['Piwik'] = 'Piwik'; # Let MediaWiki know about your new special page.
98 -
99 -// /Alias for efAddPiwik - backwards compatibility.
100 -function addPiwik() { return efAddPiwik(); }

Status & tagging log