From a9fc842b6e4404d7270e64166d40949aae9f3cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Tue, 24 Jul 2012 17:44:58 +0200 Subject: [PATCH] Feature #5142 adding styles to thumbnails --- main/document/slideshow.php | 52 +++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/main/document/slideshow.php b/main/document/slideshow.php index 03f75aad42..3249db0273 100644 --- a/main/document/slideshow.php +++ b/main/document/slideshow.php @@ -34,7 +34,7 @@ if ($path != '/') { $folder = '/'; } $sys_course_path = api_get_path(SYS_COURSE_PATH); - + // Including the functions for the slideshow require_once 'slideshow.inc.php'; @@ -182,16 +182,21 @@ if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resiz $image_tag = array (); if ($slide_id == 'all') { - // Config thumbnails - $row_items = 4;//only in slideshow.php + // Config for make thumbnails $allowed_thumbnail_types = array('jpg','jpeg','gif','png'); - $max_thumbnail_width = 100; - $max_thumbnail_height = 100; - $png_compression = 0;//0(none)-9 - $jpg_quality = 75;//from 0 to 100 (default is 75). More quality less compression + $max_thumbnail_width = 100; + $max_thumbnail_height = 100; + $png_compression = 0;//0(none)-9 + $jpg_quality = 75;//from 0 to 100 (default is 75). More quality less compression $directory_thumbnails=$sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/'; + //Other parameters only for show tumbnails + $row_items = 4;//only in slideshow.php + $number_image = 7;//num icons cols to show + $thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x + $thumbnail_height_frame=$max_thumbnail_height; + // Create the template_thumbnails folder (if no exist) @@ -218,9 +223,10 @@ if ($slide_id == 'all') { } } */ - + // check files and thumbnails 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; $image_thumbnail= $directory_thumbnails.'.'.$one_image_file; @@ -323,7 +329,6 @@ $html_table = ''; echo ''; $i = 0; $count_image = count($image_tag); -$number_image = 6;//num icons cols to show $number_iteration = ceil($count_image/$number_image); $p = 0; for ($k = 0; $k < $number_iteration; $k++) { @@ -331,8 +336,24 @@ for ($k = 0; $k < $number_iteration; $k++) { for ($i = 0; $i < $number_image; $i++) { if (!is_null($image_tag[$p])) { echo ''; + //TODO:move styles to css files and center image vertical + ?> + + + + '; + echo ''.$image_tag[$p].''; + echo ''; + echo ''; } $p++; } @@ -340,6 +361,11 @@ for ($k = 0; $k < $number_iteration; $k++) { } echo '
'; - echo '
'; + + + + + /* ONE AT A TIME VIEW */ $course_id = api_get_course_int_id(); @@ -370,8 +396,8 @@ if ($slide_id != 'all') { echo ''; echo ''; - echo ''; echo ''; echo '';
'; - echo Display::tag('h1',$row['title']); + echo ''; + echo Display::tag('h2',$row['title']); echo '