You are here

function node_gallery_upload_image_form_submit in Node Gallery 6.3

Submit handler for our "Upload Images" form.

_state

Parameters

$form:

File

./node_gallery.pages.inc, line 146
Handles displaying of Node gallery pages.

Code

function node_gallery_upload_image_form_submit($form, &$form_state) {
  global $user;
  $image = new stdClass();
  $image->uid = $user->uid;
  $image->name = isset($user->name) ? $user->name : '';
  $values = $form_state['values'];
  foreach ($values as $key => $value) {
    $image->{$key} = $value;
  }
  node_save($image);
  drupal_set_message(t('Created new image node %title.', array(
    '%title' => $image->title,
  )));
}