function cloneimagefield_form_alter in Node clone 5.2
Same name and namespace in other branches
- 5 cloneimagefield.module \cloneimagefield_form_alter()
Implementation of hook_form_alter().
File
- ./
cloneimagefield.module, line 101
Code
function cloneimagefield_form_alter($form_id, &$form) {
// Look for node forms.
if (isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id) {
if (isset($form['#node']->node_clone_imagefield)) {
// If we are using the "prepopulate" method, store information about files
// attached to the original node as a hidden form field.
$form['node_clone_imagefield'] = array(
'#type' => 'hidden',
'#value' => serialize($form['#node']->node_clone_imagefield),
);
}
}
}