MediaWiki
master
EditAction.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Actions
;
22
23
use
MediaWiki\EditPage\EditPage
;
24
33
class
EditAction
extends
FormlessAction
{
34
39
public
function
getName
() {
40
return
'edit'
;
41
}
42
47
public
function
onView
() {
48
return
null
;
49
}
50
54
public
function
show
() {
55
$this->
useTransactionalTimeLimit
();
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
78
class_alias( EditAction::class,
'EditAction'
);
MediaWiki\Actions\Action\getHookRunner
getHookRunner()
Definition
Action.php:272
MediaWiki\Actions\Action\getUser
getUser()
Shortcut to get the User being used for this instance.
Definition
Action.php:166
MediaWiki\Actions\Action\getTitle
getTitle()
Shortcut to get the Title object from the page.
Definition
Action.php:226
MediaWiki\Actions\Action\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition
Action.php:494
MediaWiki\Actions\Action\getArticle
getArticle()
Get a Article object.
Definition
Action.php:216
MediaWiki\Actions\Action\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition
Action.php:156
MediaWiki\Actions\EditAction
Page edition handler (action=edit)
Definition
EditAction.php:33
MediaWiki\Actions\EditAction\doesWrites
doesWrites()
Indicates whether POST requests handled by this action require write access to the wiki.
Definition
EditAction.php:72
MediaWiki\Actions\EditAction\show
show()
Definition
EditAction.php:54
MediaWiki\Actions\EditAction\getName
getName()
Definition
EditAction.php:39
MediaWiki\Actions\EditAction\onView
onView()
Definition
EditAction.php:47
MediaWiki\Actions\FormlessAction
An action which just does something, without showing a form first.
Definition
FormlessAction.php:32
MediaWiki\EditPage\EditPage
The HTML user interface for page editing.
Definition
EditPage.php:152
MediaWiki\Actions
Definition
Action.php:22
includes
actions
EditAction.php
Generated on Wed Apr 30 2025 22:27:36 for MediaWiki by
1.10.0