function node_gallery_form_imagefield_import_form_alter in Node Gallery 6.3
File
- ./
node_gallery.module, line 532 - Node gallery module file.
Code
function node_gallery_form_imagefield_import_form_alter(&$form, &$form_state) {
// We add the current gallery to the form values for node_saving later
// Are we being called via a Gallery tab?
$args = arg();
if ($args[0] == 'node' && $args[2] == 'import') {
$nid = $args[1];
if (node_gallery_gallery_load($nid)) {
$gid = $nid;
}
}
if (empty($gid)) {
return;
}
// Yes, let's add the gid to the form, and add our submit handler to the array
// Add our gid
$form['files']['gid']['#tree'] = FALSE;
$form['files']['gid'] = array(
'#type' => 'value',
'#value' => $gid,
);
}