Security::remove_XSS($url), 'name' => $originaltoolname); // Because $nametools uses $_SERVER['PHP_SELF'] for the breadcrumbs instead of $_SERVER['REQUEST_URI'], I had to // bypass the $nametools thing and use tags in the $interbreadcrump array //$url = 'slideshow.php?curdirpath='.$pathurl; $originaltoolname = get_lang('SlideShow'); //$interbreadcrumb[] = array('url'=>$url, 'name' => $originaltoolname); Display :: display_header($originaltoolname, 'Doc'); // Loading the slides from the session if (isset($_SESSION['image_files_only'])) { $image_files_only = $_SESSION['image_files_only']; } // Calculating the current slide, next slide, previous slide and the number of slides if ($slide_id != 'all') { $slide = $slide_id ? $slide_id : 0; $previous_slide = $slide - 1; $next_slide = $slide + 1; } $total_slides = count($image_files_only); ?>
';
} else {
$imgp = 'action_prev.png';
$first = '
';
}
// First slide
echo $first;
// Previous slide
if ($slide > 0) {
echo '';
}
echo '
';
} else {
$imgn = 'action_next.png';
$last = '
';
}
echo '
'.get_lang('_set_slideshow_options').' ';
?>
';
/* TREATING THE POST DATA FROM SLIDESHOW OPTIONS */
// If we come from slideshowoptions.php we sessionize (new word !!! ;-) the options
if (isset($_POST['Submit'])) {
// We come from slideshowoptions.php
$_SESSION["image_resizing"] = Security::remove_XSS($_POST['radio_resizing']);
if ($_POST['radio_resizing'] == "resizing" && $_POST['width'] != '' && $_POST['height'] != '') {
//echo "resizing";
$_SESSION["image_resizing_width"] = Security::remove_XSS($_POST['width']);
$_SESSION["image_resizing_height"] = Security::remove_XSS($_POST['height']);
} else {
//echo "unsetting the session heighte and width";
$_SESSION["image_resizing_width"] = null;
$_SESSION["image_resizing_height"] = null;
}
}
// The target height and width depends if we choose resizing or no resizing
if ($_SESSION["image_resizing"] == "resizing") {
$target_width = $_SESSION["image_resizing_width"];
$target_height = $_SESSION["image_resizing_height"];
} else {
$image_width = $source_width;
$image_height = $source_height;
}
/* THUMBNAIL VIEW */
// This is for viewing all the images in the slideshow as thumbnails.
$image_tag = array ();
if ($slide_id == 'all') {
$thumbnail_width = 100;
$thumbnail_height = 100;
$row_items = 4;
if (is_array($image_files_only)) {
foreach ($image_files_only as $one_image_file) {
$image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
if (file_exists($image)) {
$image_height_width = resize_image($image, $thumbnail_width, $thumbnail_height, 1);
$image_height = $image_height_width[0];
$image_width = $image_height_width[1];
$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
$image_tag[] = '| ';
echo ' '.$image_tag[$p].'';
echo ' | ';
}
$p++;
}
echo '
| '; echo $row['title']; echo ' | '; echo '
| ';
if ($slide < $total_slides - 1 && $slide_id != 'all') {
echo "";
} else {
echo "";
}
echo " | ';
echo '
| '; echo $row['comment']; echo ' | '; echo '