You are here

function andromeda_slideshow_form_submit in Andromeda Slideshow 7

Same name and namespace in other branches
  1. 7.2 includes/andromeda_slideshow.forms.inc \andromeda_slideshow_form_submit()

Submit handler for andromeda_slideshow_form

File

includes/andromeda_slideshow.forms.inc, line 112
Form definitions for andromeda slideshow module

Code

function andromeda_slideshow_form_submit($form, &$form_state) {
  $slideshow = $form['#slideshow'];
  $settings = $form_state['values'];
  $slideshow->title = check_plain($settings['title']);
  $slideshow->name = check_plain($settings['name']);
  $slideshow->description = check_plain($settings['description']);

  //unset some values that are not needed
  unset($settings['title'], $settings['name'], $settings['description'], $settings['submit'], $settings['form_build_id'], $settings['form_id'], $settings['form_token'], $settings['op']);
  $slideshow->settings = $settings;

  //save the slideshow
  $slideshow = andromeda_slideshow_save_slideshow($slideshow);
  if ($slideshow->sid) {
    drupal_set_message(t('Slideshow @name was saved successfully.', array(
      '@name' => $slideshow->title,
    )));
    $form_state['redirect'] = 'admin/structure/slideshows';
  }
}