protected $_default = Version::SCORM_1_2;
public function getOptions()
+ {
+ return static::getSCORMVersions();
+ }
+
+ public static function getSCORMVersions()
{
return [
Version::SCORM_1_2 => 'SCORM 1.2',
// __('Fluidbook ":title" (#:nb) installé sur :server')
protected $_installSubject = 'Fluidbook ":title" (#:nb) installé sur :server';
- public function __construct($entry, $version, $action, $user)
+ protected $_params = [];
+
+ public function __construct($entry, $version, $action, $user, $params = [])
{
parent::__construct($entry, $action, $user);
+ $this->_params = $params;
$this->setVersion($version);
}
protected function _compileandpackage($zip = true)
{
- $packager = Packager::package($this->entry->id, $this->version, $zip);
+ $packager = Packager::package($this->entry->id, $this->version, $zip, true, $this->_params);
$packager->makePackage($zip);
$url = $packager->getFinalURL();
if ($url) {
$packager = new Online($book_id, null, $options);
break;
case 'scorm':
- $packager = new SCORM($book_id, null, $options);
+ $packager = new Scorm($book_id, null, $options);
break;
case 'sharepoint':
$packager = new Sharepoint($book_id, null, $options);
use Cubist\Backpack\Http\Controllers\Base\XSendFileController;
use Illuminate\Support\Facades\Route;
use Prologue\Alerts\Facades\Alert;
+
// __('!!Paramètres des fluidbooks')
trait DownloadOperation
{
{
Route::match(['get'], $segment . '/{id}/delivery', $controller . '@delivery');
Route::match(['get'], $segment . '/{id}/package/{action}/{version}', $controller . '@package');
+ Route::match(['get'], $segment . '/{id}/package/{action}/scorm/{scormversion}', $controller . '@packageScorm');
Route::match(['get'], $segment . '/{id}_{hash}/download/{file}', $controller . '@download')->withoutMiddleware([CheckIfAdmin::class]);;
}
Alert::add('success', __('La compilation a été placée en file d\'attente. Vous recevrez un email lorsqu\'elle sera terminée.'))->flash();
return redirect(backpack_url('fluidbook-publication'));
}
+
+ protected function packageScorm($id, $action, $scormVersion)
+ {
+ if (!FluidbookPublication::hasPermission($id)) {
+ abort(401, __('Cette publication ne peut pas être téléchargée'));
+ }
+ $fluidbook = FluidbookPublication::find($id);
+ if (!$fluidbook->scorm_enabled && !can('fluidbook-publication:download:all-versions')) {
+ abort(401, __('Cette version n\'est pas disponible au téléchargement'));
+ }
+ Download::dispatch($fluidbook, 'scorm', $action, backpack_user(), ['scorm_version' => $scormVersion])->onQueue('download');
+ Alert::add('success', __('La compilation a été placée en file d\'attente. Vous recevrez un email lorsqu\'elle sera terminée.'))->flash();
+ return redirect(backpack_url('fluidbook-publication'));
+ }
}
'fake' => true,
'store_in' => 'settings',
'translatable' => false,
- 'column' => true,
- 'column_label' => '<i class="las la-chalkboard-teacher" title="' . __('Version SCORM') . '"></i>',
- 'column_type' => 'model_function',
- 'column_view_namespace' => 'crud::columns',
- 'column_function_name' => 'getSCORMVersion',
]);
$this->addField('scorm_id', LongText::class, $this->__('Identifiant SCORM'), [
'v2' => '{"type":"text","default":"","editable":true,"label":"\\u00a7!\\u00a7Identifiant SCORM!\\u00a7!","grade":5}',
@if(!isset($crud->seenOwnersList))
- @php $crud->seenOwnersList=true;
+ @php
+ $crud->seenOwnersList=true;
$crud->ajaxOwnerList=\Cubist\Backpack\Magic\Fields\SelectFromArray::hashOptions($column['options']);
@endphp
<style>
<option value="{{$values}}" selected>{!! $v !!}</option>
</select>
</div>
- <a href="#" class="changeowner" title="{{__('Changer le propriétaire')}}">{!! $v !!}</a>
+ <a href="#" class="changeowner" title="{{__('Modifier le propriétaire')}}">{!! $v !!}</a>
</span>
'url'=>$base.'/delivery',
],
];
+ $actions['sep_download']='---------';
foreach (\App\Models\FluidbookPublication::getDownloadVersions() as $k=>$v) {
- $actions['sep_download']='---------';
+ if($k==='scorm'){
+ continue;
+ }
if($entry->{'download_'.$k}){
$actions['download_'.$k]=[
'label'=>$v['label'],
];
}
}
+ if($entry->scorm_enable){
+ $actions['sep_scorm']='---------';
+ foreach (\App\Fields\SCORMVersion::getSCORMVersions() as $k=>$v) {
+ $actions['download_scorm_'.$k]=[
+ 'label'=>__('Version :version',['version'=>$v]),
+ 'url'=>$basePackage.'/download/scorm/'.$k
+ ];
+ }
+ }
if(can('fluibook-publication:download:install-hosting') && ($entry->install_online || $entry->scorm_enable)){
-
$installActions['sep_install']='---------';
if($entry->install_online && $entry->install_online->server && isset($servers[$entry->install_online->server])){
-
$server=$servers[$entry->install_online->server];
if($entry->install_online->path || $server['allows_root']){
$installActions['install_online']=[
if($entry->scorm_enable){
$installActions['scormcloud']=['label'=>__('Tester sur SCORM Cloud'),
- 'url'=> $basePackage.'/scormcloud/scorm'
+ 'url'=> $basePackage.'/scormcloud/scorm'
];
}
if(count($installActions)>1){