Page MenuHomePhabricator

Proposed_patch_v1

Authored By
bzimport
Nov 21 2014, 9:30 PM
Size
4 KB
Referenced Files
None
Subscribers
None

Proposed_patch_v1

Index: includes/parser/CoreParserFunctions.php
===================================================================
--- includes/parser/CoreParserFunctions.php (revision 46658)
+++ includes/parser/CoreParserFunctions.php (working copy)
@@ -53,6 +53,18 @@
$parser->setFunctionHook( 'talkspacee', array( __CLASS__, 'talkspacee' ), SFH_NO_HASH );
$parser->setFunctionHook( 'subjectspace', array( __CLASS__, 'subjectspace' ), SFH_NO_HASH );
$parser->setFunctionHook( 'subjectspacee', array( __CLASS__, 'subjectspacee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'fullpagename', array( __CLASS__, 'fullpagename' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'fullpagenamee', array( __CLASS__, 'fullpagenamee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'pagename', array( __CLASS__, 'pagename' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'pagenamee', array( __CLASS__, 'pagenamee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'basepagename', array( __CLASS__, 'basepagename' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'basepagenamee', array( __CLASS__, 'basepagenamee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'subpagename', array( __CLASS__, 'subpagename' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'subpagenamee', array( __CLASS__, 'subpagenamee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'subjectpagename', array( __CLASS__, 'subjectpagename' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'subjectpagenamee', array( __CLASS__, 'subjectpagenamee' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'talkpagename', array( __CLASS__, 'talkpagename' ), SFH_NO_HASH );
+ $parser->setFunctionHook( 'talkpagenamee', array( __CLASS__, 'talkpagenamee' ), SFH_NO_HASH );
$parser->setFunctionHook( 'tag', array( __CLASS__, 'tagObj' ), SFH_OBJECT_ARGS );
if ( $wgAllowDisplayTitle ) {
@@ -295,6 +307,78 @@
return '';
return wfUrlencode( $t->getSubjectNsText() );
}
+ static function fullpagename( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return str_replace( '_', ' ', $t->getFullText() );
+ }
+ static function fullpagenamee( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return wfUrlencode( $t->getFullText() );
+ }
+ static function pagename( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return str_replace( '_', ' ', $t->getText() );
+ }
+ static function pagenamee( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return wfUrlencode( $t->getText() );
+ }
+ static function basepagename( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return str_replace( '_', ' ', $t->getBaseText() );
+ }
+ static function basepagenamee( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return wfUrlencode( $t->getBaseText() );
+ }
+ static function subpagename( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return str_replace( '_', ' ', $t->getSubpageText() );
+ }
+ static function subpagenamee( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return wfUrlencode( $t->getSubpageText() );
+ }
+ static function subjectpagename( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return str_replace( '_', ' ', $t->getSubjectPage() );
+ }
+ static function subjectpagenamee( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return wfUrlencode( $t->getSubjectPage() );
+ }
+ static function talkpagename( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return str_replace( '_', ' ', $t->getTalkPage() );
+ }
+ static function talkpagenamee( $parser, $title = null) {
+ $t = Title::newFromText( $title );
+ if ( is_null($t) )
+ return '';
+ return wfUrlencode( $t->getTalkPage() );
+ }
/**
* Return the number of pages in the given category, or 0 if it's nonexis-

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3033
Default Alt Text
Proposed_patch_v1 (4 KB)

Event Timeline