1) { // Based on current pointer and direction of movement we can find the "to" element switch ($action) { case 'moveup': prev($slideshow_files); $to = key($slideshow_files); reset($slideshow_files); $response['is_first_sibling'] = ($slideshow_files[$to] == current($slideshow_files)); $allow_reorder = true; break; case 'movedown': next($slideshow_files); $to = key($slideshow_files); $response['is_last_sibling'] = ($slideshow_files[$to] === end($slideshow_files)); $allow_reorder = true; break; } } if ($allow_reorder && reorder_slideshow_images($slideshow_files[$slideshow_id_index], $slideshow_files[$to])) { $response['sibling'] = $slideshow_files[$to]["ref"]; } echo json_encode($response); exit(); } /* Delete */ if ('true' === $ajax && 'delete' === $action && !is_null($slideshow_id) && enforcePostRequest($ajax)) { $response['error'] = ''; $response['success'] = true; $slideshow_id_index = array_search($slideshow_id, array_column($slideshow_files, 'ref')); if ($slideshow_id_index !== false) { $slideshow_file_info = $slideshow_files[$slideshow_id_index]; } else { $slideshow_file_info = array(); http_response_code(500); $response['error'] = "{$lang['error-failed-to-delete']} {$lang['slideshow-image']} #{$slideshow_id}"; $response['success'] = false; } if (!empty($slideshow_file_info) && !delete_slideshow($slideshow_file_info['ref'])) { http_response_code(500); $response['error'] = "{$lang['error-failed-to-delete']} '{$slideshow_file_info['file_path']}'"; $response['success'] = false; } echo json_encode($response); exit(); } /* Set slideshow flags =================== Available options: - homepage_show - featured_collections_show - login_show */ if ($ajax === 'true' && $action == 'set_flag' && enforcePostRequest($ajax)) { $slideshow_id_index = array_search($slideshow_id, array_column($slideshow_files, 'ref')); if ($slideshow_id_index !== false) { $slideshow = $slideshow_files[$slideshow_id_index]; } $update_status = false; $flag = getval('flag', ''); $value = getval('value', false, true); if ($value !== false && $flag != '') { $slideshow[$flag] = $value; $update_status = set_slideshow( $slideshow_id, $slideshow['resource_ref'], $slideshow['homepage_show'], $slideshow['featured_collections_show'], $slideshow['login_show'] ); } if ($update_status !== false) { http_response_code(200); exit(); } http_response_code(400); exit(); } if ('true' === $ajax && getval("static", "") != "") { if (getval("static", "") == "true") { set_config_option(null, 'static_slideshow_image', true); } else { set_config_option(null, 'static_slideshow_image', false); } } include '../../include/header.php'; ?>

$lang["systemsetup"], 'href' => $baseurl_short . "pages/admin/admin_home.php", 'menu' => true ), array( 'title' => $lang["manage_slideshow"] ) ); renderBreadcrumbs($links_trail); ?>

$slideshow_file_info) { $moveup_disabled = ''; $movedown_disabled = ''; if ($slideshow_index == 0 || count($slideshow_files) == 1) { $moveup_disabled = ' disabled'; } if (($slideshow_index == (count($slideshow_files) - 1)) || count($slideshow_files) == 1) { $movedown_disabled = ' disabled'; } $delete_btn_disabled = ''; if (count($slideshow_files) == 1) { $delete_btn_disabled = ' disabled'; } $homepage_show = ($slideshow_file_info['homepage_show'] == 1 ? 'checked' : ''); $featured_collections_show = ($slideshow_file_info['featured_collections_show'] == 1 ? 'checked' : ''); $login_show = ($slideshow_file_info['login_show'] == 1 ? 'checked' : ''); $slideshow_ref = $slideshow_file_info['ref']; ?>
Slideshow Image <?php echo $slideshow_ref; ?> Slideshow Image <?php echo $slideshow_ref; ?> > > >
onchange="if(this.checked){jQuery.get('?ajax=true&static=true');}else{jQuery.get('?ajax=true&static=false');}">