27 namespace MediaWiki\Specials;
62 parent::__construct(
'Listredirects' );
63 $this->linkBatchFactory = $linkBatchFactory;
65 $this->wikiPageFactory = $wikiPageFactory;
66 $this->redirectLookup = $redirectLookup;
83 'tables' => [
'page',
'redirect' ],
84 'fields' => [
'namespace' =>
'page_namespace',
85 'title' =>
'page_title',
91 'conds' => [
'page_is_redirect' => 1 ],
92 'join_conds' => [
'redirect' => [
93 'LEFT JOIN',
'rd_from=page_id' ],
99 return [
'page_namespace',
'page_title' ];
109 if ( !$res->numRows() ) {
113 $batch = $this->linkBatchFactory->newLinkBatch();
114 foreach ( $res as $row ) {
115 $batch->add( $row->namespace, $row->title );
117 if ( $redirTarget ) {
118 $batch->addObj( $redirTarget );
132 if ( isset( $row->rd_title ) ) {
136 $row->rd_fragment ??
'',
137 $row->rd_interwiki ??
''
141 if ( !$title->canExist() ) {
146 $this->redirectLookup->getRedirectTarget( $title )
158 # Make a link to the redirect itself
160 $rd_link = $linkRenderer->makeLink(
164 [
'redirect' =>
'no' ]
167 # Find out where the redirect leads
170 # Make a link to the destination page
172 $arr = $lang->getArrow() . $lang->getDirMark();
173 $targetLink = $linkRenderer->makeLink( $target, $target->getFullText() );
175 return "$rd_link $arr $targetLink";
177 return "<del>$rd_link</del>";
183 parent::execute( $par );
194 class_alias( SpecialListRedirects::class,
'SpecialListRedirects' );
Service for creating WikiPage objects.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
setDatabaseProvider(IConnectionProvider $databaseProvider)
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
The base class for all skins.
Service for resolving a wiki page redirect.