33 private $linkRenderer;
45 parent::__construct( $article, $context );
46 $this->linkRenderer = $linkRenderer;
50 return 'markpatrolled';
69 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
71 $rc = RecentChange::newFromId( $rcId );
74 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
84 $revId = $rc->getAttribute(
'rc_this_oldid' );
86 'curid' => $rc->getAttribute(
'rc_cur_id' ),
88 'oldid' => $rc->getAttribute(
'rc_last_oldid' )
90 $revlink = $this->linkRenderer->makeLink(
$title, $revId, [], $query );
91 $pagelink = $this->linkRenderer->makeLink(
$title,
$title->getPrefixedText() );
93 return $this->
msg(
'confirm-markpatrolled-top' )->params(
113 $errors = $rc->doMarkPatrolled( $this->
getAuthority() );
115 if ( in_array( [
'rcpatroldisabled' ], $errors ) ) {
116 throw new ErrorPageError(
'rcpatroldisabled',
'rcpatroldisabledtext' );
121 if ( $rc->getAttribute(
'rc_type' ) ==
RC_NEW ) {
122 $returnTo =
'Newpages';
123 } elseif ( $rc->getAttribute(
'rc_log_type' ) ==
'upload' ) {
124 $returnTo =
'Newfiles';
126 $returnTo =
'Recentchanges';
130 if ( in_array( [
'markedaspatrollederror-noautopatrol' ], $errors ) ) {
131 $this->
getOutput()->setPageTitle( $this->
msg(
'markedaspatrollederror' ) );
132 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
133 $this->
getOutput()->returnToMain(
null, $return );
138 if ( !in_array( [
'hookaborted' ], $errors ) ) {
145 $this->
getOutput()->setPageTitle( $this->
msg(
'markedaspatrolled' ) );
146 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
147 $this->
getOutput()->returnToMain(
null, $return );
getOutput()
Get the OutputPage being used for this instance.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
getRequest()
Get the WebRequest being used for this instance.
Legacy class representing an editable page and handling UI for some page actions.
An error page which can definitely be safely rendered using the OutputPage.
Mark a revision as patrolled on a page.
getName()
Return the name of the action this object responds to.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
usesOOUI()
Whether the form should use OOUI.
getRecentChange( $data=null)
getDescription()
Returns the description that goes below the <h1> element.
getRestriction()
Get the permission required to perform this action.
onSuccess()
Do something exciting on successful processing of the form.
__construct(Article $article, IContextSource $context, LinkRenderer $linkRenderer)
preText()
Add pre- or post-text to the form.
Show an error when a user tries to do something they do not have the necessary permissions for.
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,...
Interface for objects which can provide a MediaWiki context on request.