r76668 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76667‎ | r76668 | r76669 >
Date:19:28, 14 November 2010
Author:raymond
Status:resolved (Comments)
Tags:
Comment:
Follow-up r76434, r76570: Add skinname per CR
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Modern.php
@@ -26,9 +26,9 @@
2727 * skin L&F.
2828 */
2929 function getPoweredBy() {
30 - global $wgVersion;
 30+ global $wgVersion, $wgUser;
3131 $text = "<div class='mw_poweredby'>Powered by MediaWiki $wgVersion</div>";
32 - wfRunHooks( 'SkinGetPoweredBy', array( &$text ) );
 32+ wfRunHooks( 'SkinGetPoweredBy', array( &$text, $wgUser->getSkin()->getSkinName() ) );
3333 return $text;
3434 }
3535
Index: trunk/phase3/docs/hooks.txt
@@ -1464,6 +1464,7 @@
14651465 'SkinGetPoweredBy'
14661466 &$text: additional 'powered by' icons in HTML.
14671467 Note: Modern skin does not use the MediaWiki icon but plain text instead
 1468+$skin: Name of the skin
14681469
14691470 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle()
14701471 &$subpages: Subpage links HTML
Index: trunk/phase3/includes/Skin.php
@@ -1547,13 +1547,11 @@
15481548 * @return string
15491549 */
15501550 function getPoweredBy() {
1551 - global $wgStylePath;
 1551+ global $wgStylePath, $wgUser;
15521552
15531553 $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
15541554 $text = '<a href="http://www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
1555 -
1556 - wfRunHooks( 'SkinGetPoweredBy', array( &$text ) );
1557 -
 1555+ wfRunHooks( 'SkinGetPoweredBy', array( &$text, $wgUser->getSkin()->getSkinName() ) );
15581556 return $text;
15591557 }
15601558

Follow-up revisions

RevisionCommit summaryAuthorDate
r76669Follow-up r76434, r76570,r76668: Pass skin object per CRraymond19:45, 14 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76434* (bug 22463) Add hook 'SkinGetPoweredBy' to make 'powered by' icon customizable...raymond08:18, 10 November 2010
r76570Follow-up r76434: Run hook for Modern skin too per suggestion of Jack Phoenixraymond12:16, 12 November 2010

Comments

#Comment by Platonides (talk | contribs)   19:43, 14 November 2010

You should be passing the skin object, not the skin name. And not via $wgUser.

I would also prefer having the Skin as first parameter.

#Comment by 😂 (talk | contribs)   19:44, 14 November 2010

IRC cabal already discussed this :p

#Comment by Raymond (talk | contribs)   19:50, 14 November 2010

Skin object passed now with r76669.

Status & tagging log