*/
/**
- * User-requested page cache purging.
- *
- * For users with 'purge', this will directly trigger the cache purging and
- * for users without that right, it will show a confirmation form.
+ * User-requested page cache purging
*
* @ingroup Actions
*/
return $this->page->doPurge();
}
- /**
- * purge is slightly weird because it can be either formed or formless depending
- * on user permissions
- */
public function show() {
$this->setHeaders();
return;
}
- if ( $user->isAllowed( 'purge' ) ) {
- // This will update the database immediately, even on HTTP GET.
- // Lots of uses may exist for this feature, so just ignore warnings.
- Profiler::instance()->getTransactionProfiler()->resetExpectations();
-
+ if ( $this->getRequest()->wasPosted() ) {
$this->redirectParams = wfArrayToCgi( array_diff_key(
$this->getRequest()->getQueryValues(),
[ 'title' => null, 'action' => null ]
}
}
- protected function alterForm( HTMLForm $form ) {
- $form->setSubmitTextMsg( 'confirm_purge_button' );
+ protected function usesOOUI() {
+ return true;
+ }
+
+ protected function getFormFields() {
+ return [
+ 'intro' => [
+ 'type' => 'info',
+ 'vertical-label' => true,
+ 'raw' => true,
+ 'default' => $this->msg( 'confirm-purge-top' )->parse()
+ ]
+ ];
}
- protected function preText() {
- return $this->msg( 'confirm-purge-top' )->parse();
+ protected function alterForm( HTMLForm $form ) {
+ $form->setWrapperLegendMsg( 'confirm-purge-title' );
+ $form->setSubmitTextMsg( 'confirm_purge_button' );
}
protected function postText() {