Page MenuHomePhabricator

Add new global for toolbar relocation in EditPage
Closed, DeclinedPublic

Description

Author: lhridley

Description:
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".


Version: 1.13.x
Severity: enhancement

Details

Reference
bz14491

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:13 PM
bzimport set Reference to bz14491.
bzimport added a subscriber: Unknown Object (MLST).

Please provide a patch for review.

lhridley wrote:

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.

Attached:

lhridley wrote:

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.

lhridley wrote:

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.