MediaWiki
REL1_39
EditAction.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\MainConfigNames
;
22
31
class
EditAction
extends
FormlessAction
{
32
37
public
function
getName
() {
38
return
'edit'
;
39
}
40
45
public
function
onView
() {
46
return
null
;
47
}
48
52
public
function
show
() {
53
$this->
useTransactionalTimeLimit
();
54
55
$out = $this->
getOutput
();
56
$out->setRobotPolicy(
'noindex,nofollow'
);
57
58
// The editor should always see the latest content when starting their edit.
59
// Also to ensure cookie blocks can be set (T152462).
60
$out->disableClientCache();
61
62
if
( $this->
getContext
()->getConfig()->
get
( MainConfigNames::UseMediaWikiUIEverywhere ) ) {
63
$out->addModuleStyles( [
64
'mediawiki.ui.input'
,
65
'mediawiki.ui.checkbox'
,
66
] );
67
}
68
69
$article = $this->
getArticle
();
70
if
( $this->
getHookRunner
()->onCustomEditor( $article, $this->
getUser
() ) ) {
71
$editor =
new
EditPage
( $article );
72
$editor->setContextTitle( $this->
getTitle
() );
73
$editor->edit();
74
}
75
}
76
77
public
function
doesWrites
() {
78
return
true
;
79
}
80
}
Action\getHookRunner
getHookRunner()
Definition
Action.php:261
Action\getTitle
getTitle()
Shortcut to get the Title object from the page.
Definition
Action.php:230
Action\getContext
getContext()
Get the IContextSource in use here.
Definition
Action.php:136
Action\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition
Action.php:160
Action\getUser
getUser()
Shortcut to get the User being used for this instance.
Definition
Action.php:170
Action\getArticle
getArticle()
Get a Article object.
Definition
Action.php:220
Action\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition
Action.php:485
EditAction
Page edition handler (action=edit)
Definition
EditAction.php:31
EditAction\getName
getName()
Definition
EditAction.php:37
EditAction\doesWrites
doesWrites()
Indicates whether this action may perform database writes.
Definition
EditAction.php:77
EditAction\show
show()
Definition
EditAction.php:52
EditAction\onView
onView()
Definition
EditAction.php:45
EditPage
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition
EditPage.php:103
FormlessAction
An action which just does something, without showing a form first.
Definition
FormlessAction.php:30
MediaWiki\MainConfigNames
A class containing constants representing the names of configuration variables.
Definition
MainConfigNames.php:23
includes
actions
EditAction.php
Generated on Thu Nov 21 2024 05:22:15 for MediaWiki by
1.10.0