Last modified: 2010-05-15 16:03:41 UTC
Currently the toolbar in EditPage gets triggered to display before the hook 'EditPage::showEditForm:fields'. This hook can be used to add custom edit fields to EditPage; however it is not always advantageous to display the toolbar above any custom edit fields. It would be optimal if we could add a global configuration setting to DefaultSettings.php called $wgShowToolbarBeforeShowEditFormfields (or something like that), with a default value of true to display the toolbar where it is currently located. Setting this value to false would display the toolbar after the hook 'EditPage::showEditForm:fields' is triggered, perhaps on line 1356 (version 1.13alpha) right above "{$commentsubject}". This would place the toolbar below any custom edit fields, but above textarea "wpTextbox1".
Please provide a patch for review.
Created attachment 5722 [details] Patches DefaultSettings.php to add a new global configuration variable, and patches EditPage.php to implement repositioning the toolbar This patch adds a new global configuration variable, $wgShowToolbarAfterEditFormFieldsHook, which can be used to reposition the edit toolbar below any HTML elements added through the hook 'EditPage::showEditForm:fields'. By setting this configuration variable to true, the toolbar will show up on the edit screen after any elements added through this hook, but above the standard textbox edit field; leaving this setting at its default (false) will position the toolbar above these elements, as it appears before this patch is implemented.
What is the use case for this?
The hook EditPage::showEditForm:fields can be used to add form fields to the edit page, which can be used to capture information in addition to the standard textbox, wpTextBox1. (The processing of any data entered in these form fields is handled in a later hook). Currently, the toolbar gets positioned above any HTML elements (i.e., form fields) added through EditPage::showEditForm:fields; however it is only functional in wpTextbox1 and wpTextbox2 by default. This patch adds a new configuration variable that can be used to position the toolbar below any HTML elements added through EditPage::showEditForm:fields, but still have it show up above the standard edit boxes, wpTextbox1 and wpTextbox2. The default value is false, which will leave the toolbar in its current position; setting this to true would reposition the toolbar to show up after any HTML elements added using EditPage::showEditForm:fields.
This is no longer an issue, and can be worked around by utilizing a different hook, EditPage::showEditForm:initial, for attaching edit form fields to the edit page.