1 balupton May 22, 2006 15:24
3 blueyed May 22, 2006 16:24
Ok, the real solution has been to use
function getDefaultSettings()
{
$r = array(
// default settings
);
if( isset($this->Settings) )
{ // Settings get queried again to get displayed in "edit settings"
// manipulate $r, according to $this->Settings->get(...)
}
return $;
}
4 balupton May 22, 2006 16:27
Yep done via;
if( isset ( $this->Settings ) && $this->Settings->get('Resize_Style') == 'none' ) {
$Settings['ResizeAt_Width']['disabled'] = true;
$Settings['ResizeAt_Height']['disabled'] = true;
}
return $Settings;
}
Although the realtime hook during runtime would be pretty sweet....
5 blueyed May 22, 2006 22:46
"id", "onclick" and other useful JS handlers now get passed through to the edit settings form.
See the Test plugin (just updated), where I've added an example for it.
You might want to look at Plugin::PluginSettingsValidateSet() and Plugin::PluginSettingsUpdateAction().
I'll look into allowing "onclick" as a param for settings also, which would allow to handle this dynamically, too.