Mark Clements wrote:
"Rob Church" robchur@gmail.com wrote in message news:e92136380612131311x24e8cf0cpe0ad70aeaf678b87@mail.gmail.com...
On 13/12/06, Dave Grogan dgrogan@gmail.com
wrote:
The spellchecker needs a hook near the end of getEditToolbar that is passed the toolbar variable. The extension adds a spellcheck button to the toolbar.
You couldn't just use the existing JavaScript-based support functions for adding custom edit buttons?
Or look at how http://www.mediawiki.org/wiki/Extension:Add_Button does it.
Thank you for this link.
Track Changes needs ArticleSaveComplete to also pass $revisionId (id of the newly-saved revision) and a flag that determines whether the content of the article changed.
That sounds sane enough to me.
I was under the impression that the article was never saved if the content hasn't changed, and therefore the hook wouldn't trigger in that situation anyway.
No new revision is saved but the hook is run. See Article.php, lines 1285-90 and 1359-63 in v1.8.2.
Also, $revisionID should be available through the article object that is already passed to the hook. If not, then that is where it should be added, not as an extra hook parameter.
A revisionID is available through the article object, but it is the id of the previously retrieved page, not the newly inserted one. The id of the newly-inserted page is not passed to the hook in any of the current parameters, as far as I can tell (var_dumps and some ctrl-f-ing).
Track changes needs SkinTemplateTabs to pass in revid and oldid so that it can display oldid if specified in the query string or revid if it
was:
$oldid = $wgRequest->getVal( 'oldid' ); global $wgArticle; $revid = $wgArticle ? $wgArticle->getLatest() : 0;
Not very clear about this point. Can you elaborate?
The SkinTemplateTags hook calls an extension function that adds the track changes tab shown in the screenshot. The "track changes" tab needs to pass a parameter to the TrackChanges page telling it what revision to display. The SkinTemplate class has access to wgArticle, so it can pass the id of the article's latest revision. However, if the user is viewing an older revision of the document, as specified by the oldid query parameter, eg http://www.mediawiki.org/w/index.php?title=Extension:Add_Button&oldid=52... then the TrackChanges extension should display that older revision. It is not necessary that both of those be passed in (the logic for figuring out which one to display could be moved from the tab-adding extension to SkinTemplate) but SkinTemplate needs to communicate the requested revision to the extension that adds the "track changes" tab somehow.