MediaWiki  master
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->getArticle()->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:30
Action\getContext
getContext()
Get the IContextSource in use here.
Definition: Action.php:215
ProtectAction\doesWrites
doesWrites()
Indicates whether this action may perform database writes.
Definition: ProtectAction.php:50
Action\getArticle
getArticle()
Get a Article object.
Definition: Action.php:289
ProtectAction\show
show()
Stable to override.
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:239
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