r77764 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77763‎ | r77764 | r77765 >
Date:04:46, 5 December 2010
Author:dantman
Status:deferred (Comments)
Tags:
Comment:
Update SMW to use $wgFooterIcons.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -31,11 +31,17 @@
3232 * @return true
3333 */
3434 function enableSemantics( $namespace = null, $complete = false ) {
35 - global $wgVersion, $wgExtensionFunctions, $wgAutoloadClasses, $wgSpecialPages;
 35+ global $wgVersion, $wgFooterIcons, $wgExtensionFunctions, $wgAutoloadClasses, $wgSpecialPages;
3636 global $wgSpecialPageGroups, $wgHooks, $wgExtensionMessagesFiles;
3737 global $smwgIP, $smwgNamespace, $wgJobClasses, $wgExtensionAliasesFiles, $wgServer;
3838 global $wgResourceModules, $smwgScriptPath;
39 -
 39+
 40+ $wgFooterIcons["poweredby"]["semanticmediawiki"] = array(
 41+ "src" => null,
 42+ "url" => "http://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki",
 43+ "alt" => "Powered by Semantic MediaWiki",
 44+ );
 45+
4046 // The dot tells that the domain is not complete. It will be completed
4147 // in the Export since we do not want to create a title object here when
4248 // it is not needed in many cases.
@@ -265,7 +271,7 @@
266272 */
267273 function smwfSetupExtension() {
268274 wfProfileIn( 'smwfSetupExtension (SMW)' );
269 - global $smwgIP, $wgHooks, $wgParser, $wgExtensionCredits, $smwgEnableTemplateSupport, $smwgMasterStore, $smwgIQRunningNumber, $wgLanguageCode, $wgVersion, $smwgToolboxBrowseLink, $smwgMW_1_14;
 275+ global $smwgIP, $smwgScriptPath, $wgHooks, $wgFooterIcons, $wgParser, $wgExtensionCredits, $smwgEnableTemplateSupport, $smwgMasterStore, $smwgIQRunningNumber, $wgLanguageCode, $wgVersion, $smwgToolboxBrowseLink, $smwgMW_1_14;
270276
271277 $smwgMasterStore = null;
272278 $smwgIQRunningNumber = 0;
@@ -289,6 +295,11 @@
290296
291297 $wgHooks['SkinAfterContent'][] = 'SMWFactbox::onSkinAfterContent'; // draw Factbox below categories
292298 $wgHooks['SkinGetPoweredBy'][] = 'smwfAddPoweredBySMW';
 299+ if ( isset($wgFooterIcons["poweredby"])
 300+ && isset($wgFooterIcons["poweredby"]["semanticmediawiki"])
 301+ && $wgFooterIcons["poweredby"]["semanticmediawiki"]["src"] === null ) {
 302+ $wgFooterIcons["poweredby"]["semanticmediawiki"]["src"] = "$smwgScriptPath/skins/images/smw_button.png";
 303+ }
293304 $smwgMW_1_14 = true; // assume latest 1.14 API
294305
295306 // Registration of the extension credits, see Special:Version.

Comments

#Comment by Jeroen De Dauw (talk | contribs)   04:53, 5 December 2010

Won't this make the feature not work in MW < 1.17?

#Comment by Dantman (talk | contribs)   04:55, 5 December 2010

It never worked pre-1.17 anyways, SkinGetPoweredBy was also added in 1.17. I didn't remove it anyways that is still there to. I just added an icon to $wgFooterIcons for new skins that use it.

Status & tagging log