|
3 | 3 |
|
4 | 4 | use Chamilo\CourseBundle\Entity\CLpCategory;
|
5 | 5 | use ChamiloSession as Session;
|
| 6 | +use Symfony\Component\Filesystem\Filesystem; |
| 7 | +use Symfony\Component\Finder\Finder; |
6 | 8 |
|
7 | 9 | /**
|
8 | 10 | * Class learnpath
|
@@ -9730,6 +9732,8 @@ public function scorm_export()
|
9730 | 9732 | $root->appendChild($resources);
|
9731 | 9733 | $xmldoc->appendChild($root);
|
9732 | 9734 |
|
| 9735 | + $copyAll = api_get_configuration_value('add_all_files_in_lp_export'); |
| 9736 | + |
9733 | 9737 | // TODO: Add a readme file here, with a short description and a link to the Reload player
|
9734 | 9738 | // then add the file to the zip, then destroy the file (this is done automatically).
|
9735 | 9739 | // http://www.reload.ac.uk/scormplayer.html - once done, don't forget to close FS#138
|
@@ -9777,6 +9781,29 @@ public function scorm_export()
|
9777 | 9781 | }
|
9778 | 9782 | file_put_contents($dest_file, $string);
|
9779 | 9783 | }
|
| 9784 | + |
| 9785 | + if (file_exists($filePath) && $copyAll) { |
| 9786 | + $extension = $this->get_extension($filePath); |
| 9787 | + if (in_array($extension, ['html', 'html'])) { |
| 9788 | + $containerOrigin = dirname($filePath); |
| 9789 | + $containerDestination = dirname($dest_file); |
| 9790 | + |
| 9791 | + $finder = new Finder(); |
| 9792 | + $finder->files()->in($containerOrigin) |
| 9793 | + ->exclude('share_folder') |
| 9794 | + ->exclude('chat_files') |
| 9795 | + ->exclude('certificates'); |
| 9796 | + |
| 9797 | + if (is_dir($containerOrigin) && is_dir($containerDestination)) { |
| 9798 | + $fs = new Filesystem(); |
| 9799 | + $fs->mirror( |
| 9800 | + $containerOrigin, |
| 9801 | + $containerDestination, |
| 9802 | + $finder |
| 9803 | + ); |
| 9804 | + } |
| 9805 | + } |
| 9806 | + } |
9780 | 9807 | }
|
9781 | 9808 |
|
9782 | 9809 | foreach ($zip_files_abs as $file_path) {
|
|
0 commit comments