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->page->protect();
48  }
49 
50  public function doesWrites() {
51  return true;
52  }
53 }
getOutput()
Get the OutputPage being used for this instance.
Definition: Action.php:208
Handle page protection (action=protect)
getContext()
Get the IContextSource in use here.
Definition: Action.php:179
An action which just does something, without showing a form first.