Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -317,6 +317,14 @@ |
318 | 318 | $isbn: ISBN to show information for |
319 | 319 | $output: OutputPage object in use |
320 | 320 | |
| 321 | +'CustomEditor': When invoking the page editor |
| 322 | +$article: Article being edited |
| 323 | +$user: User performing the edit |
| 324 | + |
| 325 | +Return true to allow the normal editor to be used, or false |
| 326 | +if implementing a custom editor, e.g. for a special namespace, |
| 327 | +etc. |
| 328 | + |
321 | 329 | 'DiffViewHeader': called before diff display |
322 | 330 | $diff: DifferenceEngine object that's calling |
323 | 331 | $oldRev: Revision object of the "old" revision (may be null/invalid) |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -405,18 +405,20 @@ |
406 | 406 | } |
407 | 407 | /* Continue... */ |
408 | 408 | case 'edit': |
409 | | - $internal = $request->getVal( 'internaledit' ); |
410 | | - $external = $request->getVal( 'externaledit' ); |
411 | | - $section = $request->getVal( 'section' ); |
412 | | - $oldid = $request->getVal( 'oldid' ); |
413 | | - if( !$this->getVal( 'UseExternalEditor' ) || $action=='submit' || $internal || |
414 | | - $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) { |
415 | | - $editor = new EditPage( $article ); |
416 | | - $editor->submit(); |
417 | | - } elseif( $this->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) { |
418 | | - $mode = $request->getVal( 'mode' ); |
419 | | - $extedit = new ExternalEdit( $article, $mode ); |
420 | | - $extedit->edit(); |
| 409 | + if( wfRunHooks( 'CustomEditor', array( $article, $user ) ) ) { |
| 410 | + $internal = $request->getVal( 'internaledit' ); |
| 411 | + $external = $request->getVal( 'externaledit' ); |
| 412 | + $section = $request->getVal( 'section' ); |
| 413 | + $oldid = $request->getVal( 'oldid' ); |
| 414 | + if( !$this->getVal( 'UseExternalEditor' ) || $action=='submit' || $internal || |
| 415 | + $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) { |
| 416 | + $editor = new EditPage( $article ); |
| 417 | + $editor->submit(); |
| 418 | + } elseif( $this->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) { |
| 419 | + $mode = $request->getVal( 'mode' ); |
| 420 | + $extedit = new ExternalEdit( $article, $mode ); |
| 421 | + $extedit->edit(); |
| 422 | + } |
421 | 423 | } |
422 | 424 | break; |
423 | 425 | case 'history': |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -129,6 +129,7 @@ |
130 | 130 | * ar: fix the 'create a new page' on search page when no exact match found |
131 | 131 | * (bug 8703) Corrected Talk namespace name for Limburgish (li) |
132 | 132 | * (bug 8712) Expose user groups as a JavaScript global |
| 133 | +* Introduce 'CustomEditor' hook; see docs/hooks.txt for more information |
133 | 134 | |
134 | 135 | == Languages updated == |
135 | 136 | |