* (bug 18062) new message when edit or create the local page of a shared file
* (bug 22870) Separate interface message when creating a page
* (bug 17615) nosummary option should be reassigned on preview/captcha
+* (bug 34355) add a variable and parser function for the namespace number
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
$parser->setFunctionHook( 'protectionlevel', array( __CLASS__, 'protectionlevel' ), SFH_NO_HASH );
$parser->setFunctionHook( 'namespace', array( __CLASS__, 'mwnamespace' ), SFH_NO_HASH );
$parser->setFunctionHook( 'namespacee', array( __CLASS__, 'namespacee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'namespacenumber', array( __CLASS__, 'namespacenumber' ), SFH_NO_HASH );
$parser->setFunctionHook( 'talkspace', array( __CLASS__, 'talkspace' ), SFH_NO_HASH );
$parser->setFunctionHook( 'talkspacee', array( __CLASS__, 'talkspacee' ), SFH_NO_HASH );
$parser->setFunctionHook( 'subjectspace', array( __CLASS__, 'subjectspace' ), SFH_NO_HASH );
return '';
return wfUrlencode( $t->getNsText() );
}
+ static function namespacenumber( $parser, $title = null ) {
+ $t = Title::newFromText( $title );
+ if ( is_null( $t ) )
+ return '';
+ return $t->getNamespace();
+ }
static function talkspace( $parser, $title = null ) {
$t = Title::newFromText( $title );
if ( is_null( $t ) || !$t->canTalk() )
case 'namespacee':
$value = wfUrlencode( $wgContLang->getNsText( $this->mTitle->getNamespace() ) );
break;
+ case 'namespacenumber':
+ $value = $this->mTitle->getNamespace();
+ break;
case 'talkspace':
$value = $this->mTitle->canTalk() ? str_replace( '_',' ',$this->mTitle->getTalkNsText() ) : '';
break;
'pagenamee' => array( 1, 'PAGENAMEE' ),
'namespace' => array( 1, 'NAMESPACE' ),
'namespacee' => array( 1, 'NAMESPACEE' ),
+ 'namespacenumber' => array( 1, 'NAMESPACENUMBER' ),
'talkspace' => array( 1, 'TALKSPACE' ),
'talkspacee' => array( 1, 'TALKSPACEE' ),
'subjectspace' => array( 1, 'SUBJECTSPACE', 'ARTICLESPACE' ),