Allow custom form types for user, system and measurable settings #10992
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows us to show custom field types in User-, System- and Measurable-Settings. No longer limited to text, textarea, select, ...
Defining a new field is as easy as eg https://github.com/piwik/piwik/blob/3.x-dev/plugins/CorePluginsAdmin/angularjs/form-field/field-text.html
This is really useful since we were often not able to define settings eg as System Settings because one setting was a bit more complicated and could not be visualized with our default UI settings control but now we can wrap pretty much anything with it.
By default the values for it will be stored along a site, measurable, plugin settings but with just a very few lines and by implementing it is super easy to store settings for a field in a different backend see this interface:
https://github.com/piwik/piwik/blob/3.x-dev/core/Settings/Storage/Backend/BackendInterface.php
Say you have a custom setting for trusted hosts or something else and want to keep the existing place for storing that information then you just wrap the calls to save that method in such an interface.
Needs to be documented eventually.