2 sam2kb Nov 13, 2013 02:57

I believe I've done this in one of my plugins, can't remember which one was it.
See UserBlog, Avatars and Janrain plugins
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
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.
in PluginSettingsEditDisplayAfter
$Form->output = false;
// option 1: either display the form or drop it
// option 2: change form params (remove existing, add yours)
PluginSettingsEditDisplayAfter uses $Form by reference
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)
You only option is Javascript if you don't want to mess with ob_start() and ob_get_clean()
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()
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