@@ 33-60 (lines=28) @@ | ||
30 | * |
|
31 | * @ingroup Actions |
|
32 | */ |
|
33 | class DeleteAction extends FormlessAction { |
|
34 | ||
35 | public function getName() { |
|
36 | return 'delete'; |
|
37 | } |
|
38 | ||
39 | public function onView() { |
|
40 | return null; |
|
41 | } |
|
42 | ||
43 | public function show() { |
|
44 | $this->useTransactionalTimeLimit(); |
|
45 | ||
46 | $out = $this->getOutput(); |
|
47 | if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) { |
|
48 | $out->addModuleStyles( [ |
|
49 | 'mediawiki.ui.input', |
|
50 | 'mediawiki.ui.checkbox', |
|
51 | ] ); |
|
52 | } |
|
53 | $this->addHelpLink( 'Help:Sysop deleting and undeleting' ); |
|
54 | $this->page->delete(); |
|
55 | } |
|
56 | ||
57 | public function doesWrites() { |
|
58 | return true; |
|
59 | } |
|
60 | } |
|
61 |
@@ 33-58 (lines=26) @@ | ||
30 | * |
|
31 | * @ingroup Actions |
|
32 | */ |
|
33 | class ProtectAction extends FormlessAction { |
|
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 | } |
|
59 |