diff --git a/main/document/document.php b/main/document/document.php index 2d88ceddc5..b9a9c5862c 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -1759,11 +1759,15 @@ if ($isAllowedToEdit || ); } } + if (!isset($_GET['keyword']) && !$is_certificate_mode) { - $actionsLeft .= Display::url( - Display::return_icon('slideshow.png', get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM), - api_get_path(WEB_CODE_PATH).'document/slideshow.php?'.api_get_cidreq().'&curdirpath='.$curdirpathurl.'&id='.$document_id - ); + $disable = api_get_configuration_value('disable_slideshow_documents'); + if (false === $disable) { + $actionsLeft .= Display::url( + Display::return_icon('slideshow.png', get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM), + api_get_path(WEB_CODE_PATH).'document/slideshow.php?'.api_get_cidreq().'&curdirpath='.$curdirpathurl.'&id='.$document_id + ); + } } if ($isAllowedToEdit && !$is_certificate_mode) { diff --git a/main/document/slideshow.php b/main/document/slideshow.php index ab2094ee86..fa8f5c060c 100755 --- a/main/document/slideshow.php +++ b/main/document/slideshow.php @@ -1,4 +1,5 @@ '; } } @@ -404,8 +407,8 @@ if ($slide_id != 'all' && !empty($image_files_only)) { $pathpart = $path.'/'; } $sql = "SELECT * FROM $tbl_documents - WHERE - c_id = $course_id AND + WHERE + c_id = $course_id AND path = '".Database::escape_string($pathpart.$image_files_only[$slide])."'"; $result = Database::query($sql); $row = Database::fetch_array($result); @@ -472,9 +475,9 @@ if ($slide_id != 'all' && !empty($image_files_only)) { '; } diff --git a/main/document/slideshowoptions.php b/main/document/slideshowoptions.php index b8c5eb1517..4606d8346f 100755 --- a/main/document/slideshowoptions.php +++ b/main/document/slideshowoptions.php @@ -1,13 +1,10 @@