Difference between revisions of "Extension:SS3Dummy"
From Organic Design wiki
(New page: <?php /**{{php}}{{Category:Extensions|...) |
m |
||
Line 6: | Line 6: | ||
*/ | */ | ||
− | if (!defined('MEDIAWIKI')) die('Not an entry point.'); | + | if ( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' ); |
$wgExtensionFunctions[] = 'efSetupSS3Dummy'; | $wgExtensionFunctions[] = 'efSetupSS3Dummy'; | ||
function efSetupSS3Dummy() { | function efSetupSS3Dummy() { | ||
global $wgParser; | global $wgParser; | ||
− | $wgParser->setFunctionHook('security', 'efSS3Dummy'); | + | $wgParser->setFunctionHook( 'security', 'efSS3Dummy' ); |
} | } | ||
$wgHooks['LanguageGetMagic'][] = 'efSS3DummyLanguageGetMagic'; | $wgHooks['LanguageGetMagic'][] = 'efSS3DummyLanguageGetMagic'; | ||
− | function efSS3DummyLanguageGetMagic(&$magicWords, $langCode = 0) { | + | function efSS3DummyLanguageGetMagic( &$magicWords, $langCode = 0 ) { |
− | $magicWords['security'] = array($langCode, 'security'); | + | $magicWords['security'] = array( $langCode, 'security' ); |
return true; | return true; | ||
} | } | ||
− | function efSS3Dummy(&$parser) { | + | function efSS3Dummy( &$parser ) { |
return "[[Category:Private]]"; | return "[[Category:Private]]"; | ||
} | } |
Latest revision as of 10:25, 24 March 2009
<?php /**Template:Php
* SS3Dummy extension creates a dummy #security parser-function * This ensures that all old SimpleSecurity3.x protected pages are categorised into Category:Private * Category:Private is then locked down by SimpleSecurity4
- /
if ( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' );
$wgExtensionFunctions[] = 'efSetupSS3Dummy'; function efSetupSS3Dummy() { global $wgParser; $wgParser->setFunctionHook( 'security', 'efSS3Dummy' ); }
$wgHooks['LanguageGetMagic'][] = 'efSS3DummyLanguageGetMagic'; function efSS3DummyLanguageGetMagic( &$magicWords, $langCode = 0 ) { $magicWords['security'] = array( $langCode, 'security' ); return true; }
function efSS3Dummy( &$parser ) { return ""; }