/** @var bool|Title */
protected $rclTargetTitle;
- protected $rclTarget;
-
function __construct() {
parent::__construct( 'Recentchangeslinked' );
}
public function parseParameters( $par, FormOptions $opts ) {
$opts['target'] = $par;
- $this->rclTarget = $par;
}
/**
$outputPage->addHTML(
Html::errorBox( $this->msg( 'allpagesbadtitle' )->parse() )
);
-
return false;
}
return $this->prefixSearchString( $search, $limit, $offset );
}
- /**
- * Get a self-referential title object
- * with consideration to the given subpage.
- *
- * @param string|bool $subpage
- * @return Title
- * @since 1.23
- */
- public function getPageTitle( $subpage = false ) {
- $subpage = $subpage ? $subpage : $this->rclTarget;
-
- return parent::getPageTitle( $subpage );
+ protected function outputNoResults() {
+ $targetTitle = $this->getTargetTitle();
+ if ( $targetTitle === false ) {
+ $this->getOutput()->addHTML(
+ '<div class="mw-changeslist-empty mw-changeslist-notargetpage">' .
+ $this->msg( 'recentchanges-notargetpage' )->parse() .
+ '</div>'
+ );
+ } elseif ( !$targetTitle || $targetTitle->isExternal() ) {
+ $this->getOutput()->addHTML(
+ '<div class="mw-changeslist-empty mw-changeslist-invalidtargetpage">' .
+ $this->msg( 'allpagesbadtitle' )->parse() .
+ '</div>'
+ );
+ } else {
+ parent::outputNoResults();
+ }
}
}