From: Aryeh Gregor Date: Tue, 15 Apr 2008 14:47:04 +0000 (+0000) Subject: Add a new hook EditPageBeforeEditConflict to allow extensions like FCKeditor to modif... X-Git-Tag: 1.31.0-rc.0~48309 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=209b382761e294ea6c20ddb9ffc41e3a604cff04;p=lhc%2Fweb%2Fwiklou.git Add a new hook EditPageBeforeEditConflict to allow extensions like FCKeditor to modify the output for edit conflicts. By request of moisadoru on IRC for FCKeditor extension issue: dev.fckeditor.net/ticket/1385 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c8f7751981..8e91c1eebc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -73,6 +73,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6934) Allow separated inclusions, links, redirects on whatlinkshere * Cache image redirects * (bug 10457) Reorganize Special:Specialpages +* Add a new hook EditPageBeforeConflictDiff to allow extensions like FCKeditor + to modify the output for edit conflicts. === Bug fixes in 1.13 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 42ee77f83c..41d0e34d71 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -544,6 +544,14 @@ Alternatively, modifying $error and returning true will cause the contents of $e to be echoed at the top of the edit form as wikitext. Return true without altering $error to allow the edit to proceed. +'EditPageBeforeConflictDiff': allows modifying the EditPage object and output +when there's an edit conflict. Return false to halt normal diff output; in +this case you're responsible for computing and outputting the entire "conflict" +part, i.e., the "difference between revisions" and "your text" headers and +sections. +&$editor: EditPage instance +&$out: OutputPage instance + 'EditPageBeforeEditButtons': allows modifying the edit buttons below the textarea in the edit form &$editpage: The current EditPage object &$buttons: Array of edit buttons "Save", "Preview", "Live", and "Diff" diff --git a/includes/EditPage.php b/includes/EditPage.php index 3c0f2aeb15..a4218d5219 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1391,7 +1391,7 @@ END "); - if ( $this->isConflict ) { + if ( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) ) ) { $wgOut->wrapWikiMsg( '==$1==', "yourdiff" ); $de = new DifferenceEngine( $this->mTitle );