MediaWiki fundraising/REL1_35
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}
getContext()
Get the IContextSource in use here.
Definition Action.php:215
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:239
getArticle()
Get a Article object.
Definition Action.php:289
An action which just does something, without showing a form first.
Handle page protection (action=protect)
doesWrites()
Indicates whether this action may perform database writes.
getName()
Return the name of the action this object responds to.
onView()
Show something on GET request.
show()
Stable to override.