$newPass: new password
$error: error (string) 'badretype', 'wrongpassword', 'error' or 'success'
+'ProtectionForm::buildForm': called after all protection type fieldsets are made in the form
+$article: the title being (un)protected
+$output: a string of the form HTML so far
+
+'ProtectionForm::showLogExtract': called after the protection log extract is shown
+$article: the page the form is shown for
+$out: OutputPage object
+
+'ProtectionForm::save': called when a protection form is submitted
+$article: the title being (un)protected
+$errorMsg: an html message string of an error
+
'RawPageViewBeforeOutput': Right before the text is blown out in action=raw
&$obj: RawPage object
&$text: The text that's going to be the output
throw new FatalError( "Unknown error at restriction save time." );
}
+ $errorMsg = '';
+ # Give extensions a change to handle added form items
+ if( !wfRunHooks( 'ProtectionForm::save', array($this->mArticle,&$errorMsg) ) ) {
+ throw new FatalError( "Unknown hook error at restriction save time." );
+ }
+ if( $errorMsg != '' ) {
+ $this->show( $errorMsg );
+ return false;
+ }
+
if( $wgRequest->getCheck( 'mwProtectWatch' ) ) {
$this->mArticle->doWatch();
} elseif( $this->mTitle->userIsWatching() ) {
Xml::closeElement( 'fieldset' ) .
"</td></tr>";
}
+ # Give extensions a chance to add items to the form
+ wfRunHooks( 'ProtectionForm::buildForm', array($this->mArticle,&$out) );
$out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
# Show relevant lines from the protection log:
$out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'protect' ) ) );
LogEventsList::showLogExtract( $out, 'protect', $this->mTitle->getPrefixedText() );
+ # Let extensions add other relevant log extracts
+ wfRunHooks( 'ProtectionForm::showLogExtract', array($this->mArticle,$out) );
}
}