Admin: Add setting 'disable_slideshow_documents' BT#17404

pull/3308/head
Julio Montoya 5 years ago
parent d3c839ceb9
commit 5836af685e
  1. 12
      main/document/document.php
  2. 21
      main/document/slideshow.php
  3. 9
      main/document/slideshowoptions.php
  4. 3
      main/install/configuration.dist.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) {

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
@ -7,13 +8,15 @@ use ChamiloSession as Session;
* @author Patrick Cool patrick.cool@UGent.be Ghent University Mai 2004
* @author Julio Montoya Lots of improvements, cleaning, adding security
* @author Juan Carlos Raña Trabado herodoto@telefonica.net January 2008
*
* @package chamilo.document
*/
require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script();
if (api_get_configuration_value('disable_slideshow_documents')) {
api_not_allowed(true);
}
$curdirpath = $path = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
$courseInfo = api_get_course_info();
$pathurl = urlencode($path);
@ -342,9 +345,9 @@ if ($slide_id == 'all') {
}
$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
$image_tag[] = '<img
$image_tag[] = '<img
src="download.php?doc_url='.$doc_url.'"
border="0"
border="0"
width="'.$image_width.'" height="'.$image_height.'" title="'.$one_image_file.'">';
}
}
@ -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)) {
</script>
<?php
} else {
echo "<img
class=\"img-responsive\"
src='download.php?doc_url=$path/".$image_files_only[$slide]."' alt='".$image_files_only[$slide]."'
echo "<img
class=\"img-responsive\"
src='download.php?doc_url=$path/".$image_files_only[$slide]."' alt='".$image_files_only[$slide]."'
border='0'".$height_width_tags.'>';
}

@ -1,13 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* @author Patrick Cool
*
* @package chamilo.document
*
* @author Patrick Cool, patrick.cool@UGent.be, Ghent University, May 2004, http://icto.UGent.be
* Please bear in mind that this is only an beta release.
* I wrote this quite quick and didn't think too much about it in advance.
@ -27,6 +24,10 @@ use ChamiloSession as Session;
require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script();
if (api_get_configuration_value('disable_slideshow_documents')) {
api_not_allowed(true);
}
$path = Security::remove_XSS($_GET['curdirpath']);
$pathurl = urlencode($path);

@ -1554,6 +1554,9 @@ $_configuration['auth_password_links'] = [
// Allows prevent to the user before leaving a learning path
//$_configuration['lp_prevents_beforeunload'] = false;
// Disable slideshow documents
//$_configuration['disable_slideshow_documents'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

Loading…
Cancel
Save