From: Vincent Vanwaelscappel Date: Wed, 25 Jun 2025 15:41:50 +0000 (+0200) Subject: #7547 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fcf2507eea1335561915a52586666321664263d3;p=fluidbook-toolbox.git #7547 --- diff --git a/app/Fluidbook/Compiler/Accessibility.php b/app/Fluidbook/Compiler/Accessibility.php index 65f65b3cb..e8a9ebdd8 100644 --- a/app/Fluidbook/Compiler/Accessibility.php +++ b/app/Fluidbook/Compiler/Accessibility.php @@ -11,6 +11,23 @@ use PhpOffice\PhpSpreadsheet\Reader\Xlsx; trait Accessibility { + + public function addAudiodescription($link) + { + + $e = explode('.', $link['to']); + $ext = mb_strtolower(array_pop($e)); + if ($ext === 'txt') { + $file = $this->wdir . '/' . $link['to']; + if (file_exists($file)) { + $this->audioDescriptionTextsList[$link['page']] = ['text' => file_get_contents($file)]; + } + } else { + $this->config->set('audiodescription.' . $link['page'], $link['to']); + $this->copyLinkFile($link['to'], 'data/audiodescription/'); + } + } + protected function writeAccessibility() { if ($this->fluidbookSettings->audiodescriptionTexts) { diff --git a/app/Models/ELearningPackage.php b/app/Models/ELearningPackage.php index 8253c1254..5e4042aff 100644 --- a/app/Models/ELearningPackage.php +++ b/app/Models/ELearningPackage.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Fields\SCORMVersion; +use App\Fluidbook\Packager\Packager; use App\Http\Controllers\Admin\Operations\ChangeownerOperation; use App\Http\Controllers\Admin\Operations\ELearningPackage\ImportOperation; use App\Http\Controllers\Admin\Operations\ELearningPackage\PreviewOperation; @@ -172,6 +173,8 @@ class ELearningPackage extends ToolboxModel $tmp = Files::tmpdir(); $vdir->addTemp($tmp); + + $workshop = new WorkshopV2($user); $workshop->installBook($id, $tmp, [], 'scorm'); if (file_exists($tmp . '/imsmanifest.xml')) {