diff options
author | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2011-02-09 15:19:45 +0000 |
---|---|---|
committer | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2011-02-09 15:19:45 +0000 |
commit | 195eafd6ef664c2f7a238eb553f5653fd04a246e (patch) | |
tree | e426e28181e94107ec5373e8b779fc04e7de447e /includes/Message.php | |
parent | 4abff2596654626d04a13fb3c59d1db9f8ed93cd (diff) | |
download | mediawikicore-195eafd6ef664c2f7a238eb553f5653fd04a246e.tar.gz mediawikicore-195eafd6ef664c2f7a238eb553f5653fd04a246e.zip |
* Add a amtitle param to meta=allmessages
Only used used when amenableparser is passed; the user can now define the page used for {{PAGENAME}} and related stuff instead of being hardcoded to "API"
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/81816
Diffstat (limited to 'includes/Message.php')
-rw-r--r-- | includes/Message.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/includes/Message.php b/includes/Message.php index 57cee6862f72..7dd14e15c478 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -95,6 +95,11 @@ class Message { protected $useDatabase = true; /** + * Title object to use as context + */ + protected $title = null; + + /** * Constructor. * @param $key: message key, or array of message keys to try and use the first non-empty message for * @param $params Array message parameters @@ -239,6 +244,17 @@ class Message { } /** + * Set the Title object to use as context when transforming the message + * + * @param $title Title object + * @return Message: $this + */ + public function title( $title ) { + $this->title = $title; + return $this; + } + + /** * Returns the message parsed from wikitext to HTML. * TODO: in PHP >= 5.2.0, we can make this a magic method, * and then we can do, eg: @@ -395,7 +411,7 @@ class Message { * @return Wikitext with {{-constructs replaced with their values. */ protected function transformText( $string ) { - return MessageCache::singleton()->transform( $string, $this->interface, $this->language ); + return MessageCache::singleton()->transform( $string, $this->interface, $this->language, $this->title ); } /** |