MediaWiki REL1_30
ProtectAction.php
Go to the documentation of this file.
1<?php
34
35 public function getName() {
36 return 'protect';
37 }
38
39 public function onView() {
40 return null;
41 }
42
43 public function show() {
44 if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
45 $out = $this->getOutput();
46 $out->addModuleStyles( [
47 'mediawiki.ui.input',
48 'mediawiki.ui.checkbox',
49 ] );
50 }
51
52 $this->page->protect();
53 }
54
55 public function doesWrites() {
56 return true;
57 }
58}
getContext()
Get the IContextSource in use here.
Definition Action.php:178
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:207
An action which just does something, without showing a form first.
Handle page protection.
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()
The main action entry point.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
Definition hooks.txt:862