MediaWiki REL1_31
EditAction.php
Go to the documentation of this file.
1<?php
34
35 public function getName() {
36 return 'edit';
37 }
38
39 public function onView() {
40 return null;
41 }
42
43 public function show() {
45
46 $out = $this->getOutput();
47 $out->setRobotPolicy( 'noindex,nofollow' );
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}
$page
Page on which we're performing the action.
Definition Action.php:44
getTitle()
Shortcut to get the Title object from the page.
Definition Action.php:246
getContext()
Get the IContextSource in use here.
Definition Action.php:178
getOutput()
Get the OutputPage being used for this instance.
Definition Action.php:207
getUser()
Shortcut to get the User being used for this instance.
Definition Action.php:217
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition Action.php:416
Page edition handler.
getName()
Return the name of the action this object responds to.
doesWrites()
Indicates whether this action may perform database writes.
show()
The main action entry point.
onView()
Show something on GET request.
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Definition EditPage.php:44
An action which just does something, without showing a form first.
passed in as a query string parameter to the various URLs constructed here(i.e. $prevlink) $ldel you ll need to handle error etc yourself modifying $error and returning true will cause the contents of $error to be echoed at the top of the edit form as wikitext Return true without altering $error to allow the edit to proceed & $editor
Definition hooks.txt:1419
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
Definition hooks.txt:864