53 $this->mName =
'Recentchangeslinked';
54 $this->searchEngineFactory = $searchEngineFactory;
59 $opts = parent::getDefaultOptions();
60 $opts->add(
'target',
'' );
61 $opts->add(
'showlinkedto',
false );
68 $opts[
'target'] = $par;
75 $target = $opts[
'target'];
76 $showlinkedto = $opts[
'showlinkedto'];
78 if ( $target ===
'' ) {
83 $title = Title::newFromText( $target );
84 if ( !$title || $title->isExternal() ) {
85 $outputPage->addModuleStyles(
'mediawiki.codex.messagebox.styles' );
87 Html::errorBox( $this->
msg(
'allpagesbadtitle' )->parse(),
'',
'mw-recentchangeslinked-errorbox' )
93 $outputPage->setPageTitleMsg(
94 $this->
msg(
'recentchangeslinked-title' )->plaintextParams( $title->getPrefixedText() )
97 $ns = $title->getNamespace();
101 $link_tables = [
'categorylinks' ];
102 $showlinkedto =
true;
105 $link_tables = [
'pagelinks',
'templatelinks' ];
107 if ( $ns ===
NS_FILE || !$showlinkedto ) {
108 $link_tables[] =
'imagelinks';
113 $showlinkedto ? ChangesListQuery::LINKS_TO : ChangesListQuery::LINKS_FROM,
120 $target = $this->getTargetTitle();
122 $this->
getOutput()->addBacklinkSubtitle( $target );
123 $this->
getSkin()->setRelevantTitle( $target );
134 $extraOpts = parent::getExtraOptions( $opts );
136 $opts->consumeValues( [
'showlinkedto',
'target' ] );
138 $extraOpts[
'target'] = [ $this->
msg(
'recentchangeslinked-page' )->escaped(),
139 Html::input(
'target', str_replace(
'_',
' ', $opts[
'target'] ),
'text', [
'size' => 40 ] ) .
' ' .
140 Html::check(
'showlinkedto', $opts[
'showlinkedto'], [
'id' =>
'showlinkedto' ] ) .
' ' .
141 Html::label( $this->
msg(
'recentchangeslinked-to' )->text(),
'showlinkedto' ) ];
150 private function getTargetTitle() {
151 if ( $this->rclTargetTitle ===
null ) {
153 if ( isset( $opts[
'target'] ) && $opts[
'target'] !==
'' ) {
154 $this->rclTargetTitle = Title::newFromText( $opts[
'target'] );
156 $this->rclTargetTitle =
false;
172 return $this->
prefixSearchString( $search, $limit, $offset, $this->searchEngineFactory );
176 $targetTitle = $this->getTargetTitle();
177 if ( $targetTitle ===
false ) {
181 [
'class' => [
'mw-changeslist-empty',
'mw-changeslist-notargetpage' ] ],
182 $this->
msg(
'recentchanges-notargetpage' )->parse()
185 } elseif ( !$targetTitle || $targetTitle->isExternal() ) {
189 [
'class' => [
'mw-changeslist-empty',
'mw-changeslist-invalidtargetpage' ] ],
190 $this->
msg(
'allpagesbadtitle' )->parse()
194 parent::outputNoResults();
203class_alias( SpecialRecentChangesLinked::class,
'SpecialRecentChangesLinked' );
getOptions()
Get the current FormOptions for this request.
TempUserConfig $tempUserConfig
RecentChangeFactory $recentChangeFactory
ChangesListQueryFactory $changesListQueryFactory
UserIdentityUtils $userIdentityUtils
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.
Factory class for SearchEngine.