Jacopo Corbetta wrote:
Hello, I see that for the 1.16 release many hooks were added in EditPage.php. First of all, I would like to thank the developers for making my job much easier: in the past I had to override entire methods of EditPage to implement the visual editor.
That's probably my work refactoring EditPage to be better extensible.
^_^ Thank the people who cleaned up after me instead of undoing the feature too, I break trunk somehow whenever I commit to core even when I test.
I would like to get rid of all the messy stuff and use the new "clean" hooks, but I'm still having some issues:
- I use the EditPageBeforeEditChecks hook to add a checkbox to
disable MeanEditor. However, I also need to set it to the correct value. Right now, I am overriding the entire showStandardInputs function just to change line 1749 (referring to http://svn.wikimedia.org/viewvc/mediawiki/branches/REL1_16/phase3/includes/E...). Am I missing an obvious solution here?
You talking about the $checked values passed by showStandardInputs? I think that was probably just there for legacy or to cleanly separate values from that method, I can't remember. But all getCheckboxes uses that for is passing booleans, can't you just supply the checkbox value directly in your hook?
- I would like to disable the default toolbar when the visual editor
is in use. In the past, I used to override the entire showEditForm method and reset the $toolbar variable. How can I accomplish this now?
Ouch, it would have been nicer for you if getEditToolbar was not static. And perhaps also if the two "should I show the toolbar" tests were broken into another instance method. I think you might be able to use EditPageBeforeEditToolbar to erase the toolbar though.
- I need to add the 'wymupdate' class to the standard buttons
(submit, preview, diff, etc.). Is there a clean way to do this without overriding the entire getEditButtons method?
Hmm, that makes me think getEditButtons would have been better to use an assoc-array where the contents were arguments to Xml::element so it could be overridden instead of straight html. I can't think of a non-ugly way to do this. You could almost override getEditButtons, call the superclass method, and for each input use a regex to insert a class manually... though that IS ugly.
Thanks in advance for answers -- Jacopo Corbetta
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]