|mediawiki/core : master||Update OOUI to v0.31.0|
|oojs/ui : master||PHP: Added server-side version of IndexLayout|
- Mentioned In
- T215490: Clicking the "Beta" button takes you right to the bottom of the beta features preferences pane instead of the top
T203352: Add support for creating tabs in OOUI PHP
rEWBI8b1cdbc07505: Tabify file information and structured data
rEWBIdd49913783a2: Tabify file information and structured data
rEWBI457208d1a3bf: Tabify file information and structured data
rEWBIee0c8b1865da: Tabify file information and structured data
rEWBI0947dc28dea1: Tabify file information and structured data
rEWBIfc9723559322: Tabify file information and structured data
T215644: Add a frameless design for OOUI's IndexLayout (TabLayout), suitable for use on large, unframed contexts (not dialogs)
- Mentioned Here
- T215644: Add a frameless design for OOUI's IndexLayout (TabLayout), suitable for use on large, unframed contexts (not dialogs)
There is no magic, just a bunch of hardcoded HTML in PreferencesFormOOUI::getBody().
I think you want to write PHP versions of the relevant layouts/widgets, as I argued when this was implemented:
Sounds like a good approach.
You might want to use reusePreInfuseDOM() instead, the result of which is passed to the constructor. If you use gatherPreInfuseState(), the result is passed to restorePreInfuseState(), which is only called after the infused widget is inserted into the DOM in place of the old one. In practice I suppose they would work mostly the same, but theoretically reusePreInfuseDOM()/constructor should be more efficient.
(gatherPreInfuseState()/restorePreInfuseState() was only intented for state that would be lost when we detach the PHP widget from the DOM, e.g. keyboard focus or scroll position in a <textarea>.)
reusePreInfuseDOM() also allows you to reuse the existing DOM elements, just attaching events to them etc., instead of re-generating them from nothing in JS. We've not made a lot of use of this yet, but InputWidget's $input uses it.
Alternatively, you could pick up everything that has been inserted inside the widget in PHP, and include it in the array returned by getConfig(). On a smaller scale, this is used by ActionFieldLayout and FieldLayout for their child widgets. I think the solution you proposed is better though, since this would duplicate a bunch of the HTML output.