MediaWiki REL1_40
EditAction.php
Go to the documentation of this file.
1<?php
23
33
38 public function getName() {
39 return 'edit';
40 }
41
46 public function onView() {
47 return null;
48 }
49
53 public function show() {
55
56 $out = $this->getOutput();
57 $out->setRobotPolicy( 'noindex,nofollow' );
58
59 // The editor should always see the latest content when starting their edit.
60 // Also to ensure cookie blocks can be set (T152462).
61 $out->disableClientCache();
62
63 if ( $this->getContext()->getConfig()->get( MainConfigNames::UseMediaWikiUIEverywhere ) ) {
64 $out->addModuleStyles( [
65 'mediawiki.ui.input',
66 'mediawiki.ui.checkbox',
67 ] );
68 }
69
70 $article = $this->getArticle();
71 if ( $this->getHookRunner()->onCustomEditor( $article, $this->getUser() ) ) {
72 $editor = new EditPage( $article );
73 $editor->setContextTitle( $this->getTitle() );
74 $editor->edit();
75 }
76 }
77
78 public function doesWrites() {
79 return true;
80 }
81}
getHookRunner()
Definition Action.php:265
getTitle()
Shortcut to get the Title object from the page.
Definition Action.php:221
getContext()
Get the IContextSource in use here.
Definition Action.php:127
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:151
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:161
getArticle()
Get a Article object.
Definition Action.php:211
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition Action.php:457
Page edition handler (action=edit)
doesWrites()
Indicates whether this action may perform database writes.
An action which just does something, without showing a form first.
The HTML user interface for page editing.
Definition EditPage.php:149
A class containing constants representing the names of configuration variables.