You are here

function andromeda_slideshow_save_slideshow in Andromeda Slideshow 7.2

Same name and namespace in other branches
  1. 7 andromeda_slideshow.module \andromeda_slideshow_save_slideshow()

Saves a slideshow to the database

Parameters

$slideshow: the slideshow object

3 calls to andromeda_slideshow_save_slideshow()
andromeda_slideshow_disable_slideshow in includes/andromeda_slideshow.inc
Disables a slideshow
andromeda_slideshow_enable_slideshow in includes/andromeda_slideshow.inc
Enables a slideshow
andromeda_slideshow_form_submit in includes/andromeda_slideshow.forms.inc
Submit handler for andromeda_slideshow_form

File

./andromeda_slideshow.module, line 308
Slideshow for the Andromeda (http://drupal.org/project/andromeda) Theme

Code

function andromeda_slideshow_save_slideshow($slideshow) {
  $fields = array(
    'name' => $slideshow->name,
    'title' => $slideshow->title,
    'description' => $slideshow->description,
    'settings' => drupal_json_encode($slideshow->settings),
  );
  if (empty($slideshow->sid)) {
    $sid = db_insert('slideshows')
      ->fields($fields)
      ->execute();
  }
  else {
    $sid = db_update('slideshows')
      ->fields($fields)
      ->condition('sid', $slideshow->sid)
      ->execute();
  }
  if ($sid) {
    $slideshow->sid = $sid;
  }
  return $slideshow;
}