You are here

function gallery_assist_form_submit in Gallery Assist 6

Prepare some input keys for save.

See also

gallery_assist_upload_js()

1 call to gallery_assist_form_submit()
gallery_assist_upload_js in ./gallery_assist.module
Upload callback over ahah. Prepare the data for save and rebuild the form.
2 string references to 'gallery_assist_form_submit'
gallery_assist_ui_ga_items_form in modules/gallery_assist_ui/gallery_assist_ui.module
_get_ga_form in ./gallery_assist.module

File

./gallery_assist.module, line 1621
Drupal content type with gallery functionality.

Code

function gallery_assist_form_submit(&$form, &$form_state) {
  global $user;
  $in = $form_state['values'];
  $node = $form['#node'];
  $node->newfile = $form_state['files'];
  $node->temp_copyright = $form_state['values']['temp_copyright'];
  $node->gallery_assist_lockked = $form_state['values']['gallery_assist_lockked'];
  $node->ga_save_caller = $form_state['values']['ga_save_caller'];
  $node->ga_rebuild_items_alias = $form_state['values']['ga_rebuild_items_alias'];
  $node->node_path = $form_state['values']['path'];
  if (isset($form_state['gallery_assist_upload_js'])) {
    $node->gallery_items = $form_state['values']['gallery_items'];
  }
  else {
    $node->gallery_items = $form_state['clicked_button']['#post']['gallery_items'];
  }
  if (function_exists('pathauto_menu')) {
    gallery_assist_rebuild_aliases($node, $form_state['values']);
  }

  //
  if (empty($node->gid)) {
    $node->is_new = TRUE;
    gallery_assist_insert($node);
    drupal_set_message(t('The gallery places had to be recreated. Possible causes: The gallery feature was assigned to this content type after the creation of this article or the gallery-assist module has been reinstalled. In order to be able to upload pictures you have to save this node.'));
  }
  else {
    gallery_assist_save($node, $user);
  }

  // Clear the GA cache.
  $cq = "TRUNCATE TABLE {cache_gallery_assist_data}";
  db_query($cq, $node->nid);
}