MediaWiki  master
EditAction.php
Go to the documentation of this file.
1 <?php
28 class EditAction extends FormlessAction {
29 
30  public function getName() {
31  return 'edit';
32  }
33 
34  public function onView() {
35  return null;
36  }
37 
38  public function show() {
40 
41  $out = $this->getOutput();
42  $out->setRobotPolicy( 'noindex,nofollow' );
43 
44  // The editor should always see the latest content when starting their edit.
45  // Also to ensure cookie blocks can be set (T152462).
46  $out->enableClientCache( false );
47 
48  if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
49  $out->addModuleStyles( [
50  'mediawiki.ui.input',
51  'mediawiki.ui.checkbox',
52  ] );
53  }
55  $user = $this->getUser();
56 
57  if ( Hooks::run( 'CustomEditor', [ $page, $user ] ) ) {
58  $editor = new EditPage( $page );
59  $editor->setContextTitle( $this->getTitle() );
60  $editor->edit();
61  }
62  }
63 
64  public function doesWrites() {
65  return true;
66  }
67 }
getOutput()
Get the OutputPage being used for this instance.
Definition: Action.php:208
Page edition handler (action=edit)
Definition: EditAction.php:28
getTitle()
Shortcut to get the Title object from the page.
Definition: Action.php:247
getUser()
Shortcut to get the User being used for this instance.
Definition: Action.php:218
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition: EditPage.php:47
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: Action.php:427
getContext()
Get the IContextSource in use here.
Definition: Action.php:179
WikiPage Article ImagePage CategoryPage Page $page
Page on which we&#39;re performing the action.
Definition: Action.php:46
An action which just does something, without showing a form first.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200