Skip to content

Commit fe0aaeb

Browse files
committed
Add setting "allow_lp_chamilo_export" to export LP with course builder
BT#10885
1 parent e8472ca commit fe0aaeb

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

main/install/configuration.dist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,9 @@
819819
//ALTER TABLE c_group_info ADD document_access INT DEFAULT 0 NOT NULL;
820820
//$_configuration['group_document_access'] = false;
821821

822+
// Allow LP export to chamilo format (CourseBackup)
823+
//$_configuration['allow_lp_chamilo_export'] = false;
824+
822825
// ------ Custom DB changes (keep this at the end)
823826
// Add user activation by confirmation email
824827
// This option prevents the new user to login in the platform if your account is not confirmed via email

main/lp/lp_controller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,8 @@ function(reponse){
860860
}
861861
break;
862862
case 'export_to_course_build':
863-
if (api_is_allowed_to_edit()) {
863+
$allowExport = api_get_configuration_value('allow_lp_chamilo_export');
864+
if (api_is_allowed_to_edit() && $allowExport) {
864865
if (!$lp_found) {
865866
require 'lp_list.php';
866867
} else {

main/lp/lp_list.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ function confirmation(name) {
403403
$actionSeriousGame = null;
404404
$actionUpdateScormFile = '';
405405
$actionExportToCourseBuild = '';
406+
$allowChamiloExport = api_get_configuration_value('allow_lp_chamilo_export');
406407

407408
if ($is_allowed_to_edit) {
408409
// EDIT LP
@@ -795,14 +796,16 @@ function confirmation(name) {
795796
);
796797
}
797798

798-
$actionExportToCourseBuild = Display::url(
799-
Display::return_icon(
800-
'backup.png',
801-
get_lang('ExportToChamiloFormat')
802-
),
803-
api_get_self().'?'.api_get_cidreq()
804-
."&action=export_to_course_build&lp_id=$id"
805-
);
799+
if ($allowChamiloExport) {
800+
$actionExportToCourseBuild = Display::url(
801+
Display::return_icon(
802+
'backup.png',
803+
get_lang('ExportToChamiloFormat')
804+
),
805+
api_get_self().'?'.api_get_cidreq()
806+
."&action=export_to_course_build&lp_id=$id"
807+
);
808+
}
806809

807810
if ($is_allowed_to_edit) {
808811
$start_time = $start_time;

0 commit comments

Comments
 (0)