48 parent::__construct( $article, $context );
49 $this->linkRenderer = $linkRenderer;
53 return 'markpatrolled';
72 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
74 $rc = RecentChange::newFromId( $rcId );
77 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
84 $title = $rc->getTitle();
87 $revId = $rc->getAttribute(
'rc_this_oldid' );
89 'curid' => $rc->getAttribute(
'rc_cur_id' ),
91 'oldid' => $rc->getAttribute(
'rc_last_oldid' )
93 $revlink = $this->linkRenderer->makeLink( $title, $revId, [], $query );
94 $pagelink = $this->linkRenderer->makeLink( $title, $title->getPrefixedText() );
96 return $this->
msg(
'confirm-markpatrolled-top' )->params(
97 $title->getPrefixedText(),
99 Message::rawParam( $pagelink ),
100 Message::rawParam( $revlink )
118 if ( $status->hasMessage(
'rcpatroldisabled' ) ) {
119 throw new ErrorPageError(
'rcpatroldisabled',
'rcpatroldisabledtext' );
124 if ( $rc->getAttribute(
'rc_type' ) ==
RC_NEW ) {
125 $returnTo =
'Newpages';
126 } elseif ( $rc->getAttribute(
'rc_log_type' ) ==
'upload' ) {
127 $returnTo =
'Newfiles';
129 $returnTo =
'Recentchanges';
131 $return = SpecialPage::getTitleFor( $returnTo );
133 if ( $status->hasMessage(
'markedaspatrollederror-noautopatrol' ) ) {
134 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrollederror' ) );
135 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
136 $this->
getOutput()->returnToMain(
null, $return );
140 if ( !$status->isGood() ) {
141 if ( !$status->hasMessage(
'hookaborted' ) ) {
148 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'markedaspatrolled' ) );
149 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
150 $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()
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.
Interface for objects which can provide a MediaWiki context on request.