MediaWiki fundraising/REL1_35
EditAction.php
Go to the documentation of this file.
1<?php
30
35 public function getName() {
36 return 'edit';
37 }
38
43 public function onView() {
44 return null;
45 }
46
50 public function show() {
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}
getHookRunner()
Definition Action.php:329
Article $article
Definition Action.php:59
getTitle()
Shortcut to get the Title object from the page.
Definition Action.php:299
getContext()
Get the IContextSource in use here.
Definition Action.php:215
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:239
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:249
getArticle()
Get a Article object.
Definition Action.php:289
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition Action.php:546
Page edition handler (action=edit)
getName()
Stable to override.
doesWrites()
Indicates whether this action may perform database writes.
show()
Stable to override.
onView()
Stable to override.
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition EditPage.php:62
An action which just does something, without showing a form first.