r41494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41493‎ | r41494 | r41495 >
Date:15:44, 1 October 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
Adoptions for compatibility with older MWs
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php
@@ -151,7 +151,9 @@
152152 $parser->setFunctionHook( 'info', 'SMWParserExtensions::doInfo' );
153153 $parser->setFunctionHook( 'concept', 'SMWParserExtensions::doConcept' );
154154 $parser->setFunctionHook( 'set', 'SMWParserExtensions::doConcept' );
155 - $parser->setFunctionHook( 'declare', 'SMWParserExtensions::doDeclare', SFH_OBJECT_ARGS );
 155+ if (defined('SFH_OBJECT_ARGS')) { // only available since MediaWiki 1.13
 156+ $parser->setFunctionHook( 'declare', 'SMWParserExtensions::doDeclare', SFH_OBJECT_ARGS );
 157+ }
156158 return true; // always return true, in order not to stop MW's hook processing!
157159 }
158160
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php
@@ -245,8 +245,6 @@
246246 $wgHooks['TitleMoveComplete'][]='SMWParseData::onTitleMoveComplete'; // move annotations
247247 $wgHooks['LinksUpdateConstructed'][] = 'SMWParseData::onLinksUpdateConstructed'; // update data after template change and at safe
248248 $wgHooks['OutputPageParserOutput'][] = 'SMWFactbox::onOutputPageParserOutput'; // copy some data for later Factbox display
249 - $wgHooks['SkinAfterContent'][] = 'SMWFactbox::onSkinAfterContent'; // draw Factbox below categories
250 -// $wgHooks['OutputPageBeforeHTML'][] = 'SMWFactbox::onOutputPageBeforeHTML';// draw Factbox right below page content
251249
252250 $wgHooks['ParserAfterTidy'][] = 'smwfParserAfterTidy'; // add items to HTML header during parsing
253251 $wgHooks['BeforePageDisplay'][]='smwfAddHTMLHeadersOutput'; // add items to HTML header during output
@@ -267,6 +265,11 @@
268266 $wgHooks['MonoBookTemplateToolboxEnd'][] = 'smwfShowBrowseLink';
269267 }
270268 }
 269+ if (version_compare($wgVersion,'1.14','>')) {
 270+ $wgHooks['SkinAfterContent'][] = 'SMWFactbox::onSkinAfterContent'; // draw Factbox below categories
 271+ } else {
 272+ $wgHooks['OutputPageBeforeHTML'][] = 'SMWFactbox::onOutputPageBeforeHTML'; // draw Factbox right below page content
 273+ }
271274
272275 ///// credits (see "Special:Version") /////
273276 $wgExtensionCredits['parserhook'][]= array('name'=>'Semantic MediaWiki', 'version'=>SMW_VERSION, 'author'=>"Klaus Lassleben, [http://korrekt.org Markus Krötzsch], [http://simia.net Denny Vrandecic], S Page, and others. Maintained by [http://www.aifb.uni-karlsruhe.de/Forschungsgruppen/WBS/english AIFB Karlsruhe].", 'url'=>'http://semantic-mediawiki.org', 'description' => 'Making your wiki more accessible – for machines \'\'and\'\' humans. [http://semantic-mediawiki.org/wiki/Help:User_manual View online documentation.]');

Status & tagging log