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

@mattab
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)
@mattab
Owner

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

@JulienMoumne
Collaborator

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

@mattab
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.

@mattab
Owner

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

@tsteur
Owner

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

@tsteur
Owner

In b969dc7: refs #4126 fix settings were not saved

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

In 7090ace: refs #4126 escape html attributes

@tsteur
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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

In 0785060: refs #4126 added example plugin for settings

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

In 0379e1e: refs #4126 coding style skip

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

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

@tsteur
Owner

In 2944618: refs #4126 this should fix the test

@tsteur
Owner

In 1d44cdc: refs #4126 cleanup

@tsteur
Owner

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

@tsteur
Owner

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

@mattab
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?

@mattab mattab added this to the 2.0 - Piwik 2.0 milestone
@tsteur tsteur was assigned by mattab
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@mattab mattab Deleting Plugin\Config since it wouldnt be best practise to have per-…
…plugin config file. Waiting for refs #4126
a5a5003
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 started to work on plugin settings d4f2a75
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 fix settings were not saved b969dc7
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 added possibility to use other fields as well f70afa2
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 escape html attributes 7090ace
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 fix remove user settings did not work 7bc0b87
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 do not display a default value in case we are displaying a…
… checkbox, not needed here
29dbc73
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 added example plugin for settings 0785060
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 added a command to generate plugin settings 79b3957
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 added more example, handle type array and field multi sele…
…ct correct, code cleanup
52e8a0d
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 invalidate token only in case of success, otherwise it is …
…not possible to correct an invalid number
a24ff91
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 moved inline css to less files cd5a5ec
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 coding style [ci skip] 0379e1e
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@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 referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 added another test to make sure user settings do not overw…
…rite each other
ac87e01
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 make sure to list settings by order d058dbf
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 display a headline for super user settings 82ad929
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 this should fix the test 2944618
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 cleanup 1d44cdc
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4126 added possibility to define radio boxes b3dfd34
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@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
Something went wrong with that request. Please try again.