33 return 'markpatrolled';
48 $rcId = $data ? intval( $data[
'rcid'] ) : $this->
getRequest()->getInt(
'rcid' );
53 throw new ErrorPageError(
'markedaspatrollederror',
'markedaspatrollederrortext' );
60 $title = $rc->getTitle();
61 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
64 $revId = $rc->getAttribute(
'rc_this_oldid' );
66 'curid' => $rc->getAttribute(
'rc_cur_id' ),
68 'oldid' => $rc->getAttribute(
'rc_last_oldid' )
71 $pagelink =
$linkRenderer->makeLink( $title, $title->getPrefixedText() );
73 return $this->
msg(
'confirm-markpatrolled-top' )->params(
74 $title->getPrefixedText(),
76 Message::rawParam( $pagelink ),
77 Message::rawParam( $revlink )
82 $form->addHiddenField(
'rcid', $this->
getRequest()->getInt(
'rcid' ) );
83 $form->setTokenSalt(
'patrol' );
84 $form->setSubmitTextMsg(
'confirm-markpatrolled-button' );
94 $errors = $rc->doMarkPatrolled( $user );
96 if ( in_array( [
'rcpatroldisabled' ], $errors ) ) {
97 throw new ErrorPageError(
'rcpatroldisabled',
'rcpatroldisabledtext' );
102 if ( $rc->getAttribute(
'rc_type' ) ==
RC_NEW ) {
103 $returnTo =
'Newpages';
104 } elseif ( $rc->getAttribute(
'rc_log_type' ) ==
'upload' ) {
105 $returnTo =
'Newfiles';
107 $returnTo =
'Recentchanges';
111 if ( in_array( [
'markedaspatrollederror-noautopatrol' ], $errors ) ) {
112 $this->
getOutput()->setPageTitle( $this->
msg(
'markedaspatrollederror' ) );
113 $this->
getOutput()->addWikiMsg(
'markedaspatrollederror-noautopatrol' );
114 $this->
getOutput()->returnToMain(
null, $return );
119 if ( !in_array( [
'hookaborted' ], $errors ) ) {
126 $this->
getOutput()->setPageTitle( $this->
msg(
'markedaspatrolled' ) );
127 $this->
getOutput()->addWikiMsg(
'markedaspatrolledtext', $rc->getTitle()->getPrefixedText() );
128 $this->
getOutput()->returnToMain(
null, $return );
getOutput()
Get the OutputPage being used for this instance.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Shortcut to get the User being used for this instance.
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.
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.
static newFromId( $rcid)
Obtain the recent change with a given rc_id value.
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,...
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer