Admin: Add setting 'disable_slideshow_documents' BT#17404

pull/3308/head
Julio Montoya 5 years ago
parent d3c839ceb9
commit 5836af685e
  1. 4
      main/document/document.php
  2. 7
      main/document/slideshow.php
  3. 9
      main/document/slideshowoptions.php
  4. 3
      main/install/configuration.dist.php

@ -1759,12 +1759,16 @@ if ($isAllowedToEdit ||
); );
} }
} }
if (!isset($_GET['keyword']) && !$is_certificate_mode) { if (!isset($_GET['keyword']) && !$is_certificate_mode) {
$disable = api_get_configuration_value('disable_slideshow_documents');
if (false === $disable) {
$actionsLeft .= Display::url( $actionsLeft .= Display::url(
Display::return_icon('slideshow.png', get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM), 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 api_get_path(WEB_CODE_PATH).'document/slideshow.php?'.api_get_cidreq().'&curdirpath='.$curdirpathurl.'&id='.$document_id
); );
} }
}
if ($isAllowedToEdit && !$is_certificate_mode) { if ($isAllowedToEdit && !$is_certificate_mode) {
$actionsLeft .= Display::url( $actionsLeft .= Display::url(

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;
@ -7,13 +8,15 @@ use ChamiloSession as Session;
* @author Patrick Cool patrick.cool@UGent.be Ghent University Mai 2004 * @author Patrick Cool patrick.cool@UGent.be Ghent University Mai 2004
* @author Julio Montoya Lots of improvements, cleaning, adding security * @author Julio Montoya Lots of improvements, cleaning, adding security
* @author Juan Carlos Raña Trabado herodoto@telefonica.net January 2008 * @author Juan Carlos Raña Trabado herodoto@telefonica.net January 2008
*
* @package chamilo.document
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script(); 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; $curdirpath = $path = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
$pathurl = urlencode($path); $pathurl = urlencode($path);

@ -1,13 +1,10 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; 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 * @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. * 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. * 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'; require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script(); api_protect_course_script();
if (api_get_configuration_value('disable_slideshow_documents')) {
api_not_allowed(true);
}
$path = Security::remove_XSS($_GET['curdirpath']); $path = Security::remove_XSS($_GET['curdirpath']);
$pathurl = urlencode($path); $pathurl = urlencode($path);

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

Loading…
Cancel
Save