From: Vincent Vanwaelscappel Date: Mon, 16 Jan 2023 17:58:49 +0000 (+0100) Subject: wip #5397 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b077ae9a6ed1cf63e4c9bda2c5b0438abc212866;p=fluidbook-toolbox.git wip #5397 @3 --- diff --git a/app/Console/Commands/FluidbookPackage.php b/app/Console/Commands/FluidbookPackage.php index 135a5f637..441631da3 100644 --- a/app/Console/Commands/FluidbookPackage.php +++ b/app/Console/Commands/FluidbookPackage.php @@ -2,7 +2,7 @@ namespace App\Console\Commands; -use App\Fluidbook\Packager\Base; +use App\Fluidbook\Packager\Packager; use Cubist\Backpack\Console\Commands\CubistCommand; class FluidbookPackage extends CubistCommand @@ -15,7 +15,7 @@ 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(); } } diff --git a/app/Fluidbook/Packager/Base.php b/app/Fluidbook/Packager/Base.php deleted file mode 100644 index cc0e68b9d..000000000 --- a/app/Fluidbook/Packager/Base.php +++ /dev/null @@ -1,305 +0,0 @@ -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/' '{}' \;`; - } - } -} diff --git a/app/Fluidbook/Packager/Download.php b/app/Fluidbook/Packager/Download.php new file mode 100644 index 000000000..c5d6d2e02 --- /dev/null +++ b/app/Fluidbook/Packager/Download.php @@ -0,0 +1,93 @@ +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); + } +} diff --git a/app/Fluidbook/Packager/Online.php b/app/Fluidbook/Packager/Online.php index 7d5c61e11..57b7b59a3 100644 --- a/app/Fluidbook/Packager/Online.php +++ b/app/Fluidbook/Packager/Online.php @@ -6,7 +6,7 @@ use App\Jobs\FluidbookCompiler; use App\Models\FluidbookPublication; use Cubist\Util\CommandLine; -class Online extends Base +class Online extends Packager { protected $origHTML; protected $_labels = array(); diff --git a/app/Fluidbook/Packager/Packager.php b/app/Fluidbook/Packager/Packager.php new file mode 100644 index 000000000..a351fc5ce --- /dev/null +++ b/app/Fluidbook/Packager/Packager.php @@ -0,0 +1,305 @@ +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/' '{}' \;`; + } + } +} diff --git a/app/Fluidbook/Packager/USBKey.php b/app/Fluidbook/Packager/USBKey.php index 91082f949..78e855e10 100644 --- a/app/Fluidbook/Packager/USBKey.php +++ b/app/Fluidbook/Packager/USBKey.php @@ -10,7 +10,7 @@ class USBKey extends MacOS $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"; diff --git a/app/Fluidbook/Packager/WindowsZIP.php b/app/Fluidbook/Packager/WindowsZIP.php index 386a9d5b4..512fdd332 100644 --- a/app/Fluidbook/Packager/WindowsZIP.php +++ b/app/Fluidbook/Packager/WindowsZIP.php @@ -7,7 +7,7 @@ use Cubist\Util\CommandLine; use Cubist\Util\Files\Files; use Cubist\Util\Text; -class WindowsZIP extends Base +class WindowsZIP extends Packager { protected $exeName; protected $appName; diff --git a/app/Http/Controllers/Admin/CrudController.php b/app/Http/Controllers/Admin/CrudController.php index 560a9461f..bed63b7f7 100644 --- a/app/Http/Controllers/Admin/CrudController.php +++ b/app/Http/Controllers/Admin/CrudController.php @@ -19,7 +19,7 @@ class CrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagicContr /* */ - protected $_modelNamespace = 'App\Models\Base\ToolboxSettingsModel'; + protected $_modelNamespace = 'App\Models\Base\ToolboxHRModel'; protected $_routeURL = ''; protected $_singular = ''; protected $_plural = ''; diff --git a/app/Http/Controllers/Admin/FluidbookPublicationCrudController.php b/app/Http/Controllers/Admin/FluidbookPublicationCrudController.php index 70fe82f9b..0520381fb 100644 --- a/app/Http/Controllers/Admin/FluidbookPublicationCrudController.php +++ b/app/Http/Controllers/Admin/FluidbookPublicationCrudController.php @@ -4,17 +4,16 @@ namespace App\Http\Controllers\Admin; 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; diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/DownloadOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/DownloadOperation.php index 1b9ea01a8..d95eeb813 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/DownloadOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/DownloadOperation.php @@ -2,8 +2,8 @@ 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; @@ -11,7 +11,8 @@ trait DownloadOperation { 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() @@ -19,8 +20,31 @@ trait DownloadOperation $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')); } } diff --git a/app/Http/Controllers/Admin/TeamLeaveCrudController.php b/app/Http/Controllers/Admin/TeamLeaveCrudController.php index ef983bd13..1ea8207f2 100644 --- a/app/Http/Controllers/Admin/TeamLeaveCrudController.php +++ b/app/Http/Controllers/Admin/TeamLeaveCrudController.php @@ -11,6 +11,7 @@ class TeamLeaveCrudController extends \Cubist\Backpack\Magic\Controllers\CubistM 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; diff --git a/app/Http/Controllers/Admin/UsersCrudController.php b/app/Http/Controllers/Admin/UsersCrudController.php index c32f5f1a1..63ffb0d9f 100644 --- a/app/Http/Controllers/Admin/UsersCrudController.php +++ b/app/Http/Controllers/Admin/UsersCrudController.php @@ -18,7 +18,7 @@ class UsersCrudController extends \Cubist\Backpack\Magic\Controllers\CubistMagic __('utilisateurs') */ - protected $_modelNamespace = 'App\Models\AuthUser'; + protected $_modelNamespace = 'App\Models\CubedesignersTeamMember'; protected $_routeURL = 'users'; protected $_singular = 'utilisateur'; protected $_plural = 'utilisateurs'; diff --git a/public/packages/fluidbook/toolbox/js/contextdownload.js b/public/packages/fluidbook/toolbox/js/contextdownload.js index 0c3f32b3f..e030de709 100644 --- a/public/packages/fluidbook/toolbox/js/contextdownload.js +++ b/public/packages/fluidbook/toolbox/js/contextdownload.js @@ -9,21 +9,27 @@ $(function () { 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) { diff --git a/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php b/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php index 33e1e9fe3..4913a9951 100644 --- a/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php +++ b/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php @@ -1,14 +1,37 @@ @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' + ]; } } @@ -18,6 +41,6 @@ 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()}}" > {{__('Télécharger')}} diff --git a/routes/backpack/custom.php b/routes/backpack/custom.php index a0931c777..36d28313e 100644 --- a/routes/backpack/custom.php +++ b/routes/backpack/custom.php @@ -4,17 +4,29 @@ Route::group([ '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'); });