Big cleanup to DifferenceEngine:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 5 Oct 2011 19:55:04 +0000 (19:55 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 5 Oct 2011 19:55:04 +0000 (19:55 +0000)
commit0b0705f370c23728e97a6c9c6284aca46b077657
tree4bd8cf72febe5145f52cce5d8c1aa45cd0bd9ffe
parentd80f4dbde7a5a6ab8b10d6608fee2293a55bc65a
Big cleanup to DifferenceEngine:
* Call Linker methods statically
* Factorised a lot of duplicate code, such as "Mark patrolled" links, revisions headers, etc.
* Removed showFirstRevision() and made that case be handled through the normal showDiffPage(). In such case, the header will look like a normal diff page, except it is centred. For this, addHeader() will now center the "new revision" header if the string passed to the "old revision" header and the diff is empty. getDiffBody() will also return an empty string if $mOldRev is false.
* Showing only one revision when the previous was not found will also ask to unhide the revision is deleted as in normal case
* Backed out code that generates the revision header from loadRevisionData() so that this function does not make a mix of backend and UI stuff. Factorised the code in getRevisionHeader().
* Lazy-load page's language and revisions IDs (in case of "prev", "next", etc. are passed) instead of doing that in constructor.
* Made a good part of links compatible with Special:ComparePages, such as navigation links, "undo", etc. that links to the title corresponding to the revision and not the given title in the constuctor.
* "Current revision as of" can also be displayed on the old revision, useful when comparing two current revisions in Special:ComparePages
* Removed navigation, undo and rollback links when comparing two different pages, this can confuses users thinking they are comparing two revisions of the same page. Also clicking on a "undo" link in such case will give "revision not found".
* Check if the user can read the revisions before sending a external editor file
includes/diff/DifferenceEngine.php