* Added "Advanced search" link to the search form
* Special:Upload can now have a custom upload message instead of uploadtext by
passing "uploadmsg" parameter in the url
-
+* (bug 9947) Add PROTECTIONLEVEL parser funtion to return the protection level
+ for the current page for a given action
+
=== Bug fixes in 1.15 ===
$parser->setFunctionHook( 'filepath', array( __CLASS__, 'filepath' ), SFH_NO_HASH );
$parser->setFunctionHook( 'pagesincategory', array( __CLASS__, 'pagesincategory' ), SFH_NO_HASH );
$parser->setFunctionHook( 'pagesize', array( __CLASS__, 'pagesize' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'protectionlevel', array( __CLASS__, 'protectionlevel' ), SFH_NO_HASH );
$parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS );
if ( $wgAllowDisplayTitle ) {
}
return self::formatRaw( $length, $raw );
}
+
+ /**
+ * Returns the requested protection level for the current page
+ */
+ static function protectionlevel( $parser, $type = '' ) {
+ $restrictions = $parser->mTitle->getRestrictions( strtolower( $type ) );
+ # Title::getRestrictions returns an array, its possible it may have
+ # multiple values in the future
+ return implode( $restrictions, ',' );
+ }
static function language( $parser, $arg = '' ) {
global $wgContLang;
'noindex' => array( 1, '__NOINDEX__' ),
'numberingroup' => array( 1, 'NUMBERINGROUP', 'NUMINGROUP' ),
'staticredirect' => array( 1, '__STATICREDIRECT__' ),
+ 'protectionlevel' => array( 1, 'PROTECTIONLEVEL' ),
);
/**