http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65345
Revision: 65345 Author: siebrand Date: 2010-04-20 21:37:46 +0000 (Tue, 20 Apr 2010) Log Message: ----------- * changed $wgExtensionFunctions to $wgHooks['ParserFirstCallInit'][] * stylize.php, trailing whitespace removed * bumped version Modified Paths: -------------- trunk/extensions/CategoryTests/CategoryTests.i18n.magic.php trunk/extensions/CategoryTests/CategoryTests.i18n.php trunk/extensions/CategoryTests/CategoryTests.php Modified: trunk/extensions/CategoryTests/CategoryTests.i18n.magic.php =================================================================== --- trunk/extensions/CategoryTests/CategoryTests.i18n.magic.php 2010-04-20 21:27:41 UTC (rev 65344) +++ trunk/extensions/CategoryTests/CategoryTests.i18n.magic.php 2010-04-20 21:37:46 UTC (rev 65345) @@ -1,7 +1,7 @@ <?php /** * Magic word localization for the CategoryTests extension -*/ + */ $magicWords = array(); Modified: trunk/extensions/CategoryTests/CategoryTests.i18n.php =================================================================== --- trunk/extensions/CategoryTests/CategoryTests.i18n.php 2010-04-20 21:27:41 UTC (rev 65344) +++ trunk/extensions/CategoryTests/CategoryTests.i18n.php 2010-04-20 21:37:46 UTC (rev 65345) @@ -3,7 +3,7 @@ * Internationalization file for the CategoryTests extension */ -require_once( dirname(__FILE__) . '/CategoryTests.i18n.magic.php' ); +require_once( dirname( __FILE__ ) . '/CategoryTests.i18n.magic.php' ); $messages = array(); Modified: trunk/extensions/CategoryTests/CategoryTests.php =================================================================== --- trunk/extensions/CategoryTests/CategoryTests.php 2010-04-20 21:27:41 UTC (rev 65344) +++ trunk/extensions/CategoryTests/CategoryTests.php 2010-04-20 21:37:46 UTC (rev 65345) @@ -11,11 +11,11 @@ } // credits and hooks -$wgExtensionFunctions[] = 'wfCategoryTests'; +$wgHooks['ParserFirstCallInit'][] = 'wfCategoryTests'; $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'Category Tests', - 'version' => '1.4', + 'version' => '1.5', 'url' => 'http://www.mediawiki.org/wiki/Extension:CategoryTests', 'author' => 'Ryan Schmidt', 'descriptionmsg' => 'categorytests-desc', @@ -23,17 +23,16 @@ $wgExtensionMessagesFiles['CategoryTests'] = dirname( __FILE__ ) . '/CategoryTests.i18n.php'; -function wfCategoryTests() { - global $wgParser, $wgExtCategoryTests; +function wfCategoryTests( $parser ) { + global $wgExtCategoryTests; $wgExtCategoryTests = new ExtCategoryTests(); - $wgParser->setFunctionHook( 'ifcategory', array( &$wgExtCategoryTests, 'ifcategory' ) ); - $wgParser->setFunctionHook( 'ifnocategories', array( &$wgExtCategoryTests, 'ifnocategories' ) ); - $wgParser->setFunctionHook( 'switchcategory', array( &$wgExtCategoryTests, 'switchcategory' ) ); + $parser->setFunctionHook( 'ifcategory', array( &$wgExtCategoryTests, 'ifcategory' ) ); + $parser->setFunctionHook( 'ifnocategories', array( &$wgExtCategoryTests, 'ifnocategories' ) ); + $parser->setFunctionHook( 'switchcategory', array( &$wgExtCategoryTests, 'switchcategory' ) ); } -Class ExtCategoryTests { - +class ExtCategoryTests { function ifcategory( &$parser, $category = '', $then = '', $else = '', $pagename = '' ) { if ( $category === '' ) { return $then; @@ -44,13 +43,13 @@ $ns = $title->getNamespace(); } else { $title = Title::newFromText( $pagename ); - if ( !($title instanceOf Title) || !$title->exists() ) + if ( !( $title instanceOf Title ) || !$title->exists() ) return $else; $page = $title->getDBkey(); $ns = $title->getNamespace(); } $cattitle = Title::makeTitleSafe( NS_CATEGORY, $category ); - if(!($cattitle instanceOf Title)) { + if ( !( $cattitle instanceOf Title ) ) { return $else; } $catkey = $cattitle->getDBkey(); @@ -73,7 +72,7 @@ $ns = $title->getNamespace(); } else { $title = Title::newFromText( $pagename ); - if ( !($title instanceOf Title) || !$title->exists() ) + if ( !( $title instanceOf Title ) || !$title->exists() ) return $then; $page = $title->getDBkey(); $ns = $title->getNamespace(); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs