45 parent::__construct( $article,
$context );
46 $this->linkRenderer = $linkRenderer;
50 return 'markpatrolled';
69 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
74 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
81 $title = $rc->getTitle();
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(
94 $title->getPrefixedText(),
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';
128 $return = SpecialPage::getTitleFor( $returnTo );
130 if ( in_array( [
'markedaspatrollederror-noautopatrol' ], $errors ) ) {
131 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrollederror' ) );
132 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
133 $this->
getOutput()->returnToMain(
null, $return );
138 if ( !in_array( [
'hookaborted' ], $errors ) ) {
145 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrolled' ) );
146 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
147 $this->
getOutput()->returnToMain(
null, $return );
IContextSource null $context
IContextSource if specified; otherwise we'll use the Context from the Page.
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()
getAuthority()
Shortcut to get the Authority executing this instance.
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.
Parent class for all special pages.
Show an error when a user tries to do something they do not have the necessary permissions for.
static newFromId( $rcid)
Obtain the recent change with a given rc_id value.
Interface for objects which can provide a MediaWiki context on request.