MediaWiki  1.34.0
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  if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
44  $out->addModuleStyles( [
45  'mediawiki.ui.input',
46  'mediawiki.ui.checkbox',
47  ] );
48  }
50  $user = $this->getUser();
51 
52  if ( Hooks::run( 'CustomEditor', [ $page, $user ] ) ) {
53  $editor = new EditPage( $page );
54  $editor->setContextTitle( $this->getTitle() );
55  $editor->edit();
56  }
57  }
58 
59  public function doesWrites() {
60  return true;
61  }
62 }
FormlessAction
An action which just does something, without showing a form first.
Definition: FormlessAction.php:28
EditAction\doesWrites
doesWrites()
Indicates whether this action may perform database writes.
Definition: EditAction.php:59
EditAction\getName
getName()
Return the name of the action this object responds to.
Definition: EditAction.php:30
Action\getContext
getContext()
Get the IContextSource in use here.
Definition: Action.php:179
Action\getUser
getUser()
Shortcut to get the User being used for this instance.
Definition: Action.php:218
EditAction\show
show()
The main action entry point.
Definition: EditAction.php:38
Action\getTitle
getTitle()
Shortcut to get the Title object from the page.
Definition: Action.php:247
EditPage
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition: EditPage.php:46
EditAction\onView
onView()
Show something on GET request.
Definition: EditAction.php:34
Action\$page
$page
Page on which we're performing the action.
Definition: Action.php:46
Action\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: Action.php:208
Action\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: Action.php:422
EditAction
Page edition handler (action=edit)
Definition: EditAction.php:28
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200