56 parent::__construct(
'DoubleRedirects' );
57 $this->contentHandlerFactory = $contentHandlerFactory;
58 $this->linkBatchFactory = $linkBatchFactory;
75 return $this->
msg(
'doubleredirectstext' )->parseAsBlock();
78 private function reallyGetQueryInfo( $namespace =
null, $title =
null ) {
79 $limitToTitle = !( $namespace ===
null && $title === null );
88 'namespace' =>
'pa.page_namespace',
89 'title' =>
'pa.page_title',
91 'b_namespace' =>
'pb.page_namespace',
92 'b_title' =>
'pb.page_title',
93 'b_fragment' =>
'ra.rd_fragment',
97 'c_namespace' =>
'rb.rd_namespace',
98 'c_title' =>
'rb.rd_title',
99 'c_fragment' =>
'rb.rd_fragment',
100 'c_interwiki' =>
'rb.rd_interwiki',
103 'ra.rd_from = pa.page_id',
109 'ra.rd_interwiki' =>
'',
111 'pb.page_namespace = ra.rd_namespace',
112 'pb.page_title = ra.rd_title',
114 'rb.rd_from = pb.page_id',
118 if ( $limitToTitle ) {
119 $retval[
'conds'][
'pa.page_namespace'] = $namespace;
120 $retval[
'conds'][
'pa.page_title'] = $title;
127 return $this->reallyGetQueryInfo();
131 return [
'ra.rd_namespace',
'ra.rd_title' ];
147 if ( isset( $result->b_namespace ) ) {
150 $qi = $this->reallyGetQueryInfo(
156 ->caller( __METHOD__ )
161 $titleA = Title::makeTitle( $result->namespace, $result->title );
165 return '<del>' . $linkRenderer->makeLink( $titleA,
null, [], [
'redirect' =>
'no' ] ) .
'</del>';
173 $this->contentHandlerFactory->getContentHandler( $titleA->getContentModel() )
174 ->supportsDirectEditing()
176 $edit = $linkRenderer->makeKnownLink(
178 $this->
msg(
'parentheses', $this->
msg(
'editlink' )->text() )->text(),
180 [
'action' =>
'edit' ]
186 $linkA = $linkRenderer->makeKnownLink(
190 [
'redirect' =>
'no' ]
193 $titleB = Title::makeTitle( $deep->b_namespace, $deep->b_title );
195 $titleBFrag = Title::makeTitle( $deep->b_namespace, $deep->b_title, $deep->b_fragment );
196 $linkB = $linkRenderer->makeKnownLink(
198 $titleBFrag->getFullText(),
200 [
'redirect' =>
'no' ]
203 $titleC = Title::makeTitle(
209 $linkC = $linkRenderer->makeKnownLink( $titleC, $titleC->getFullText() );
212 $arr = $lang->getArrow() . $lang->getDirMark();
214 return (
"{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
219 parent::execute( $par );
229 if ( !$res->numRows() ) {
233 $batch = $this->linkBatchFactory->newLinkBatch();
234 foreach ( $res as $row ) {
235 $batch->add( $row->namespace, $row->title );
236 if ( isset( $row->b_namespace ) ) {
238 $batch->add( $row->b_namespace, $row->b_title );
240 if ( isset( $row->c_interwiki ) && !$row->c_interwiki ) {
242 $batch->add( $row->c_namespace, $row->c_title );
252 return 'maintenance';
257class_alias( SpecialDoubleRedirects::class,
'SpecialDoubleRedirects' );
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)
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getAuthority()
Shortcut to get the Authority executing this instance.
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.