MediaWiki
REL1_37
EditAction.php
Go to the documentation of this file.
1
<?php
29
class
EditAction
extends
FormlessAction
{
30
35
public
function
getName
() {
36
return
'edit'
;
37
}
38
43
public
function
onView
() {
44
return
null
;
45
}
46
50
public
function
show
() {
51
$this->
useTransactionalTimeLimit
();
52
53
$out = $this->
getOutput
();
54
$out->setRobotPolicy(
'noindex,nofollow'
);
55
56
// The editor should always see the latest content when starting their edit.
57
// Also to ensure cookie blocks can be set (T152462).
58
$out->enableClientCache(
false
);
59
60
if
( $this->
getContext
()->getConfig()->
get
(
'UseMediaWikiUIEverywhere'
) ) {
61
$out->addModuleStyles( [
62
'mediawiki.ui.input'
,
63
'mediawiki.ui.checkbox'
,
64
] );
65
}
66
67
$article
= $this->
getArticle
();
68
if
( $this->
getHookRunner
()->onCustomEditor(
$article
, $this->
getUser
() ) ) {
69
$editor =
new
EditPage
(
$article
);
70
$editor->setContextTitle( $this->
getTitle
() );
71
$editor->edit();
72
}
73
}
74
75
public
function
doesWrites
() {
76
return
true
;
77
}
78
}
Action\getHookRunner
getHookRunner()
Definition
Action.php:247
Action\$article
Article $article
Definition
Action.php:59
Action\getTitle
getTitle()
Shortcut to get the Title object from the page.
Definition
Action.php:216
Action\getContext
getContext()
Get the IContextSource in use here.
Definition
Action.php:132
Action\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition
Action.php:156
Action\getUser
getUser()
Shortcut to get the User being used for this instance.
Definition
Action.php:166
Action\getArticle
getArticle()
Get a Article object.
Definition
Action.php:206
Action\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition
Action.php:470
EditAction
Page edition handler (action=edit)
Definition
EditAction.php:29
EditAction\getName
getName()
Definition
EditAction.php:35
EditAction\doesWrites
doesWrites()
Indicates whether this action may perform database writes.
Definition
EditAction.php:75
EditAction\show
show()
Definition
EditAction.php:50
EditAction\onView
onView()
Definition
EditAction.php:43
EditPage
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition
EditPage.php:88
FormlessAction
An action which just does something, without showing a form first.
Definition
FormlessAction.php:30
includes
actions
EditAction.php
Generated on Fri Apr 5 2024 23:39:55 for MediaWiki by
1.9.8