MediaWiki master
ProtectAction.php
Go to the documentation of this file.
1<?php
8namespace MediaWiki\Actions;
9
18
20 public function getName() {
21 return 'protect';
22 }
23
25 public function onView() {
26 return null;
27 }
28
30 public function show() {
31 $this->getArticle()->protect();
32 }
33
35 public function doesWrites() {
36 return true;
37 }
38}
39
41class_alias( ProtectAction::class, 'ProtectAction' );
getArticle()
Get a Article object.
Definition Action.php:203
An action which just does something, without showing a form first.
Handle page protection (action=protect)
onView()
Show something on GET request.string|null Will be added to the HTMLForm if present,...
doesWrites()
Indicates whether POST requests handled by this action require write access to the wiki....
getName()
Return the name of the action this object responds to.1.17string Lowercase name