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