$sldItem->setDescription(@$item['desc']); $sldItem->setURL(@$item['url']); $sldItem->setTransitionName(@$item['transition']); if (isset($item['transition-dur']) && is_numeric($item['transition-dur'])) { $sldItem->setTransitionDuration($item['transition-dur'] * 1000); } if (isset($item['interval']) && is_numeric($item['interval'])) { $sldItem->setInterval($item['interval'] * 1000); } if (isset($item['img']['src']) && !empty($item['img']['src'])) { $sldItem->setImageSource($item['img']['src']); } if (isset($item['slider-id']) && is_numeric($item['slider-id'])) { $sldItem->setSliderID($item['slider-id']); } $slider->addItem($sldItem); } /** * Here we try to push the slider into the database. If, for some reason, * this procedure fails, a server error is returned to the client. Otherwise * we let the script finish its course, which will return a success * response to the client. */ if (!$slider->pushIntoDatabase()) { $error = 'status=push_error'; require 'footer.php'; exit; } $query .= '&edit=' . $slider->getID(); } require 'footer.php';