49 $changesListQueryFactory,
51 $this->mName =
'Recentchangeslinked';
56 $opts = parent::getDefaultOptions();
57 $opts->add(
'target',
'' );
58 $opts->add(
'showlinkedto',
false );
65 $opts[
'target'] = $par;
72 $target = $opts[
'target'];
73 $showlinkedto = $opts[
'showlinkedto'];
75 if ( $target ===
'' ) {
80 $title = Title::newFromText( $target );
81 if ( !$title || $title->isExternal() ) {
82 $outputPage->addModuleStyles(
'mediawiki.codex.messagebox.styles' );
84 Html::errorBox( $this->
msg(
'allpagesbadtitle' )->parse(),
'',
'mw-recentchangeslinked-errorbox' )
90 $outputPage->setPageTitleMsg(
91 $this->
msg(
'recentchangeslinked-title' )->plaintextParams( $title->getPrefixedText() )
94 $ns = $title->getNamespace();
98 $link_tables = [
'categorylinks' ];
102 $link_tables = [
'pagelinks',
'templatelinks' ];
104 if ( $ns ===
NS_FILE || !$showlinkedto ) {
105 $link_tables[] =
'imagelinks';
110 $showlinkedto ? ChangesListQuery::LINKS_TO : ChangesListQuery::LINKS_FROM,
117 $target = $this->getTargetTitle();
119 $this->
getOutput()->addBacklinkSubtitle( $target );
120 $this->
getSkin()->setRelevantTitle( $target );
131 $extraOpts = parent::getExtraOptions( $opts );
133 $opts->consumeValues( [
'showlinkedto',
'target' ] );
135 $extraOpts[
'target'] = [ $this->
msg(
'recentchangeslinked-page' )->escaped(),
136 Html::input(
'target', str_replace(
'_',
' ', $opts[
'target'] ),
'text', [
'size' => 40 ] ) .
' ' .
137 Html::check(
'showlinkedto', $opts[
'showlinkedto'], [
'id' =>
'showlinkedto' ] ) .
' ' .
138 Html::label( $this->
msg(
'recentchangeslinked-to' )->text(),
'showlinkedto' ) ];
147 private function getTargetTitle() {
148 if ( $this->rclTargetTitle ===
null ) {
150 if ( isset( $opts[
'target'] ) && $opts[
'target'] !==
'' ) {
151 $this->rclTargetTitle = Title::newFromText( $opts[
'target'] );
153 $this->rclTargetTitle =
false;
169 return $this->
prefixSearchString( $search, $limit, $offset, $this->searchEngineFactory );
173 $targetTitle = $this->getTargetTitle();
174 if ( $targetTitle ===
false ) {
178 [
'class' => [
'mw-changeslist-empty',
'mw-changeslist-notargetpage' ] ],
179 $this->
msg(
'recentchanges-notargetpage' )->parse()
182 } elseif ( !$targetTitle || $targetTitle->isExternal() ) {
186 [
'class' => [
'mw-changeslist-empty',
'mw-changeslist-invalidtargetpage' ] ],
187 $this->
msg(
'allpagesbadtitle' )->parse()
191 parent::outputNoResults();
200class_alias( SpecialRecentChangesLinked::class,
'SpecialRecentChangesLinked' );
getOptions()
Get the current FormOptions for this request.
getSkin()
Shortcut to get the skin being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
prefixSearchString( $search, $limit, $offset, ?SearchEngineFactory $searchEngineFactory=null)
Perform a regular substring search for prefixSearchSubpages.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.