Ejemplo n.º 1
0
$slider = new \CEOS\Slider\Slider();
/**
 * It's not obligatory to provide and ID, but if one is provided,
 * it must be a number.
 */
if (isset($_POST['id']) && !empty($_POST['id']) && !is_numeric($_POST['id'])) {
    $error = 'status=invalid_id';
    require 'footer.php';
    exit;
} elseif (isset($_POST['id']) && !empty($_POST['id'])) {
    $slider->setID($_POST['id']);
}
$slider->setTitle($_POST['title']);
$slider->setDefaultInterval($_POST['opt-interval']);
$slider->setDefaultTransitionName(@$_POST['opt-transition']);
$slider->setDefaultTransitionDuration(@$_POST['opt-transition-dur']);
$slider->setInitializationDelay(@$_POST['opt-init-delay']);
$slider->setPauseOnMouseOver(@$_POST['opt-pause-mouseover']);
$slider->setShowNextPrev(@$_POST['opt-show-next-prev']);
$slider->setShowNavigation(@$_POST['opt-show-nav']);
$slider->setShowInterval(@$_POST['opt-show-interval']);
$slider->setRestart(@$_POST['opt-restart']);
$slider->setMaxWidth(@$_POST['opt-max-width']);
$slider->setMaxHeight(@$_POST['opt-max-height']);
$slider->setAspectRatio(@$_POST['opt-aspect-ratio']);
$slider->setInitialItem(@$_POST['opt-initial-item']);
/**
 * Here we remove from the DB the items that the client removed from the slider.
 */
if (is_array($_POST['remove'])) {
    foreach ($_POST['remove'] as $id) {