57 parent::__construct(
'DoubleRedirects' );
58 $this->contentHandlerFactory = $contentHandlerFactory;
59 $this->linkBatchFactory = $linkBatchFactory;
76 return $this->
msg(
'doubleredirectstext' )->parseAsBlock();
79 private function reallyGetQueryInfo( $namespace =
null, $title =
null ) {
80 $limitToTitle = !( $namespace ===
null && $title === null );
89 'namespace' =>
'pa.page_namespace',
90 'title' =>
'pa.page_title',
92 'b_namespace' =>
'pb.page_namespace',
93 'b_title' =>
'pb.page_title',
94 'b_fragment' =>
'ra.rd_fragment',
98 'c_namespace' =>
'rb.rd_namespace',
99 'c_title' =>
'rb.rd_title',
100 'c_fragment' =>
'rb.rd_fragment',
101 'c_interwiki' =>
'rb.rd_interwiki',
104 'ra.rd_from = pa.page_id',
110 'ra.rd_interwiki' =>
'',
112 'pb.page_namespace = ra.rd_namespace',
113 'pb.page_title = ra.rd_title',
115 'rb.rd_from = pb.page_id',
119 if ( $limitToTitle ) {
120 $retval[
'conds'][
'pa.page_namespace'] = $namespace;
121 $retval[
'conds'][
'pa.page_title'] = $title;
128 return $this->reallyGetQueryInfo();
132 return [
'ra.rd_namespace',
'ra.rd_title' ];
148 if ( isset( $result->b_namespace ) ) {
151 $qi = $this->reallyGetQueryInfo(
157 ->caller( __METHOD__ )
162 $titleA = Title::makeTitle( $result->namespace, $result->title );
166 return '<del>' . $linkRenderer->makeLink( $titleA,
null, [], [
'redirect' =>
'no' ] ) .
'</del>';
174 $this->contentHandlerFactory->getContentHandler( $titleA->getContentModel() )
175 ->supportsDirectEditing()
177 $edit = $linkRenderer->makeKnownLink(
179 $this->
msg(
'parentheses', $this->
msg(
'editlink' )->text() )->text(),
181 [
'action' =>
'edit' ]
187 $linkA = $linkRenderer->makeKnownLink(
191 [
'redirect' =>
'no' ]
194 $titleB = Title::makeTitle( $deep->b_namespace, $deep->b_title );
196 $titleBFrag = Title::makeTitle( $deep->b_namespace, $deep->b_title, $deep->b_fragment );
197 $linkB = $linkRenderer->makeKnownLink(
199 $titleBFrag->getFullText(),
201 [
'redirect' =>
'no' ]
204 $titleC = Title::makeTitle(
210 $linkC = $linkRenderer->makeKnownLink( $titleC, $titleC->getFullText() );
213 $arr = $lang->getArrow() . $lang->getDirMark();
215 return (
"{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
220 parent::execute( $par );
230 if ( !$res->numRows() ) {
234 $batch = $this->linkBatchFactory->newLinkBatch();
235 foreach ( $res as $row ) {
236 $batch->add( $row->namespace, $row->title );
237 if ( isset( $row->b_namespace ) ) {
239 $batch->add( $row->b_namespace, $row->b_title );
241 if ( isset( $row->c_interwiki ) && !$row->c_interwiki ) {
243 $batch->add( $row->c_namespace, $row->c_title );
253 return 'maintenance';
258class_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.