MediaWiki master
EditAction.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Actions;
22
24
34
39 public function getName() {
40 return 'edit';
41 }
42
47 public function onView() {
48 return null;
49 }
50
54 public function show() {
56
57 $out = $this->getOutput();
58 $out->setRobotPolicy( 'noindex,nofollow' );
59
60 // The editor should always see the latest content when starting their edit.
61 // Also to ensure cookie blocks can be set (T152462).
62 $out->disableClientCache();
63
64 $article = $this->getArticle();
65 if ( $this->getHookRunner()->onCustomEditor( $article, $this->getUser() ) ) {
66 $editor = new EditPage( $article );
67 $editor->setContextTitle( $this->getTitle() );
68 $editor->edit();
69 }
70 }
71
72 public function doesWrites() {
73 return true;
74 }
75}
76
78class_alias( EditAction::class, 'EditAction' );
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:166
getTitle()
Shortcut to get the Title object from the page.
Definition Action.php:226
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition Action.php:494
getArticle()
Get a Article object.
Definition Action.php:216
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:156
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:152