XH 1.6: Different Kinds of Inputs for Config Forms
Re: XH 1.6: Different Kinds of Inputs for Config Forms
I suppose the actual voting's subject is to introduce metaconfig.php.
This is a good proposal since Jerry's solution as formatting integrated in the config field could be realized in a further step after metaconfig.php has well established to users and plugins.
regards
manu
This is a good proposal since Jerry's solution as formatting integrated in the config field could be realized in a further step after metaconfig.php has well established to users and plugins.
regards
manu
Re: XH 1.6: Different Kinds of Inputs for Config Forms
Hi manu,
Christoph
Actually it is about introducing this "typed" config at all, which format to use for the storage and which field types to offer. Some short notes of every voter (in the notes field in the roadmap or in this thread might be in place).manu wrote:I suppose the actual voting's subject is to introduce metaconfig.php.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: XH 1.6: Different Kinds of Inputs for Config Forms
Hello Community,
this is now implemented in the 1.6 branch (r421). The following types are available:
The types of the core config and LANGconfig are hardcoded now, but could easily be moved to files also. We should consider to make the metaconfig available for plugin language files also, to cater for some language specific settings. At least to possibility to hide some language strings in the form could be interesting.
Regarding the password type: I have implemented this particularly for the core (security->password), which means the password are hashed directly on saving. This might not make sense for plugins, but actually I don't see any use for this field type in plugins, so we can leave it as it is.
Regarding other types: these can simply be catered for by adding an appropriate case clause to XH_ArrayFileEdit::formField(). We can add them for XH 1.6 or delay it, to see what's actually needed.
Regarding the selectbox vs. radiobuttons: I still prefer the selectbox as it takes less space, but changing it to radiobuttons can easily be done. We might even make that configurable in the core, so every user can choose his preference.
Regarding the look of the config/language forms: this has to be improved! I've implemented them as tables as that was done so formerly; perhaps even that should be changed. But at least some styling seems very appropriate. Any volunteers?
Anybody interested in having look at the development and doesn't have a SVN client available, can always download the latest development snapshot.
Christoph
this is now implemented in the 1.6 branch (r421). The following types are available:
- string (text input)
- text (textarea)
- bool (checkbox)
- enum (selectbox)
- hidden (hidden)
- password (text input)
Code: Select all
<?php
$plugin_mcf['pagemanager']['verbose']="bool";
$plugin_mcf['pagemanager']['treeview_theme']="enum:cmsimple,apple";
$plugin_mcf['pagemanager']['utf8_marker']="hidden";
?>
Regarding the password type: I have implemented this particularly for the core (security->password), which means the password are hashed directly on saving. This might not make sense for plugins, but actually I don't see any use for this field type in plugins, so we can leave it as it is.
Regarding other types: these can simply be catered for by adding an appropriate case clause to XH_ArrayFileEdit::formField(). We can add them for XH 1.6 or delay it, to see what's actually needed.
Regarding the selectbox vs. radiobuttons: I still prefer the selectbox as it takes less space, but changing it to radiobuttons can easily be done. We might even make that configurable in the core, so every user can choose his preference.
Regarding the look of the config/language forms: this has to be improved! I've implemented them as tables as that was done so formerly; perhaps even that should be changed. But at least some styling seems very appropriate. Any volunteers?
Anybody interested in having look at the development and doesn't have a SVN client available, can always download the latest development snapshot.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: XH 1.6: Different Kinds of Inputs for Config Forms
Not sure if this is the correct location to address to:
When saving config I get this error/warning:
CMSimple 1.6 r816
regards
manu
When saving config I get this error/warning:
even if I don't change password.ERROR/WARNING
New password is invalid
CMSimple 1.6 r816
regards
manu
Re: XH 1.6: Different Kinds of Inputs for Config Forms
That's strange. svasti reported the same problem some weeks ago. I was not able to reproduce it. I replied:
Could you please check this?Ich hab's gerade mal mit FF 22 unter PHP 5.4.7 probiert: egal was ich
mache -- keine Meldung wegen eines falschen Passwords. Ich glaube aber
eigentlich nicht, dass es am Browser liegt (da könnte es höchstens mit
dem Password-Änderungsdialog Probleme geben).
Die Fehlermeldung "New password is invalid" dürfte eigentlich gar nicht
von PHP gemeldet werden. Das habe ich nur sicherheitshalber noch einmal
serverseitig implementiert. Eigentlich müsste schon im Password-Dialog
die entsprechende Meldung erscheinen, aber eben nur dann, wenn man kein
neues Kennwort einträgt.
Jedenfalls ist es so, dass es drei Eingabefelder gibt (die kann man im
Password-Dialog auch sehen): PL3bbeec384_security_password_OLD,
PL3bbeec384_security_password_NEW und
PL3bbeec384_security_password_CONFIRM. Diese sind immer leer wenn das
Formular ausgeliefert wird, und bleiben auch leer, wenn der
Passworddialog nicht erfolgreich ausgefüllt wird. In
cmsimple/classes/FileEdit.php XH_ArrayFileEdit::submitPassword() wird
dann geprüft, ob $_POST[PL3bbeec384_security_password_OLD] == '' ist,
und falls ja wird einfach das gespeicherte Kennwort genommen.
Anscheinend ist dieser Wert bei Dir aber nicht leer. Aber wieso? Schau
doch bitte mal nach, welchen Wert er hat. Im Zweifel mal in der besagten
Methode zu Beginn:
var_dump($_POST[$iname . '_OLD']);
Christoph M. Becker – Plugins for CMSimple_XH
Re: XH 1.6: Different Kinds of Inputs for Config Forms
var_dump outputs "test".
This comes from the FF form autocomplete feature.
After deletion of this certain password it worked well.
How about a password_OLD field with?
This comes from the FF form autocomplete feature.
After deletion of this certain password it worked well.
How about a password_OLD field with
Code: Select all
autocomplete="off"
Re: XH 1.6: Different Kinds of Inputs for Config Forms
Isn't there any success msg like "edit succeeded"?
Re: XH 1.6: Different Kinds of Inputs for Config Forms
Indeed! I have overlooked this. I would have thought the specs take care for setting autocomplete to off for all password inputs. Obviously they don't.manu wrote:This comes from the FF form autocomplete feature.
To be on the safe side, I suggest setting autocomplete="off" for all three password inputs.
Not yet--I completely had forgotten that; thanks for the reminder.[1]manu wrote:Isn't there any success msg like "edit succeeded"?
PS: I have implemented that now (r825).
[1] The respective discussion about this issue is in http://cmsimpleforum.com/viewtopic.php?f=29&t=5567.
Last edited by cmb on Mon Aug 05, 2013 7:12 pm, edited 1 time in total.
Reason: added PS
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH
Re: XH 1.6: Different Kinds of Inputs for Config Forms
Thanks Christoph
It all works.
It all works.
Re: XH 1.6: Different Kinds of Inputs for Config Forms
svasti was not too happy about the fact, that the config options of the plugins are now displayed as input fields by default. Formerly they have been textareas, what was fine for long option values. Of course, it's possible to add a metaconfig.php now, but what about plugins which do not have one?
Basically it's possible to use textareas per default for the plugin configuration, which will behave exactly the same as for the language strings (see http://cmsimpleforum.com/viewtopic.php?f=29&t=5556). The necessary modification can be made in cmsimple/classes/FileEdit.php in XH_PluginConfigFileEdit() (currently line 1034):
An alternative would be to use inputs for options which have a short value currently, and textareas for those with a long value:
What do others think about it?
Basically it's possible to use textareas per default for the plugin configuration, which will behave exactly the same as for the language strings (see http://cmsimpleforum.com/viewtopic.php?f=29&t=5556). The necessary modification can be made in cmsimple/classes/FileEdit.php in XH_PluginConfigFileEdit() (currently line 1034):
Code: Select all
$omcf = isset($mcf[$key]) ? $mcf[$key] : 'text';
Code: Select all
$omcf = isset($mcf[$key])
? $mcf[$key]
: (utf8_strlen($val) <= 50 ? 'string' : 'text');
Christoph M. Becker – Plugins for CMSimple_XH