MediaWiki master
EditAction.php
Go to the documentation of this file.
1<?php
8namespace MediaWiki\Actions;
9
11
21
26 public function getName() {
27 return 'edit';
28 }
29
34 public function onView() {
35 return null;
36 }
37
41 public function show() {
43
44 $out = $this->getOutput();
45 $out->setRobotPolicy( 'noindex,nofollow' );
46
47 // The editor should always see the latest content when starting their edit.
48 // Also to ensure cookie blocks can be set (T152462).
49 $out->disableClientCache();
50
51 $article = $this->getArticle();
52 if ( $this->getHookRunner()->onCustomEditor( $article, $this->getUser() ) ) {
53 $editor = new EditPage( $article );
54 $editor->setContextTitle( $this->getTitle() );
55 $editor->edit();
56 }
57 }
58
60 public function doesWrites() {
61 return true;
62 }
63}
64
66class_alias( EditAction::class, 'EditAction' );
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:133
getTitle()
Shortcut to get the Title object from the page.
Definition Action.php:193
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition Action.php:451
getArticle()
Get a Article object.
Definition Action.php:183
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:123
Page edition handler (action=edit)
doesWrites()
Indicates whether POST requests handled by this action require write access to the wiki....
An action which just does something, without showing a form first.
The HTML user interface for page editing.
Definition EditPage.php:139