]> _ Git - odl.git/commitdiff
wip #5084 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 9 Feb 2022 10:20:18 +0000 (11:20 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 9 Feb 2022 10:20:18 +0000 (11:20 +0100)
app/Http/Controllers/FrontController.php
routes/web.php

index db857553ce9c07b7b5ca9103bd4c404ea53a269c..14c9ca5357a8229942b8fe28aac37d4a9f10d6fd 100644 (file)
@@ -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(),
index 07fdb815142f053f4a4a64c85e2792f7442a2098..e851a5475038099a8cf5d970bc998ff2d71f1844 100644 (file)
@@ -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' => '.*']);
 });