You are here

function node_gallery_create_gallery_redirect_submit in Node Gallery 6.3

1 string reference to 'node_gallery_create_gallery_redirect_submit'
node_gallery_form_alter in ./node_gallery.module
Implements hook_form_alter().

File

./node_gallery.module, line 357
Node gallery module file.

Code

function node_gallery_create_gallery_redirect_submit($form, &$form_state) {
  if (!isset($form_state['node']['nid']) && isset($form_state['nid'])) {

    // It's a new gallery, not an edit.
    if (node_gallery_get_image_count($form_state['nid']) == 0) {

      // It's empty, send them to the upload page.
      $form_state['redirect'] = 'node/' . $form_state['nid'] . '/upload';
    }
  }
}