summaryrefslogtreecommitdiff
path: root/includes/actions/EditAction.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/actions/EditAction.php')
-rw-r--r--includes/actions/EditAction.php35
1 files changed, 20 insertions, 15 deletions
diff --git a/includes/actions/EditAction.php b/includes/actions/EditAction.php
index 08a33f4c..3dd4c483 100644
--- a/includes/actions/EditAction.php
+++ b/includes/actions/EditAction.php
@@ -23,46 +23,51 @@
* @author Timo Tijhof
*/
+/**
+ * Page edition handler
+ *
+ * This is a wrapper that will call the EditPage class, or ExternalEdit
+ * if $wgUseExternalEditor is set to true and requested by the user.
+ *
+ * @ingroup Actions
+ */
class EditAction extends FormlessAction {
public function getName() {
return 'edit';
}
- public function onView(){
+ public function onView() {
return null;
}
- public function show(){
+ public function show() {
$page = $this->page;
- $request = $this->getRequest();
$user = $this->getUser();
- $context = $this->getContext();
if ( wfRunHooks( 'CustomEditor', array( $page, $user ) ) ) {
- if ( ExternalEdit::useExternalEngine( $context, 'edit' )
- && $this->getName() == 'edit' && !$request->getVal( 'section' )
- && !$request->getVal( 'oldid' ) )
- {
- $extedit = new ExternalEdit( $context );
- $extedit->execute();
- } else {
- $editor = new EditPage( $page );
- $editor->edit();
- }
+ $editor = new EditPage( $page );
+ $editor->edit();
}
}
}
+/**
+ * Edit submission handler
+ *
+ * This is the same as EditAction; except that it sets the session cookie.
+ *
+ * @ingroup Actions
+ */
class SubmitAction extends EditAction {
public function getName() {
return 'submit';
}
- public function show(){
+ public function show() {
if ( session_id() == '' ) {
// Send a cookie so anons get talk message notifications
wfSetupSession();