33 return 'markpatrolled';
52 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
54 $rc = RecentChange::newFromId( $rcId );
57 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
65 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
68 $revId = $rc->getAttribute(
'rc_this_oldid' );
70 'curid' => $rc->getAttribute(
'rc_cur_id' ),
72 'oldid' => $rc->getAttribute(
'rc_last_oldid' )
74 $revlink = $linkRenderer->makeLink(
$title, $revId, [], $query );
75 $pagelink = $linkRenderer->makeLink(
$title,
$title->getPrefixedText() );
77 return $this->
msg(
'confirm-markpatrolled-top' )->params(
98 $errors = $rc->doMarkPatrolled( $user );
100 if ( in_array( [
'rcpatroldisabled' ], $errors ) ) {
101 throw new ErrorPageError(
'rcpatroldisabled',
'rcpatroldisabledtext' );
106 if ( $rc->getAttribute(
'rc_type' ) ==
RC_NEW ) {
107 $returnTo =
'Newpages';
108 } elseif ( $rc->getAttribute(
'rc_log_type' ) ==
'upload' ) {
109 $returnTo =
'Newfiles';
111 $returnTo =
'Recentchanges';
113 $return = SpecialPage::getTitleFor( $returnTo );
115 if ( in_array( [
'markedaspatrollederror-noautopatrol' ], $errors ) ) {
116 $this->
getOutput()->setPageTitle( $this->
msg(
'markedaspatrollederror' ) );
117 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
118 $this->
getOutput()->returnToMain(
null, $return );
123 if ( !in_array( [
'hookaborted' ], $errors ) ) {
130 $this->
getOutput()->setPageTitle( $this->
msg(
'markedaspatrolled' ) );
131 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
132 $this->
getOutput()->returnToMain(
null, $return );
getOutput()
Get the OutputPage being used for this instance.
getUser()
Shortcut to get the User 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.
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.
doesWrites()
Indicates whether this action may perform database writes.
usesOOUI()
Whether the form should use OOUI.
getRecentChange( $data=null)
getDescription()
Returns the description that goes below the <h1> tag.
getRestriction()
Get the permission required to perform this action.
onSuccess()
Do something exciting on successful processing of the form.
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.