r67623 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67622‎ | r67623 | r67624 >
Date:14:52, 8 June 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Deprecate MonoBookTemplateToolboxEnd hook.
SkinTemplateToolboxEnd available since 1.13 should be used instead.
Usage among extensions fixed.
Modified paths:
  • /trunk/extensions/Contributors/Contributors.php (modified) (history)
  • /trunk/extensions/Duplicator/Duplicator.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage.php (modified) (history)
  • /trunk/extensions/LanguageSelector/LanguageSelector.php (modified) (history)
  • /trunk/extensions/LanguageSelector/README (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MultiUpload/MultiUpload.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/Tasks/Tasks.php (modified) (history)
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php (modified) (history)
  • /trunk/extensions/Wikidata/misc/FundButton.php (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1112,9 +1112,10 @@
11131113
11141114 'MonoBookTemplateToolboxEnd': Called by Monobook skin after toolbox links have
11151115 been rendered (useful for adding more)
1116 -Note: this is only run for the Monobook skin. To add items to the toolbox
1117 -for all 'SkinTemplate'-type skins, use the SkinTemplateToolboxEnd hook
1118 -instead.
 1116+Note: this is only run for the Monobook skin. This hook is deprecated and
 1117+may be removed in the future. To add items to the toolbox you should use
 1118+the SkinTemplateToolboxEnd hook instead, which works for all
 1119+'SkinTemplate'-type skins.
11191120 $tools: array of tools
11201121
11211122 'NewRevisionFromEditComplete': called when a revision was inserted
Index: trunk/extensions/MultiUpload/MultiUpload.php
@@ -35,7 +35,7 @@
3636 $wgSpecialPageGroups['MultipleUpload'] = 'media';
3737
3838 // Hooked functions
39 -$wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfMultiUploadToolbox';
 39+$wgHooks['SkinTemplateToolboxEnd'][] = 'wfMultiUploadToolbox';
4040 $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'wfSpecialMultiUploadNav';
4141
4242 // Add the link to Special:MultipleUpload to all SkinTemplate-based skins for users with the 'upload' user right
@@ -51,7 +51,7 @@
5252 return true;
5353 }
5454
55 -// Add the link to Special:MultipleUpload to the Monobook skin
 55+// Add the link to Special:MultipleUpload to SkinTemplate based skins
5656 function wfMultiUploadToolbox( &$monobook ) {
5757 wfLoadExtensionMessages( 'MultiUpload' );
5858 if ( isset( $monobook->data['nav_urls']['multiupload'] ) ) {
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -207,7 +207,7 @@
208208 $wgHooks['ParserFirstCallInit'][] = 'SMWParserExtensions::registerParserFunctions';
209209
210210 if ( $smwgToolboxBrowseLink ) {
211 - if ( version_compare( $wgVersion, '1.13', '>' ) ) {
 211+ if ( version_compare( $wgVersion, '1.13', '>=' ) ) {
212212 $wgHooks['SkinTemplateToolboxEnd'][] = 'smwfShowBrowseLink'; // introduced only in 1.13
213213 } else {
214214 $wgHooks['MonoBookTemplateToolboxEnd'][] = 'smwfShowBrowseLink';
Index: trunk/extensions/Tasks/Tasks.php
@@ -86,7 +86,7 @@
8787 $wgHooks['ArticleInsertComplete'][] = 'wfTasksExtensionArticleSaveComplete';
8888 $wgHooks['ArticleDeleteComplete'][] = 'wfTasksExtensionArticleDeleteComplete';
8989 $wgHooks['SpecialMovepageAfterMove'][] = 'wfTasksExtensionAfterMove';
90 -$wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfTasksExtensionAfterToolbox';
 90+$wgHooks['SkinTemplateToolboxEnd'][] = 'wfTasksExtensionAfterToolbox';
9191 $wgHooks['ArticleViewHeader'][] = 'wfTaskExtensionHeaderHook';
9292 $wgHooks['EditPage::showEditForm:initial'][] = 'wfTaskExtensionEditFormInitialHook';
9393 $wgHooks['ParserTestTables'][] = 'wfTasksTestTables';
Index: trunk/extensions/Duplicator/Duplicator.php
@@ -42,7 +42,7 @@
4343 function efDuplicator() {
4444 global $wgHooks;
4545 $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efDuplicatorNavigation';
46 - $wgHooks['MonoBookTemplateToolboxEnd'][] = 'efDuplicatorToolbox';
 46+ $wgHooks['SkinTemplateToolboxEnd'][] = 'efDuplicatorToolbox';
4747 }
4848
4949 /**
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php
@@ -205,7 +205,11 @@
206206
207207 # Attach Hooks
208208 $wgHooks['OutputPageBeforeHTML'][] = 'wfAddWikiFeedHeaders';
209 -$wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfWikiArticleFeedsToolboxLinks';
 209+if ( version_compare( $wgVersion, '1.13', '>=' ) ) {
 210+ $wgHooks['SkinTemplateToolboxEnd'][] = 'wfWikiArticleFeedsToolboxLinks'; // introduced in 1.13
 211+} else {
 212+ $wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfWikiArticleFeedsToolboxLinks';
 213+}
210214 $wgHooks['UnknownAction'][] = 'wfWikiArticleFeedsAction';
211215 $wgHooks['ArticlePurge'][] = 'wfPurgeFeedsOnArticlePurge';
212216
@@ -262,7 +266,7 @@
263267
264268 /**
265269 * Adds the Wiki feed links to the bottom of the toolbox in Monobook or like-minded skins.
266 - * Usage: $wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfWikiArticleFeedsToolboxLinks';
 270+ * Usage: $wgHooks['SkinTemplateToolboxEnd'][] = 'wfWikiArticleFeedsToolboxLinks';
267271 * @param QuickTemplate $template Instance of MonoBookTemplate or other QuickTemplate
268272 */
269273 function wfWikiArticleFeedsToolboxLinks( $template ) {
Index: trunk/extensions/LanguageSelector/LanguageSelector.php
@@ -172,7 +172,7 @@
173173 if ( $wgLanguageSelectorLocation != LANGUAGE_SELECTOR_MANUAL && $wgLanguageSelectorLocation != LANGUAGE_SELECTOR_AT_TOP_OF_TEXT ) {
174174 switch ( $wgLanguageSelectorLocation ) {
175175 case LANGUAGE_SELECTOR_IN_TOOLBOX:
176 - $wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfLanguageSelectorSkinHook';
 176+ $wgHooks['SkinTemplateToolboxEnd'][] = 'wfLanguageSelectorSkinHook';
177177 break;
178178 default:
179179 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'wfLanguageSelectorSkinTemplateOutputPageBeforeExec';
Index: trunk/extensions/LanguageSelector/README
@@ -74,8 +74,8 @@
7575 content. This is the default, but it looks quite ugly without extra CSS
7676 rules applied.
7777 ** LANGUAGE_SELECTOR_IN_TOOLBOX: inject a dropdown box at the bottom of the
78 - toolbox in the sidebar. This only works with the MonoBook skin, or skins
79 - explicitly supporting the MonoBookTemplateToolboxEnd hook.
 78+ toolbox in the sidebar. This doesn't work in all skins, mostly in skin
 79+ MonoBook, or skins explicitly supporting the SkinTemplateToolboxEnd hook.
8080 ** LANGUAGE_SELECTOR_AS_PORTLET: inject the language selector as a portlet
8181 in the sidebar, similar to how interlanguage-links are shown.
8282 Works with MonoBook skin, may also work with some SkinTemplate-based skins.
Index: trunk/extensions/EmailPage/EmailPage.php
@@ -47,7 +47,7 @@
4848 if ( isset( $_REQUEST['ea-send'] ) ) require_once( $wgPhpMailerClass );
4949
5050 # Add toolbox and action links
51 -if ( $wgEmailPageToolboxLink ) $wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfEmailPageToolboxLink';
 51+if ( $wgEmailPageToolboxLink ) $wgHooks['SkinTemplateToolboxEnd'][] = 'wfEmailPageToolboxLink';
5252 if ( $wgEmailPageActionLink ) $wgHooks['SkinTemplateTabs'][] = 'wfEmailPageActionLink';
5353
5454 function wfEmailPageToolboxLink() {
Index: trunk/extensions/Contributors/Contributors.php
@@ -49,7 +49,7 @@
5050 $wgHooks['ArticleSaveComplete'][] = 'efContributorsInvalidateCache';
5151 # Good god, this is ludicrous!
5252 $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efContributorsNavigation';
53 - $wgHooks['MonoBookTemplateToolboxEnd'][] = 'efContributorsToolbox';
 53+ $wgHooks['SkinTemplateToolboxEnd'][] = 'efContributorsToolbox';
5454 }
5555
5656 /**
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -202,7 +202,7 @@
203203 }
204204 }
205205
206 - if (version_compare($wgVersion,'1.13','>')) {
 206+ if (version_compare($wgVersion,'1.13','>=')) {
207207 $wgHooks['SkinTemplateToolboxEnd'][] = 'mvAddToolBoxLinks'; // introduced only in 1.13
208208 } else {
209209 $wgHooks['MonoBookTemplateToolboxEnd'][] = 'mvAddToolBoxLinks';
Index: trunk/extensions/Wikidata/misc/FundButton.php
@@ -3,7 +3,7 @@
44
55 global $wgHooks;
66
7 -$wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfFundHook';
 7+$wgHooks['SkinTemplateToolboxEnd'][] = 'wfFundHook';
88
99 function wfFundHook() {
1010 $msg = <<<ENDHTML
@@ -32,4 +32,4 @@
3333 echo( $msg );
3434 return true;
3535 }
36 -?>
\ No newline at end of file
 36+?>

Follow-up revisions

RevisionCommit summaryAuthorDate
r67626Merge from trunk r67623....platonides15:08, 8 June 2010

Comments

Status & tagging log