MediaWiki  1.34.0
ProtectAction.php
Go to the documentation of this file.
1 <?php
29 
30  public function getName() {
31  return 'protect';
32  }
33 
34  public function onView() {
35  return null;
36  }
37 
38  public function show() {
39  if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
40  $out = $this->getOutput();
41  $out->addModuleStyles( [
42  'mediawiki.ui.input',
43  'mediawiki.ui.checkbox',
44  ] );
45  }
46 
47  $this->page->protect();
48  }
49 
50  public function doesWrites() {
51  return true;
52  }
53 }
FormlessAction
An action which just does something, without showing a form first.
Definition: FormlessAction.php:28
Action\getContext
getContext()
Get the IContextSource in use here.
Definition: Action.php:179
ProtectAction\doesWrites
doesWrites()
Indicates whether this action may perform database writes.
Definition: ProtectAction.php:50
ProtectAction\show
show()
The main action entry point.
Definition: ProtectAction.php:38
ProtectAction
Handle page protection (action=protect)
Definition: ProtectAction.php:28
Action\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: Action.php:208
ProtectAction\onView
onView()
Show something on GET request.
Definition: ProtectAction.php:34
ProtectAction\getName
getName()
Return the name of the action this object responds to.
Definition: ProtectAction.php:30