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

Closed
mattab opened this Issue Sep 6, 2013 · 38 comments

3 participants

@mattab
Piwik Open Source Analytics member

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)
@mattab
Piwik Open Source Analytics member

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

@julienmoumne
Piwik Open Source Analytics member

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

@mattab
Piwik Open Source Analytics member

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.

@mattab
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

In b969dc7: refs #4126 fix settings were not saved

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

In 7090ace: refs #4126 escape html attributes

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

In 0785060: refs #4126 added example plugin for settings

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

In 0379e1e: refs #4126 coding style skip

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

In 2944618: refs #4126 this should fix the test

@tsteur
Piwik Open Source Analytics member

In 1d44cdc: refs #4126 cleanup

@tsteur
Piwik Open Source Analytics member

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

@tsteur
Piwik Open Source Analytics member

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

@mattab
Piwik Open Source Analytics member

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?

@mattab mattab added this to the 2.0 - Piwik 2.0 milestone Jul 8, 2014
@tsteur tsteur was assigned by mattab Jul 8, 2014
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@mattab mattab Deleting Plugin\Config since it wouldnt be best practise to have per-…
…plugin config file. Waiting for refs #4126
a5a5003
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 started to work on plugin settings d4f2a75
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 fix settings were not saved b969dc7
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added possibility to use other fields as well f70afa2
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 plugins just have to create a settings.php, there is no lo…
…nger a need to use a hook
599ff6f
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 escape html attributes 7090ace
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur 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
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 for security remove settings in case a user is deleted or …
…a plugin installed, needs to be tested
4af4d04
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added possibility to define introductions, display inline …
…help
3ded6de
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 fix remove user settings did not work 7bc0b87
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur 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
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 do not display a default value in case we are displaying a…
… checkbox, not needed here
29dbc73
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur 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
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 display a link to plugin settings page from plugins and th…
…emes page as well as after activating a plugin
1297f81
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added example plugin for settings 0785060
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added a command to generate plugin settings 79b3957
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 fix plugin settings not displayed for regular users 5c5135d
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added more example, handle type array and field multi sele…
…ct correct, code cleanup
52e8a0d
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 invalidate token only in case of success, otherwise it is …
…not possible to correct an invalid number
a24ff91
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 translate messages that can be displayed to the user ccf26a7
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 moved inline css to less files cd5a5ec
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 coding style [ci skip] 0379e1e
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added some tests, fixed some bugs and moved some methods w…
…here they belong to not have a circular dependency
d467c9a
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added another test to make sure user settings do not overw…
…rite each other
ac87e01
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 make sure to list settings by order d058dbf
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 display a headline for super user settings 82ad929
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 this should fix the test 2944618
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 cleanup 1d44cdc
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur tsteur refs #4126 added possibility to define radio boxes b3dfd34
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@tsteur 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