39 parent::__construct( $article,
$context );
44 return 'markpatrolled';
70 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
72 $rc = $this->recentChangeLookup->getRecentChangeById( $rcId );
75 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
83 $title = $rc->getTitle();
86 $revId = $rc->getAttribute(
'rc_this_oldid' );
88 'curid' => $rc->getAttribute(
'rc_cur_id' ),
90 'oldid' => $rc->getAttribute(
'rc_last_oldid' )
92 $revlink = $this->linkRenderer->makeLink( $title, $revId, [], $query );
93 $pagelink = $this->linkRenderer->makeLink( $title, $title->getPrefixedText() );
95 return $this->
msg(
'confirm-markpatrolled-top' )->params(
96 $title->getPrefixedText(),
115 $status = $this->patrolManager->markPatrolled( $rc, $this->
getAuthority() );
117 if ( $status->hasMessage(
'rcpatroldisabled' ) ) {
118 throw new ErrorPageError(
'rcpatroldisabled',
'rcpatroldisabledtext' );
123 if ( $rc->getAttribute(
'rc_source' ) === RecentChange::SRC_NEW ) {
124 $returnTo =
'Newpages';
125 } elseif ( $rc->getAttribute(
'rc_log_type' ) ==
'upload' ) {
126 $returnTo =
'Newfiles';
128 $returnTo =
'Recentchanges';
132 if ( $status->hasMessage(
'markedaspatrollederror-noautopatrol' ) ) {
133 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrollederror' ) );
134 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
135 $this->
getOutput()->returnToMain(
null, $return );
139 if ( !$status->isGood() ) {
140 if ( !$status->hasMessage(
'hookaborted' ) ) {
147 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrolled' ) );
148 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
149 $this->
getOutput()->returnToMain(
null, $return );
165class_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.