Implements:
* Gadget definition content and content handler
* Basic validation for gadget definition content
* GadgetDefinitionNamespace implementation of GadgetRepo
* DataUpdates upon editing/deletion of Gadget definition pages
* EditFilterMerged hook for improved error messages
* 'GadgetsRepoClass' option to switch GadgetRepo implementation used
* Lazy-load the GadgetResourceLoaderModule class so we don't need to
load each individual gadget object unless its needed
Note that Special:Gadgets's export feature intentionally doesn't work
yet, and will be fixed in a follow up patch.
Bug: T106177
Change-Id: Ib11db5fb0f7b46793bfa956cf1367f1dc1059b1c
* Requires 1.27
* require_once is not a function
* BeforePageDisplay does run in modern versions of the CologneBlue skin.
* User code typically runs after Gadgets now, and they do have access to
things defined in gadgets.
Change-Id: I37431940693abdc2df840980025ff517e95f4a09
* (bug 12211) Show some gadgets only for admins
* (bug 13742) Allow for gadgets to be turned on by default
I'm a bit leery of the 'on by default' entirely at the moment. :)
A few comments:
* The readme examples don't seem to clearly show the option format
* Why are numeric constants being used as indexes to the option array? Strings are easier to work with and debug.
* There's a lot of stuff like this which feels very ugly:
if( isset( $gadget->options[Gadget::RIGHTS] ) && !empty( $gadget->options[Gadget::RIGHTS] ) ) {
Since it's all hard-coded anyway, why not just do something nice and clear like this?
if( !empty( $gadget->rights ) ) {
* And this:
if( wfGadgetAllowed( $gadget->options ) ) {
to:
if( $gadget->isAllowed() ) {