function node_gallery_create_new_gallery_submit in Node Gallery 6.3
If the user selected the option to create a new gallery, create a stub gallery, assign the images to that gallery, and redirect them to the gallery edit form.
Parameters
$form: The Drupal FAPI form array.
$form_state: The Drupal FAPI form_state array.
1 string reference to 'node_gallery_create_new_gallery_submit'
- node_gallery_form_alter in ./
node_gallery.module - Implements hook_form_alter().
File
- ./
node_gallery.module, line 376 - Node gallery module file.
Code
function node_gallery_create_new_gallery_submit($form, &$form_state) {
if ($form_state['values']['gid'] == 'new_gallery') {
$relationship = node_gallery_get_relationship(NULL, $form_state['values']['type']);
$content_type = $relationship['gallery_type'];
$gallery = _node_gallery_create_new_gallery($content_type);
$form_state['values']['gid'] = $gallery->nid;
drupal_set_message(t('You have been redirected to your new auto-generated gallery edit page, please update the title and review the other settings before pressing save.'));
$form_state['values']['redirect_to_gallery'] = TRUE;
}
}