MediaWiki REL1_39
EditAction.php
Go to the documentation of this file.
1<?php
22
32
37 public function getName() {
38 return 'edit';
39 }
40
45 public function onView() {
46 return null;
47 }
48
52 public function show() {
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}
getHookRunner()
Definition Action.php:261
getTitle()
Shortcut to get the Title object from the page.
Definition Action.php:230
getContext()
Get the IContextSource in use here.
Definition Action.php:136
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:160
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:170
getArticle()
Get a Article object.
Definition Action.php:220
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition Action.php:485
Page edition handler (action=edit)
doesWrites()
Indicates whether this action may perform database writes.
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition EditPage.php:103
An action which just does something, without showing a form first.
A class containing constants representing the names of configuration variables.