61 parent::__construct(
'Listredirects' );
62 $this->linkBatchFactory = $linkBatchFactory;
64 $this->wikiPageFactory = $wikiPageFactory;
65 $this->redirectLookup = $redirectLookup;
82 'tables' => [
'page',
'redirect' ],
83 'fields' => [
'namespace' =>
'page_namespace',
84 'title' =>
'page_title',
90 'conds' => [
'page_is_redirect' => 1 ],
91 'join_conds' => [
'redirect' => [
92 'LEFT JOIN',
'rd_from=page_id' ],
98 return [
'page_namespace',
'page_title' ];
108 if ( !$res->numRows() ) {
112 $batch = $this->linkBatchFactory->newLinkBatch();
113 foreach ( $res as $row ) {
114 $batch->add( $row->namespace, $row->title );
116 if ( $redirTarget ) {
117 $batch->addObj( $redirTarget );
131 if ( isset( $row->rd_title ) ) {
132 return Title::makeTitle(
139 $title = Title::makeTitle( $row->namespace, $row->title );
140 if ( !$title->canExist() ) {
144 return Title::castFromLinkTarget(
145 $this->redirectLookup->getRedirectTarget( $title )
157 # Make a link to the redirect itself
158 $rd_title = Title::makeTitle( $result->namespace, $result->title );
159 $rd_link = $linkRenderer->makeLink(
163 [
'redirect' =>
'no' ]
166 # Find out where the redirect leads
169 # Make a link to the destination page
171 $arr = $lang->getArrow();
172 $rd_link = Html::rawElement(
'bdi', [
'dir' => $lang->getDir() ], $rd_link );
173 $targetLink = $linkRenderer->makeLink( $target, $target->getFullText() );
174 $targetLink = Html::rawElement(
'bdi', [
'dir' => $lang->getDir() ], $targetLink );
176 return "$rd_link $arr $targetLink";
178 return "<del>$rd_link</del>";
184 parent::execute( $par );
193class_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.