1 tilqicom Nov 13, 2013 02:26
3 sam2kb Nov 13, 2013 02:58
I believe I've done this in one of my plugins, can't remember which one was it.
4 sam2kb Nov 13, 2013 03:01
See UserBlog, Avatars and Janrain plugins
5 tilqicom Nov 13, 2013 12:33
Thanks, nice pointers. The problem is there is no DisplayProfileFormFieldset equivalent like DisplayPluginSettingsFormFieldset as in the avatars plugin.
It seems i need sth similar as in UserBlog plugin, RegisterFormSent & DisplayRegisterFormFieldset, but those only work for user forms of course.
I figured a way to display my custom Form i think. But i need a way to disable the default PluginSettings form display. I tried returning after PluginSettingsValidateSet or PluginSettingsEditAction but they dont seem to work for the moment being. I am still fiddling here and there, hopefully i can find a way out.
See UserBlog, Avatars and Janrain plugins
6 tilqicom Nov 13, 2013 13:54
It turns out, there are absolutely no hooks available (that has the $Form available) before displaying of form PluginSettings.
At this point i must insist that we need a PluginSettingsEditDisplayBefore so that we can modify / disable the $Form before it gets displayed
The only candidate seems to be PluginSettingsEditAction
but the $Form object cant be accessed with it.
7 sam2kb Nov 13, 2013 16:53
in PluginSettingsEditDisplayAfter
$Form->output = false;
// option 1: either display the form or drop it
// option 2: change form params (remove existing, add yours)
8 sam2kb Nov 13, 2013 16:54
PluginSettingsEditDisplayAfter uses $Form by reference
9 tilqicom Nov 13, 2013 17:21
Yeah that sounded promisin when i first saw that, i thought that was the solution. But it doesnt work the way i expect it, or am i doing something wrong ??
when i add
function PluginSettingsEditDisplayAfter( & $params ) {
$params["Form"]->output = false;
It displays the output for the following forms (pluginvariables, pluginevents), but not the PluginSettings form. How can i specify that i want to disable output for that, and that only ?
in PluginSettingsEditDisplayAfter
$Form->output = false;
// option 1: either display the form or drop it
// option 2: change form params (remove existing, add yours)
10 sam2kb Nov 13, 2013 17:24
You only option is Javascript if you don't want to mess with ob_start() and ob_get_clean()
11 tilqicom Nov 13, 2013 17:57
Well if i wanted a javascript solution, i wouldnt even have to go this far :D i'd simply use jQuery to manipulate the whole thing. I'd be happy if it worked without javascript, so i am willing to mess with it (:
You only option is Javascript if you don't want to mess with ob_start() and ob_get_clean()
12 sam2kb Nov 13, 2013 17:58
Try ob_start() and ob_get_clean() and preg_replace() then
Basically you can display your own form with 'layout' => 'html' or PluginSettingsEditDisplayAfter() and then catch input fields with PluginSettingsUpdateAction(). The only problem here is that you would need to handle your settings manually with $this->Settings->set() and $this->Settings->dbupdate()
You can also request the new event to be added in the next release