From: aalekhN Date: Wed, 8 Jan 2014 20:05:00 +0000 (+0530) Subject: Made Special:Contributions includable X-Git-Tag: 1.31.0-rc.0~17105^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=cf33b9a9802782975a157aa808158d4d778d4bd8;p=lhc%2Fweb%2Fwiklou.git Made Special:Contributions includable This commit make Special:Contributions transcludable by changing extended class SpecialPage to IncludableSpecialPage also it adds if condition in execute function to avoid the inclusion of form when Special:Contributions is transcluded into other appropriate MediaWiki pages. Bug: 4365 Change-Id: I25c5cc3775b91fdc17c1209953d425c640e5bc77 --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 6b56c2fa2a..08768b6fd4 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -27,7 +27,7 @@ * @ingroup SpecialPage */ -class SpecialContributions extends SpecialPage { +class SpecialContributions extends IncludableSpecialPage { protected $opts; public function __construct() { @@ -63,8 +63,9 @@ class SpecialContributions extends SpecialPage { $this->opts['deletedOnly'] = $request->getBool( 'deletedOnly' ); if ( !strlen( $target ) ) { - $out->addHTML( $this->getForm() ); - + if ( !$this->including() ) { + $out->addHTML( $this->getForm() ); + } return; } @@ -169,8 +170,9 @@ class SpecialContributions extends SpecialPage { $this->addFeedLinks( array( 'action' => 'feedcontributions', 'user' => $target ) ); if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id, $userObj, $this ) ) ) { - $out->addHTML( $this->getForm() ); - + if ( !$this->including() ) { + $out->addHTML( $this->getForm() ); + } $pager = new ContribsPager( $this->getContext(), array( 'target' => $target, 'contribs' => $this->opts['contribs'], @@ -214,10 +216,12 @@ class SpecialContributions extends SpecialPage { } if ( $message ) { - if ( !$this->msg( $message, $target )->isDisabled() ) { - $out->wrapWikiMsg( - "", - array( $message, $target ) ); + if ( !$this->including() ) { + if ( !$this->msg( $message, $target )->isDisabled() ) { + $out->wrapWikiMsg( + "", + array( $message, $target ) ); + } } } }