From a4eee655ea8a3ca98b240fad4ec06ad02590560b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 9 Feb 2022 11:20:18 +0100 Subject: [PATCH] wip #5084 @0.25 --- app/Http/Controllers/FrontController.php | 11 ++++++++--- routes/web.php | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index db85755..14c9ca5 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -33,7 +33,7 @@ class FrontController extends Controller return view('front.media-library', $this->_getDataFromCMS()); } - public function fluidbook($args = '') + public function fluidbook($args = '', $frontpath = 'coeur', $storagepath = 'out') { if (!$args) { $args = []; @@ -44,10 +44,10 @@ class FrontController extends Controller if (count($args) > 0) { $path = implode('/', $args); } else { - return redirect(backpack_url('front/coeur/index.html')); + return redirect(backpack_url('front/' . $frontpath . '/index.html')); } - $path = storage_path('fluidbook/out') . '/' . $path; + $path = storage_path('fluidbook/' . $storagepath) . '/' . $path; if (file_exists($path)) { @@ -58,6 +58,11 @@ class FrontController extends Controller } + public function fluidbookdemo($args) + { + return $this->fluidbook($args, 'demo', 'demo'); + } + protected function _getDataFromCMS() { return ['menu' => $this->_getMenuFromCMS(), diff --git a/routes/web.php b/routes/web.php index 07fdb81..e851a54 100644 --- a/routes/web.php +++ b/routes/web.php @@ -24,4 +24,5 @@ Route::group([ Route::get('ressources.html', 'FrontController@resources'); Route::get('mediatheque.html', 'FrontController@medialibrary'); Route::get('coeur/{args?}', 'FrontController@fluidbook')->where(['args' => '.*']); + Route::get('demo/{args?}', 'FrontController@fluidbookdemo')->where(['args' => '.*']); }); -- 2.39.5