From 9dbab31a3121458ac112269ae4146f53df5909ff Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 11 Aug 2014 11:26:42 +0200 Subject: [PATCH] Adding "hide_scorm_copy_link" configuration see BT#8459 --- main/install/configuration.dist.php | 2 ++ main/newscorm/lp_controller.php | 6 ++++++ main/newscorm/lp_list.php | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index 14445a28a9..ae98ea30ca 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -197,3 +197,5 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE; //$_configuration['allow_lp_return_link'] = false; // If true the export link is blocked. //$_configuration['hide_scorm_export_link'] = false; +// If true the copy link is blocked. +//$_configuration['hide_scorm_copy_link'] = false; diff --git a/main/newscorm/lp_controller.php b/main/newscorm/lp_controller.php index 27c8d50e00..575c2abee8 100755 --- a/main/newscorm/lp_controller.php +++ b/main/newscorm/lp_controller.php @@ -683,6 +683,12 @@ switch ($action) { if (!$is_allowed_to_edit) { api_not_allowed(true); } + + global $_configuration; + if (isset($_configuration['hide_scorm_copy_link']) && $_configuration['hide_scorm_copy_link']) { + api_not_allowed(true); + } + if ($debug > 0) error_log('New LP - export action triggered', 0); if (!$lp_found) { error_log('New LP - No learnpath given for copy', 0); require 'lp_list.php'; } else { diff --git a/main/newscorm/lp_list.php b/main/newscorm/lp_list.php index 6861680f4f..caa84d62bc 100755 --- a/main/newscorm/lp_list.php +++ b/main/newscorm/lp_list.php @@ -371,7 +371,7 @@ if (!empty($flat_list)) { $dsp_disk = Display::return_icon('cd_gray.gif', get_lang('Export'), array(), ICON_SIZE_SMALL); } - //Copy + // Copy $copy = Display::url(Display::return_icon('cd_copy.png', get_lang('Copy'), array(), ICON_SIZE_SMALL), api_get_self()."?".api_get_cidreq()."&action=copy&lp_id=$id"); /* Auto Lunch LP code */ @@ -402,7 +402,6 @@ if (!empty($flat_list)) { $dsp_delete = Display::return_icon('delete_na.png', get_lang('LearnpathDeleteLearnpath'), '', ICON_SIZE_SMALL); } - /* COLUMN ORDER */ // Only active while session mode is not active @@ -439,6 +438,11 @@ if (!empty($flat_list)) { $dsp_disk = null; } + if (isset($_configuration['hide_scorm_copy_link']) && $_configuration['hide_scorm_copy_link']) { + $copy = null; + } + + echo $dsp_line.$start_time.$end_time.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_edit_lp.$dsp_visible.$dsp_publish.$dsp_reinit. $dsp_default_view.$dsp_debug.$dsp_disk.$copy.$lp_auto_lunch_icon.$export_icon.$dsp_delete.$dsp_order.$dsp_edit_close;