Browse Source

#5142 fix students' thumbnail view in slideshow

Juan Carlos Raña 12 years ago
parent
commit
3a3bc2a13b
2 changed files with 7 additions and 1 deletions
  1. 6 0
      main/document/download.php
  2. 1 1
      main/document/slideshow.php

+ 6 - 0
main/document/download.php

@@ -80,6 +80,12 @@ if (Security::check_abs_path($sys_course_path.$doc_url, $sys_course_path.'/')) {
         // Correct choice for usability
     	$is_visible = DocumentManager::is_visible($doc_url, $_course, api_get_session_id());
     //}
+	
+	//Documents' slideshow thumbnails
+	//correct $is_visible used in below and ??. Now the students can view the thumbnails too
+	$doc_url_thumbs = str_replace('.thumbs/.', '', $doc_url);
+	$is_visible = DocumentManager::is_visible($doc_url_thumbs, $_course, api_get_session_id());
+	
     if (!api_is_allowed_to_edit() && !$is_visible) {
     	Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work.
     	exit; // You shouldn't be here anyway.

+ 1 - 1
main/document/slideshow.php

@@ -316,7 +316,7 @@ $html_table = '';
 echo '<table align="center" width="760px" border="0" cellspacing="10">';
 $i = 0;
 $count_image = count($image_tag);
-$number_image = 6;
+$number_image = 6;//num icons cols to show
 $number_iteration = ceil($count_image/$number_image);
 $p = 0;
 for ($k = 0; $k < $number_iteration; $k++) {