namespace App\Console\Commands;
-use App\Fluidbook\Packager\Base;
+use App\Fluidbook\Packager\Packager;
use Cubist\Backpack\Console\Commands\CubistCommand;
class FluidbookPackage extends CubistCommand
*/
public function handle()
{
- $packager = Base::package($this->argument('id'), $this->argument('type'), $this->option('zip', false));
+ $packager = Packager::package($this->argument('id'), $this->argument('type'), $this->option('zip', false));
$packager->handle();
}
}
+++ /dev/null
-<?php
-
-namespace App\Fluidbook\Packager;
-
-use App\Jobs\FluidbookCompiler;
-use App\Models\FluidbookPublication;
-use App\Models\FluidbookTheme;
-use Cubist\Util\CommandLine;
-use Cubist\Util\Files\Files;
-use Cubist\Util\PHP;
-use Cubist\Util\Text;
-use Exception;
-
-class Base extends \App\Jobs\Base
-{
-
- protected $dir;
- protected $vdir;
-
- /**
- * @var FluidbookPublication
- */
- public $book;
- /** @var FluidbookTheme */
- protected $theme;
- protected $scormVariant = false;
- protected $book_id;
- protected $themeRoot;
- protected $zip;
- protected $workingDir;
- protected $_clean = true;
- /**
- * @var int
- */
- protected $_time = 0;
- protected $_compileOnConstruct = false;
- public $cleanOnDestruct = true;
-
- public $zipPackage = true;
-
- public $downloadExt='zip';
-
-
- public static function package($book_id, $type, $zipPackage = true, $cleanOnDestruct = true, $options = [])
- {
- $type = str_replace('-', '_', $type);
- switch ($type) {
- case 'html':
- case 'online':
- $packager = new Online($book_id, null, $options);
- break;
- case 'scorm':
- $packager = new SCORM($book_id, null, $options);
- break;
- case 'sharepoint':
- $packager = new Sharepoint($book_id, null, $options);
- break;
- case 'win_html':
- $packager = new OfflineHTML($book_id, null, $options);
- break;
- case 'win_exe_html':
- case 'win_zip':
- $packager = new WindowsZIP($book_id, null, $options);
- break;
- case 'mac_exe_html':
- case 'mac_exe':
- $packager = new MacOS($book_id, null, $options);
- break;
- case 'win_ins_html':
- case 'win_ins':
- $packager = new WindowsInstaller($book_id, null, $options);
- break;
- case 'win_inss_html':
- case 'win_inss':
- case 'win_exe':
- $packager = new WindowsEXE($book_id, null, $options);
- break;
- case 'win_cd_html':
- case 'usbkey':
- $packager = new USBKey($book_id, null, $options);
- break;
- case 'precompiled':
- $packager = new Precompiled($book_id, null, $options);
- break;
- case 'chromeos':
- $packager = new ChromeOS($book_id, null, $options);
- break;
- default:
- throw new Exception('Package type ' . $type . ' not exists');
- }
- $packager->cleanOnDestruct = $packager->cleanOnDestruct && $cleanOnDestruct;
- $packager->zipPackage = $zipPackage;
-
- return $packager;
- }
-
-
- public function __construct($book_id, $vdir = null, $options = [])
- {
-
- $this->_time = time();
- $this->_clean = (null === $vdir);
-
- $this->book_id = $book_id;
-
- $this->vdir = $vdir;
- $this->dir = Files::mkdir($this->packager_path('/' . $book_id));
-
- $this->book = FluidbookPublication::find($book_id);
- $forceCompile = false;
- if (count($options)) {
- $options['forceCompileOnDownload'] = true;
- }
- foreach ($options as $k => $v) {
- $this->book->getSettings()->set($k, $v);
- }
-
- $this->theme = $this->book->getTheme();
-
- $this->workingDir = $this->book->getAssetDir();
-
- if ($this->_compileOnConstruct) {
- $this->compile($forceCompile);
- }
- }
-
- public function handle()
- {
- PHP::neverStop();
- $this->makePackage($this->zipPackage);
- }
-
- protected function packager_path($path = '')
- {
- return protected_path('fluidbookpublication/packager/' . ltrim($path, '/'));
- }
-
-
- protected function resource_path($path)
- {
- return resource_path('fluidbookpublication/packager/' . ltrim($path, '/'));
- }
-
- /**
- * @throws Exception
- */
- protected function compile($forceCompile = false)
- {
- $compiler = new FluidbookCompiler($this->book, $this->scormVariant);
- $compiler->handle();
- }
-
- protected function preparePackage()
- {
- $this->initTempDir();
- }
-
- public function makePackage($zip)
- {
- return $this->preparePackage();
- }
-
- protected function replaceContents($str, $toReplace)
- {
- $res = $str;
- foreach ($toReplace as $k => $v) {
- if (is_null($v)) {
- return;
- }
- $res = str_replace('$' . $k, $v, $res);
- }
- return $res;
- }
-
-
- protected function getBaseFile()
- {
- return $this->type . '-' . date('Ymdhis', $this->_time) . '-' . $this->escapeTitle();
- }
-
- protected function getDownloadURL($ext = '')
- {
- $res = '/download/' . $this->getBaseFile();
- if ($ext != '') {
- $res .= '.' . $ext;
- }
- return url('packager' . $res);
- }
-
- protected function escapeTitle()
- {
- $res = Text::str2URL($this->book->title);
- if ($res == '') {
- $res = 'fluidbook';
- }
- return $res;
- }
-
-
- protected function getPathBase($ext = '')
- {
- $res = '/download/' . $this->getBaseFile();
- if ($ext != '') {
- $res .= '.' . $ext;
- }
-
- return $this->packager_path($res);
- }
-
- protected function zip($zipfile = null)
- {
- Files::mkdir($this->packager_path('download'));
- $final = $this->getPathBase('zip');
- $rename = false;
- if (is_null($zipfile)) {
- $zipfile = $final;
- } else {
- $rename = true;
- }
-
- $dir = $this->getFinalPackageDir();
- if (file_exists($dir)) {
- $zip = new CommandLine('zip');
- $zip->cd($dir);
- $zip->setArg(null, $zipfile);
- $zip->setArg('symlinks');
- $zip->setArg('0');
- $zip->setArg('r');
- $zip->setArg('u');
- $zip->setArg(null, '.');
- $zip->setManualArg('-x "*/\.*"');
- $zip->execute();
- }
-
- if ($rename) {
- rename($zipfile, $final);
- }
- return $final;
- }
-
- public function getFinalPackageDir()
- {
- return $this->vdir;
- }
-
- protected function initTempDir()
- {
- if (is_null($this->vdir)) {
- $this->vdir = $this->dir . $this->type . '/';
- }
- }
-
-
- protected function postPackage()
- {
-
- }
-
- public function copy($source, $dest)
- {
- if (!file_exists($source)) {
- return;
- }
- copy($source, $dest);
- touch($dest, filemtime($source));
- }
-
- /**
- * @throws Exception
- */
- protected function _compileFluidbook($book, $dest = null, $hybrid = false)
- {
- if (null === $dest) {
- $dest = $this->vdir;
- }
-
- $compiler = new FluidbookCompiler($book, $this->scormVariant, false, "latest", null, false, false, false, null, $hybrid);
- $compiler->handle();
-
- $rsync = new CommandLine\Rsync(rtrim($compiler->getFinalPath(), '/'), $dest, true);
- $rsync->execute();
-
- $htmlFiles = array('index');
- $filesToDelete = [];
-
- foreach ($htmlFiles as $name) {
- $html = $book->getSettings()->get('htmlPrepend') . file_get_contents($dest . $name . '.html');
- file_put_contents($dest . '/' . $name . '.' . $this->_ext, $html);
- if ($this->_ext != 'html') {
- $filesToDelete[] = $name . '.html';
- }
- }
-
- $rm = new CommandLine('rm');
- foreach ($filesToDelete as $f) {
- $rm->setArg(null, $dest . '/' . $f);
- }
- $rm->execute();
-
- if ($this->_ext !== 'html') {
- $e = $this->_ext;
- `find $dest -type f -name "*.html" -exec rename 's/\.html$/.$e/' '{}' \;`;
- }
- }
-}
--- /dev/null
+<?php
+
+namespace App\Fluidbook\Packager;
+
+use App\Jobs\DownloadBase;
+use App\Services\ScormCloud;
+use Cubist\Util\Files\Files;
+
+class Download extends DownloadBase
+{
+
+ protected $version = 'online';
+
+ protected $type = 'Fluidbook';
+ // __('Fluidbppl ":title" (#:nb) prêt au téléchargement')
+ protected $_subject = 'Fluidbook ":title" (#:nb) prêt au téléchargement';
+
+ public function __construct($entry, $version, $action, $user)
+ {
+ parent::__construct($entry, $action, $user);
+ $this->setVersion($version);
+ }
+
+ /**
+ * @return string
+ */
+ public function getVersion(): string
+ {
+ return $this->version;
+ }
+
+ /**
+ * @param string $version
+ */
+ public function setVersion(string $version): void
+ {
+ $this->version = $version;
+ }
+
+ protected function _dest($fname)
+ {
+ return Files::mkdir(storage_path('app/public/' . $this->type . '/download/')) . $fname;
+ }
+
+ protected function _url($fname)
+ {
+ return url('storage/' . $this->type . '/download/' . $fname);
+ }
+
+ protected function _title()
+ {
+ return $this->entry->title;
+ }
+
+ protected function _compile()
+ {
+
+ }
+
+ public function handle()
+ {
+ try {
+ $url = $this->_compileandpackage();
+ $subject = __($this->_subject, ['title' => $this->_title(), 'nb' => $this->_id()]);
+ $text = '';
+ $actions = ['Télécharger' => $url];
+
+ if ($this->action === 'scormcloud') {
+ try {
+ $scormURL = ScormCloud::send($url, 'toolbox_' . $this->type . '_' . $this->_id());
+ $actions[__('Tester sur SCORM Cloud')] = $scormURL;
+ } catch (\Exception $e) {
+
+ }
+ $text = __('Une erreur s\'est produite lors de l\'envoi sur SCORM Cloud (App ID :appid) : :error', ['error' => $e->getMessage(), 'appid' => env('SCORM_CLOUD_APP_ID')]);
+ }
+ } catch (\Exception $e) {
+ $subject = __('Erreur lors de la compilation du :type :nb', ['nb' => $this->_id(), 'type' => $this->type]);
+ $text = __('Détails de l\'erreur :message', ['message' => $e->getMessage() . ' at line ' . $e->getLine() . ' of ' . $e->getFile()]);
+ $actions = [];
+ }
+
+ $this->sendNotification($subject, $text, $actions);
+ }
+
+ protected function _compileandpackage()
+ {
+ if($this->action==='download' || $this->action===''){
+ $zip=true;
+ }
+ Packager::package($this->entry->id, $this->version);
+ }
+}
use App\Models\FluidbookPublication;
use Cubist\Util\CommandLine;
-class Online extends Base
+class Online extends Packager
{
protected $origHTML;
protected $_labels = array();
--- /dev/null
+<?php
+
+namespace App\Fluidbook\Packager;
+
+use App\Jobs\FluidbookCompiler;
+use App\Models\FluidbookPublication;
+use App\Models\FluidbookTheme;
+use Cubist\Util\CommandLine;
+use Cubist\Util\Files\Files;
+use Cubist\Util\PHP;
+use Cubist\Util\Text;
+use Exception;
+
+class Packager extends \App\Jobs\Base
+{
+
+ protected $dir;
+ protected $vdir;
+
+ /**
+ * @var FluidbookPublication
+ */
+ public $book;
+ /** @var FluidbookTheme */
+ protected $theme;
+ protected $scormVariant = false;
+ protected $book_id;
+ protected $themeRoot;
+ protected $zip;
+ protected $workingDir;
+ protected $_clean = true;
+ /**
+ * @var int
+ */
+ protected $_time = 0;
+ protected $_compileOnConstruct = false;
+ public $cleanOnDestruct = true;
+
+ public $zipPackage = true;
+
+ public $downloadExt='zip';
+
+
+ public static function package($book_id, $type, $zipPackage = true, $cleanOnDestruct = true, $options = [])
+ {
+ $type = str_replace('-', '_', $type);
+ switch ($type) {
+ case 'html':
+ case 'online':
+ $packager = new Online($book_id, null, $options);
+ break;
+ case 'scorm':
+ $packager = new SCORM($book_id, null, $options);
+ break;
+ case 'sharepoint':
+ $packager = new Sharepoint($book_id, null, $options);
+ break;
+ case 'win_html':
+ $packager = new OfflineHTML($book_id, null, $options);
+ break;
+ case 'win_exe_html':
+ case 'win_zip':
+ $packager = new WindowsZIP($book_id, null, $options);
+ break;
+ case 'mac_exe_html':
+ case 'mac_exe':
+ $packager = new MacOS($book_id, null, $options);
+ break;
+ case 'win_ins_html':
+ case 'win_ins':
+ $packager = new WindowsInstaller($book_id, null, $options);
+ break;
+ case 'win_inss_html':
+ case 'win_inss':
+ case 'win_exe':
+ $packager = new WindowsEXE($book_id, null, $options);
+ break;
+ case 'win_cd_html':
+ case 'usbkey':
+ $packager = new USBKey($book_id, null, $options);
+ break;
+ case 'precompiled':
+ $packager = new Precompiled($book_id, null, $options);
+ break;
+ case 'chromeos':
+ $packager = new ChromeOS($book_id, null, $options);
+ break;
+ default:
+ throw new Exception('Package type ' . $type . ' not exists');
+ }
+ $packager->cleanOnDestruct = $packager->cleanOnDestruct && $cleanOnDestruct;
+ $packager->zipPackage = $zipPackage;
+
+ return $packager;
+ }
+
+
+ public function __construct($book_id, $vdir = null, $options = [])
+ {
+
+ $this->_time = time();
+ $this->_clean = (null === $vdir);
+
+ $this->book_id = $book_id;
+
+ $this->vdir = $vdir;
+ $this->dir = Files::mkdir($this->packager_path('/' . $book_id));
+
+ $this->book = FluidbookPublication::find($book_id);
+ $forceCompile = false;
+ if (count($options)) {
+ $options['forceCompileOnDownload'] = true;
+ }
+ foreach ($options as $k => $v) {
+ $this->book->getSettings()->set($k, $v);
+ }
+
+ $this->theme = $this->book->getTheme();
+
+ $this->workingDir = $this->book->getAssetDir();
+
+ if ($this->_compileOnConstruct) {
+ $this->compile($forceCompile);
+ }
+ }
+
+ public function handle()
+ {
+ PHP::neverStop();
+ $this->makePackage($this->zipPackage);
+ }
+
+ protected function packager_path($path = '')
+ {
+ return protected_path('fluidbookpublication/packager/' . ltrim($path, '/'));
+ }
+
+
+ protected function resource_path($path)
+ {
+ return resource_path('fluidbookpublication/packager/' . ltrim($path, '/'));
+ }
+
+ /**
+ * @throws Exception
+ */
+ protected function compile($forceCompile = false)
+ {
+ $compiler = new FluidbookCompiler($this->book, $this->scormVariant);
+ $compiler->handle();
+ }
+
+ protected function preparePackage()
+ {
+ $this->initTempDir();
+ }
+
+ public function makePackage($zip)
+ {
+ return $this->preparePackage();
+ }
+
+ protected function replaceContents($str, $toReplace)
+ {
+ $res = $str;
+ foreach ($toReplace as $k => $v) {
+ if (is_null($v)) {
+ return;
+ }
+ $res = str_replace('$' . $k, $v, $res);
+ }
+ return $res;
+ }
+
+
+ protected function getBaseFile()
+ {
+ return $this->type . '-' . date('Ymdhis', $this->_time) . '-' . $this->escapeTitle();
+ }
+
+ protected function getDownloadURL($ext = '')
+ {
+ $res = '/download/' . $this->getBaseFile();
+ if ($ext != '') {
+ $res .= '.' . $ext;
+ }
+ return url('packager' . $res);
+ }
+
+ protected function escapeTitle()
+ {
+ $res = Text::str2URL($this->book->title);
+ if ($res == '') {
+ $res = 'fluidbook';
+ }
+ return $res;
+ }
+
+
+ protected function getPathBase($ext = '')
+ {
+ $res = '/download/' . $this->getBaseFile();
+ if ($ext != '') {
+ $res .= '.' . $ext;
+ }
+
+ return $this->packager_path($res);
+ }
+
+ protected function zip($zipfile = null)
+ {
+ Files::mkdir($this->packager_path('download'));
+ $final = $this->getPathBase('zip');
+ $rename = false;
+ if (is_null($zipfile)) {
+ $zipfile = $final;
+ } else {
+ $rename = true;
+ }
+
+ $dir = $this->getFinalPackageDir();
+ if (file_exists($dir)) {
+ $zip = new CommandLine('zip');
+ $zip->cd($dir);
+ $zip->setArg(null, $zipfile);
+ $zip->setArg('symlinks');
+ $zip->setArg('0');
+ $zip->setArg('r');
+ $zip->setArg('u');
+ $zip->setArg(null, '.');
+ $zip->setManualArg('-x "*/\.*"');
+ $zip->execute();
+ }
+
+ if ($rename) {
+ rename($zipfile, $final);
+ }
+ return $final;
+ }
+
+ public function getFinalPackageDir()
+ {
+ return $this->vdir;
+ }
+
+ protected function initTempDir()
+ {
+ if (is_null($this->vdir)) {
+ $this->vdir = $this->dir . $this->type . '/';
+ }
+ }
+
+
+ protected function postPackage()
+ {
+
+ }
+
+ public function copy($source, $dest)
+ {
+ if (!file_exists($source)) {
+ return;
+ }
+ copy($source, $dest);
+ touch($dest, filemtime($source));
+ }
+
+ /**
+ * @throws Exception
+ */
+ protected function _compileFluidbook($book, $dest = null, $hybrid = false)
+ {
+ if (null === $dest) {
+ $dest = $this->vdir;
+ }
+
+ $compiler = new FluidbookCompiler($book, $this->scormVariant, false, "latest", null, false, false, false, null, $hybrid);
+ $compiler->handle();
+
+ $rsync = new CommandLine\Rsync(rtrim($compiler->getFinalPath(), '/'), $dest, true);
+ $rsync->execute();
+
+ $htmlFiles = array('index');
+ $filesToDelete = [];
+
+ foreach ($htmlFiles as $name) {
+ $html = $book->getSettings()->get('htmlPrepend') . file_get_contents($dest . $name . '.html');
+ file_put_contents($dest . '/' . $name . '.' . $this->_ext, $html);
+ if ($this->_ext != 'html') {
+ $filesToDelete[] = $name . '.html';
+ }
+ }
+
+ $rm = new CommandLine('rm');
+ foreach ($filesToDelete as $f) {
+ $rm->setArg(null, $dest . '/' . $f);
+ }
+ $rm->execute();
+
+ if ($this->_ext !== 'html') {
+ $e = $this->_ext;
+ `find $dest -type f -name "*.html" -exec rename 's/\.html$/.$e/' '{}' \;`;
+ }
+ }
+}
$this->replaceAutorun();
// Package mac app
- $win = ROOT . Base::package($this->book_id, 'win_inss_html', false, false);
+ $win = ROOT . Packager::package($this->book_id, 'win_inss_html', false, false);
$dest = $this->getFinalPackageDir() . "/" . $this->exeName . '.exe';
$cp = "cp $win $dest";
use Cubist\Util\Files\Files;
use Cubist\Util\Text;
-class WindowsZIP extends Base
+class WindowsZIP extends Packager
{
protected $exeName;
protected $appName;
/*
*/
- protected $_modelNamespace = 'App\Models\Base\ToolboxSettingsModel';
+ protected $_modelNamespace = 'App\Models\Base\ToolboxHRModel';
protected $_routeURL = '';
protected $_singular = '';
protected $_plural = '';
class FluidbookPublicationCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicController
{
- use \Cubist\Backpack\Magic\Operations\CreateOperation;
- use \Cubist\Backpack\Http\Controllers\Operations\CloneEditOperation;
- use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
- use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
- use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+ use \Cubist\Backpack\Magic\Operations\CreateOperation;
use \App\Http\Controllers\Admin\Operations\FluidbookPublication\PreviewOperation;
use \App\Http\Controllers\Admin\Operations\FluidbookPublication\EditOperation;
use \App\Http\Controllers\Admin\Operations\FluidbookPublication\CompositionOperation;
use \App\Http\Controllers\Admin\Operations\FluidbookPublication\StatsOperation;
use \App\Http\Controllers\Admin\Operations\FluidbookPublication\DownloadOperation;
+ use \Backpack\CRUD\app\Http\Controllers\Operations\CloneOperation;
+ use \App\Http\Controllers\Admin\Operations\FluidbookPublication\DeletefbOperation;
namespace App\Http\Controllers\Admin\Operations\FluidbookPublication;
-use App\Jobs\ElearningPackageDownload;
-use App\Models\ELearningPackage;
+use App\Fluidbook\Packager\Download;
+use App\Models\FluidbookPublication;
use Illuminate\Support\Facades\Route;
use Prologue\Alerts\Facades\Alert;
{
protected function setupDownloadRoutes($segment, $routeName, $controller)
{
- Route::match(['get'], $segment . '/delivery/{id}_{hash}', $controller . '@delivery');
+ Route::match(['get'], $segment . '/{id}/delivery', $controller . '@delivery');
+ Route::match(['get'], $segment . '/{id}/{action}/{version}', $controller . '@download');
}
protected function setupDownloadDefaults()
$this->crud->addButtonFromView('line', 'download', 'fluidbook_publication.download', 'end');
}
- protected function delivery($id, $hash)
+ protected function delivery($id)
{
+ if (!FluidbookPublication::hasPermission($id)) {
+ abort(401);
+ }
+ }
+
+ /**
+ * @throws \Exception
+ */
+ protected function download($id, $action, $version)
+ {
+ if (!in_array($action, ['download', 'install_hosting', 'install_ftp', 'scormcloud'])) {
+ abort(404, __('Cette action n\'est pas disponible'));
+ }
+ if (!FluidbookPublication::hasPermission($id)) {
+ abort(401, __('Cette publication ne peut pas être téléchargée'));
+ }
+ $fluidbook = FluidbookPublication::find($id);
+ if (!$fluidbook->{'download_' . $version} && !can('fluidbook-publication:download:all-versions')) {
+ abort(401, __('Cette version n\'est pas disponible au téléchargement'));
+ }
+ Download::dispatch($fluidbook, $version, $action, backpack_user())->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'));
}
}
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\BulkDeleteOperation;
use \Cubist\Backpack\Http\Controllers\Operations\ReviseOperation;
+ use \App\Http\Controllers\Admin\Operations\TeamLeave\ICSOperation;
__('utilisateurs')
*/
- protected $_modelNamespace = 'App\Models\AuthUser';
+ protected $_modelNamespace = 'App\Models\CubedesignersTeamMember';
protected $_routeURL = 'users';
protected $_singular = 'utilisateur';
protected $_plural = 'utilisateurs';
var actions = {};
$.each(rawActions, function (key, action) {
- if (typeof action === 'string') {
- action = {'label': action};
- }
- if (action.url === undefined) {
- action.url = route;
- }
- action.url = replaceVariables(action.url, key);
- if (action.target === undefined) {
- action.target = '_self';
+ if (action != '---------') {
+ if (typeof action === 'string') {
+ action = {'label': action};
+ }
+ if (action.url === undefined) {
+ action.url = route;
+ }
+ action.url = replaceVariables(action.url, key);
+ if (action.target === undefined) {
+ action.target = '_self';
+ }
}
actions[key] = action;
});
$.each(actions, function (key, action) {
- items[key] = {name: action.label};
+ if(action!=='---------') {
+ items[key] = {name: action.label};
+ }else{
+ items[key]=action;
+ }
});
function replaceVariables(template, action) {
@php
+ $allVersions=can('fluidbook-publication:download:all-versions');
$actions=[
'delivery'=>
[
'label'=>__('Page de téléchargement'),
- 'url'=>$crud->route.'/delivery/'.$entry->id.'_'.$entry->hash,
+ 'url'=>$crud->route.'/'.$entry->id.'/delivery',
],
];
foreach (\App\Models\FluidbookPublication::getDownloadVersions() as $k=>$v) {
- if(can('fluidbook-publication:download:all-versions') || $entry->{'download_'.$k}){
- $actions['download_'.$k]=['label'=>$v['label'],'url'=>$crud->route.'/download/'.$entry->id.'/'.$k];
+ $actions['sep_download']='---------';
+ if($allVersions || $entry->{'download_'.$k}){
+ $actions['download_'.$k]=[
+ 'label'=>$v['label'],
+ 'url'=>$crud->route.'/'.$entry->id.'/download/'.$k
+ ];
+ }
+ }
+ if(can('fluibook-publication:download:install-hosting')){
+ $actions['sep_install']='---------';
+ $actions['install_hosting']=[
+ 'label'=>__('Installer sur le serveur d\'hébergement'),
+ 'url'=>$crud->route.'/'.$entry->id.'/install_hosting/online',
+ ];
+
+ $actions['install_ftp']=[
+ 'label'=>__('Installer sur un serveur FTP'),
+ 'url'=>$crud->route.'/'.$entry->id.'/install_ftp/online',
+ ];
+
+ if($entry->scorm_enable){
+ $actions['scormcloud']=['label'=>__('Tester sur SCORM Cloud'),
+ 'url'=>$crud->route.'/'.$entry->id.'/scormcloud/scorm'
+ ];
}
}
data-toggle="tooltip"
title="{{__('Télécharger la publication')}}"
data-context-actions="{{json_encode($actions)}}"
- data-context-route="{{$crud->route}}/$id/edit/$action"
+ data-context-route="{{$crud->route}}/$id/download/$action"
data-context-id="{{$entry->getKey()}}"
><i class="la la-arrow-circle-down"></i> {{__('Télécharger')}}</a>
'middleware' => ['web', config('backpack.base.middleware_key', 'admin')],
'namespace' => 'App\Http\Controllers\Admin',
], function () { // custom admin routes
- try {
- Route::crud('users', 'UsersCrudController');
+ Route::crud('elearning-media', 'ElearningMediaCrudController');
+ Route::crud('toolbox-translate', 'ToolboxTranslateCrudController');
+ Route::crud('quiztranslation', 'QuiztranslationCrudController');
+ Route::crud('team-emails', 'TeamEmailsCrudController');
+ Route::crud('fluidbook-quote', 'FluidbookQuoteCrudController');
Route::crud('locale', 'LocaleCrudController');
+ Route::crud('tool-sprite', 'ToolSpriteCrudController');
+ Route::crud('users', 'UsersCrudController');
+ Route::crud('users', 'UsersCrudController');
+ Route::crud('quiz', 'QuizCrudController');
Route::crud('page', 'PageCrudController');
- Route::crud('quizatttempt', 'QuizatttemptCrudController');
- Route::crud('quiztranslation', 'QuiztranslationCrudController');
Route::crud('settings', 'SettingsCrudController');
+ Route::crud('team-leave', 'TeamLeaveCrudController');
+ Route::crud('team-overtime', 'TeamOvertimeCrudController');
+ Route::crud('fluidbook-collection', 'FluidbookCollectionCrudController');
+ Route::crud('fluidbook-document', 'FluidbookDocumentCrudController');
+ Route::crud('fluidbook-publication', 'FluidbookPublicationCrudController');
+ Route::crud('quizatttempt', 'QuizatttemptCrudController');
+ Route::crud('elearning-package', 'ElearningPackageCrudController');
+ Route::crud('fluidbook-theme', 'FluidbookThemeCrudController');
+ Route::crud('company', 'CompanyCrudController');
Route::crud('signature', 'SignatureCrudController');
- Route::crud('team-emails', 'TeamEmailsCrudController');
- Route::crud('toolbox-translate', 'ToolboxTranslateCrudController');
- } catch(\Throwable $e) {
-
- }
+ Route::crud('fluidbook-iconset', 'FluidbookIconsetCrudController');
+ Route::crud('users', 'UsersCrudController');
+ Route::crud('fluidbook-translate', 'FluidbookTranslateCrudController');
});