60 parent::__construct(
'Listredirects' );
61 $this->linkBatchFactory = $linkBatchFactory;
63 $this->wikiPageFactory = $wikiPageFactory;
64 $this->redirectLookup = $redirectLookup;
81 'tables' => [
'page',
'redirect' ],
82 'fields' => [
'namespace' =>
'page_namespace',
83 'title' =>
'page_title',
89 'conds' => [
'page_is_redirect' => 1 ],
90 'join_conds' => [
'redirect' => [
91 'LEFT JOIN',
'rd_from=page_id' ],
97 return [
'page_namespace',
'page_title' ];
107 if ( !$res->numRows() ) {
111 $batch = $this->linkBatchFactory->newLinkBatch();
112 foreach ( $res as $row ) {
113 $batch->add( $row->namespace, $row->title );
115 if ( $redirTarget ) {
116 $batch->addObj( $redirTarget );
130 if ( isset( $row->rd_title ) ) {
131 return Title::makeTitle(
138 $title = Title::makeTitle( $row->namespace, $row->title );
139 if ( !$title->canExist() ) {
143 return Title::castFromLinkTarget(
144 $this->redirectLookup->getRedirectTarget( $title )
156 # Make a link to the redirect itself
157 $rd_title = Title::makeTitle( $result->namespace, $result->title );
158 $rd_link = $linkRenderer->makeLink(
162 [
'redirect' =>
'no' ]
165 # Find out where the redirect leads
168 # Make a link to the destination page
170 $arr = $lang->getArrow() . $lang->getDirMark();
171 $targetLink = $linkRenderer->makeLink( $target, $target->getFullText() );
173 return "$rd_link $arr $targetLink";
175 return "<del>$rd_link</del>";
181 parent::execute( $par );
190class_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.