Instead of #1942418: Option to have the skinr form integrated with the entity form it relates to, it would be good to split the default value getting out of skinr_ui_edit() into its own function.
This makes it easier to more cleanly replicate the skinr_ui_edit() form elsewhere.
For example, I am form altering my node form to add skinr_ui_edit() to it in a collapsible fieldset.
To do that I need to set the equivalent of:
<?php
$form_state['values']['skinr_settings'] = $skinr_defaults;
?>
However in the current state if I call drupal_get_form('skinr_ui_form') I can't have that.
I propose a system where I can do this:
<?php
$skinr_defaults = skinr_ui_form_get_defaults($module, $element);
$skinr_form = drupal_get_form('skinr_ui_form', array('module' => $module, 'element' => $element), $skinr_defaults);
?>
Comments
Comment #1
rooby commentedPatch for the change.
Comment #2
moonray commentedFinally got around to reviewing. Looks good.
Comment #3
moonray commentedCommitted.
Comment #4
rooby commentedGreat, thank you.