Changed OutputPage::showErrorPage() so that the title parameter
can be either a string or a Message object, just like the
message parameter. This allows titles that take parameters.
Change-Id: Icb7f7b0db8599984774f438333b60d66956b6075
Signed-off-by: Tyler Anthony Romeo <tylerromeo@gmail.com>
*
* showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) );
* showErrorPage( 'titlemsg', $messageObject );
*
* showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) );
* showErrorPage( 'titlemsg', $messageObject );
+ * showErrorPage( $titleMessageObj, $messageObject );
- * @param $title String: message key for page title
+ * @param $title Mixed: message key (string) for page title, or a Message object
* @param $msg Mixed: message key (string) for page text, or a Message object
* @param $params Array: message parameters; ignored if $msg is a Message object
*/
public function showErrorPage( $title, $msg, $params = array() ) {
* @param $msg Mixed: message key (string) for page text, or a Message object
* @param $params Array: message parameters; ignored if $msg is a Message object
*/
public function showErrorPage( $title, $msg, $params = array() ) {
- $this->prepareErrorPage( $this->msg( $title ), $this->msg( 'errorpagetitle' ) );
+ if( !$title instanceof Message ) {
+ $title = $this->msg( $title );
+ }
+
+ $this->prepareErrorPage( $title, $this->msg( 'errorpagetitle' ) );
if ( $msg instanceof Message ){
$this->addHTML( $msg->parse() );
if ( $msg instanceof Message ){
$this->addHTML( $msg->parse() );