50 parent::__construct( $article,
$context );
52 $this->linkRenderer = $linkRenderer;
53 $this->patrolManager = $patrolManager;
54 $this->recentChangeLookup = $recentChangeLookup;
59 return 'markpatrolled';
85 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
87 $rc = $this->recentChangeLookup->getRecentChangeById( $rcId );
90 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
98 $title = $rc->getTitle();
101 $revId = $rc->getAttribute(
'rc_this_oldid' );
103 'curid' => $rc->getAttribute(
'rc_cur_id' ),
105 'oldid' => $rc->getAttribute(
'rc_last_oldid' )
107 $revlink = $this->linkRenderer->makeLink( $title, $revId, [], $query );
108 $pagelink = $this->linkRenderer->makeLink( $title, $title->getPrefixedText() );
110 return $this->
msg(
'confirm-markpatrolled-top' )->params(
111 $title->getPrefixedText(),
130 $status = $this->patrolManager->markPatrolled( $rc, $this->
getAuthority() );
132 if ( $status->hasMessage(
'rcpatroldisabled' ) ) {
133 throw new ErrorPageError(
'rcpatroldisabled',
'rcpatroldisabledtext' );
138 if ( $rc->getAttribute(
'rc_source' ) === RecentChange::SRC_NEW ) {
139 $returnTo =
'Newpages';
140 } elseif ( $rc->getAttribute(
'rc_log_type' ) ==
'upload' ) {
141 $returnTo =
'Newfiles';
143 $returnTo =
'Recentchanges';
147 if ( $status->hasMessage(
'markedaspatrollederror-noautopatrol' ) ) {
148 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrollederror' ) );
149 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
150 $this->
getOutput()->returnToMain(
null, $return );
154 if ( !$status->isGood() ) {
155 if ( !$status->hasMessage(
'hookaborted' ) ) {
162 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrolled' ) );
163 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
164 $this->
getOutput()->returnToMain(
null, $return );
180class_alias( MarkpatrolledAction::class,
'MarkpatrolledAction' );
An error page which can definitely be safely rendered using the OutputPage.
Legacy class representing an editable page and handling UI for some page actions.
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Interface for objects which can provide a MediaWiki context on request.