MediaWiki  REL1_19
EditAction.php
Go to the documentation of this file.
00001 <?php
00026 class EditAction extends FormlessAction {
00027 
00028         public function getName() {
00029                 return 'edit';
00030         }
00031 
00032         public function onView(){
00033                 return null;
00034         }
00035 
00036         public function show(){
00037                 $page = $this->page;
00038                 $request = $this->getRequest();
00039                 $user = $this->getUser();
00040                 $context = $this->getContext();
00041 
00042                 if ( wfRunHooks( 'CustomEditor', array( $page, $user ) ) ) {
00043                         if ( ExternalEdit::useExternalEngine( $context, 'edit' )
00044                                 && $this->getName() == 'edit' && !$request->getVal( 'section' )
00045                                 && !$request->getVal( 'oldid' ) )
00046                         {
00047                                 $extedit = new ExternalEdit( $context );
00048                                 $extedit->execute();
00049                         } else {
00050                                 $editor = new EditPage( $page );
00051                                 $editor->edit();
00052                         }
00053                 }
00054 
00055         }
00056 
00057 }
00058 
00059 class SubmitAction extends EditAction {
00060 
00061         public function getName() {
00062                 return 'submit';
00063         }
00064 
00065         public function show(){
00066                 if ( session_id() == '' ) {
00067                         // Send a cookie so anons get talk message notifications
00068                         wfSetupSession();
00069                 }
00070 
00071                 parent::show();
00072         }
00073 
00074 }