Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Let Plugin developers easily store Settings and customize them via UI #4126

Closed
mattab opened this Issue · 38 comments

3 participants

Matthieu Aubry Julien Moumné Thomas Steur
Matthieu Aubry
Owner

Add possibility to define settings for plugins, using radio/checkbox/input/select.

  • Let dev specify name/label, description, inline help, default value, etc.
  • Specify type of data: int, string, ...
  • Allow dev to display these settings in a new dedicated page, accessible via an admin's sub menu link
  • or the settings are added in the new "Plugin Settings" page (below "General Settings" in admin menu). This page loads all plugin settings which are not created in their own page.
  • Add Link in plugin list to the plugin's setting page (and #anchor if appropriate)
Matthieu Aubry
Owner

Possibly we add new column in piwik_option table to store plugin, so plugin settings are cleanly separate from core values.

Julien Moumné
Collaborator

Would this new mechanism be used to store the phone numbers and validation codes of the MobileMessaging plugin?

Matthieu Aubry
Owner

Replying to JulienM:

Would this new mechanism be used to store the phone numbers and validation codes of the MobileMessaging plugin?

Nope it would be for pure simple settings label / description / inline help / type / id, to avoid user having to write a controller action+template+form for simple settings.

Matthieu Aubry
Owner

In a5a5003: Deleting Plugin\Config since it wouldnt be best practise to have per-plugin config file. Waiting for refs #4126

Thomas Steur
Owner

In d4f2a75: refs #4126 started to work on plugin settings

Thomas Steur
Owner

In b969dc7: refs #4126 fix settings were not saved

Thomas Steur
Owner

In f70afa2: refs #4126 added possibility to use other fields as well

Thomas Steur
Owner

In 599ff6f: refs #4126 plugins just have to create a settings.php, there is no longer a need to use a hook

Thomas Steur
Owner

In 7090ace: refs #4126 escape html attributes

Thomas Steur
Owner

In 0550fb1: refs #4126 differentiate between user and system settings to make a plugin developers live as easy and as secure as possible, add automatically validator in case field options are set, for security allow only names that are alNum

Thomas Steur
Owner

In 4af4d04: refs #4126 for security remove settings in case a user is deleted or a plugin installed, needs to be tested

Thomas Steur
Owner

In 3ded6de: refs #4126 added possibility to define introductions, display inline help

Thomas Steur
Owner

In 7bc0b87: refs #4126 fix remove user settings did not work

Thomas Steur
Owner

In 0abe2b8: refs #4126 refactored plugin settings to work with User and System setting data objects, the plugin settings does not know anything abotu User/System settings so it is possible to add different kind of settings in the future. Also added nonce when saving settings

Thomas Steur
Owner

In e8456f5: refs #4126 added some documentation and removed some unused methods

Thomas Steur
Owner

In 29dbc73: refs #4126 do not display a default value in case we are displaying a checkbox, not needed here

Thomas Steur
Owner

In ff25602: refs #4126 display a list of plugins at the beginning of the plugin settings page and explain the user is going to change 3rd party settings

Thomas Steur
Owner

In 1297f81: refs #4126 display a link to plugin settings page from plugins and themes page as well as after activating a plugin

Thomas Steur
Owner

In 48e9a1b: refs #4126 allow only to change the settings for activated plugins

Thomas Steur
Owner

In 0785060: refs #4126 added example plugin for settings

Thomas Steur
Owner

In 79b3957: refs #4126 added a command to generate plugin settings

Thomas Steur
Owner

In 5c5135d: refs #4126 fix plugin settings not displayed for regular users

Thomas Steur
Owner

In 52e8a0d: refs #4126 added more example, handle type array and field multi select correct, code cleanup

Thomas Steur
Owner

In a24ff91: refs #4126 invalidate token only in case of success, otherwise it is not possible to correct an invalid number

Thomas Steur
Owner

In ccf26a7: refs #4126 translate messages that can be displayed to the user

Thomas Steur
Owner

In cd5a5ec: refs #4126 moved inline css to less files

Thomas Steur
Owner

In 0379e1e: refs #4126 coding style skip

Thomas Steur
Owner

In d467c9a: refs #4126 added some tests, fixed some bugs and moved some methods where they belong to not have a circular dependency

Thomas Steur
Owner

In ac87e01: refs #4126 added another test to make sure user settings do not overwrite each other

Thomas Steur
Owner

In ab66ccb: refs #4126 make sure a user cannot read/change settings of another user

Thomas Steur
Owner

In d058dbf: refs #4126 make sure to list settings by order

Thomas Steur
Owner

In 82ad929: refs #4126 display a headline for super user settings

Thomas Steur
Owner

In dd4cbb2: refs #4126 added possibility to call getValue directly on the setting

Thomas Steur
Owner

In 2944618: refs #4126 this should fix the test

Thomas Steur
Owner

In 1d44cdc: refs #4126 cleanup

Thomas Steur
Owner

In b3dfd34: refs #4126 added possibility to define radio boxes

Thomas Steur
Owner

In 0229659: refs #4126 display radio boxes a bit nicer

Matthieu Aubry
Owner

Very nice work & feature for developers! this saves writing so much HTML, javascript, php code... well done.

Is there any work left before closing ticket?

Matthieu Aubry mattab added this to the 2.0 - Piwik 2.0 milestone
Thomas Steur tsteur was assigned by mattab
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Deleting Plugin\Config since it wouldnt be best practise to have per-…
…plugin config file. Waiting for refs #4126
a5a5003
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 started to work on plugin settings d4f2a75
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 fix settings were not saved b969dc7
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added possibility to use other fields as well f70afa2
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 plugins just have to create a settings.php, there is no lo…
…nger a need to use a hook
599ff6f
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 escape html attributes 7090ace
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 differentiate between user and system settings to make a p…
…lugin developers live as easy and as secure as possible, add automatically validator in case field options are set, for security allow only names that are alNum
0550fb1
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 for security remove settings in case a user is deleted or …
…a plugin installed, needs to be tested
4af4d04
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 fix remove user settings did not work 7bc0b87
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 refactored plugin settings to work with User and System se…
…tting data objects, the plugin settings does not know anything abotu User/System settings so it is possible to add different kind of settings in the future. Also added nonce when saving settings
0abe2b8
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 do not display a default value in case we are displaying a…
… checkbox, not needed here
29dbc73
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 display a list of plugins at the beginning of the plugin s…
…ettings page and explain the user is going to change 3rd party settings
ff25602
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 display a link to plugin settings page from plugins and th…
…emes page as well as after activating a plugin
1297f81
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added example plugin for settings 0785060
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added a command to generate plugin settings 79b3957
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added more example, handle type array and field multi sele…
…ct correct, code cleanup
52e8a0d
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 invalidate token only in case of success, otherwise it is …
…not possible to correct an invalid number
a24ff91
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 moved inline css to less files cd5a5ec
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 coding style [ci skip] 0379e1e
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added some tests, fixed some bugs and moved some methods w…
…here they belong to not have a circular dependency
d467c9a
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added another test to make sure user settings do not overw…
…rite each other
ac87e01
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 make sure to list settings by order d058dbf
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 display a headline for super user settings 82ad929
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 this should fix the test 2944618
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 cleanup 1d44cdc
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 added possibility to define radio boxes b3dfd34
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Thomas Steur tsteur refs #4126 display radio boxes a bit nicer 0229659
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.