r76434 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76433‎ | r76434 | r76435 >
Date:08:18, 10 November 2010
Author:raymond
Status:ok (Comments)
Tags:
Comment:
* (bug 22463) Add hook 'SkinGetPoweredBy' to make 'powered by' icon customizable
Patch by Yaron
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1461,6 +1461,9 @@
14621462 &$link: overridable HTML link to be passed into the message as $1
14631463 &$forContent: overridable flag if copyright footer is shown in content language.
14641464
 1465+'SkinGetPoweredBy'
 1466+&$text: additional 'powered by' icons in HTML
 1467+
14651468 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle()
14661469 &$subpages: Subpage links HTML
14671470 $skin: Skin object
Index: trunk/phase3/includes/Skin.php
@@ -1550,9 +1550,11 @@
15511551 global $wgStylePath;
15521552
15531553 $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
1554 - $img = '<a href="http://www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
 1554+ $text = '<a href="http://www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
15551555
1556 - return $img;
 1556+ wfRunHooks( 'SkinGetPoweredBy', array( &$text ) );
 1557+
 1558+ return $text;
15571559 }
15581560
15591561 function lastModified() {
Index: trunk/phase3/RELEASE-NOTES
@@ -201,6 +201,7 @@
202202 * Special:Search: Add CSS classes to 'none found' and 'create link' messages
203203 * Add CSS classes (including namespace and pagename) to the enhanced recent
204204 changes/watchlist entries
 205+* (bug 22463) Add hook 'SkinGetPoweredBy' to make 'powered by' icon customizable
205206
206207 === Bug fixes in 1.17 ===
207208 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r76570Follow-up r76434: Run hook for Modern skin too per suggestion of Jack Phoenixraymond12:16, 12 November 2010
r76668Follow-up r76434, r76570: Add skinname per CRraymond19:28, 14 November 2010
r76669Follow-up r76434, r76570,r76668: Pass skin object per CRraymond19:45, 14 November 2010

Comments

#Comment by Jack Phoenix (talk | contribs)   19:41, 10 November 2010

The hook is certainly useful (and the commit looks OK to me), but it's never run for the Modern skin, because SkinModern class overrides getPoweredBy() function. The comment in Modern.php states that "We don't like the default getPoweredBy, the icon clashes with the skin L&F"; it would be nice if extensions that hook into this hook were run for the Modern skin too...after all, it's very easy to check for the current skin and display text instead of an icon for the Modern skin.

#Comment by Raymond (talk | contribs)   12:17, 12 November 2010

Hook added for Modern skin with r76570. Thanks for CR and suggestion :)

Status & tagging log