]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6248 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Sep 2023 09:38:25 +0000 (11:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Sep 2023 09:38:25 +0000 (11:38 +0200)
app/Models/Base/ToolboxContentTranslate.php
app/Models/ElearningTranslate.php
app/Models/FluidbookTranslate.php

index 96cbaebd403c7e3f9f5cbbf4d7c7f73894850784..5a0f9e0c67683eccb5e1d5b5a2bd0e0bebe254cc 100644 (file)
@@ -16,6 +16,8 @@ class ToolboxContentTranslate extends Translate
 
     protected static string $_name = 'content';
 
+    protected static $_basePath = '';
+
     protected $_operations = [ExcelExportOperation::class, ExcelImportOperation::class];
 
     public function __construct(array $attributes = [])
@@ -47,10 +49,10 @@ class ToolboxContentTranslate extends Translate
 
     public function getExtensions()
     {
-        return array_merge(parent::getExtensions(), ['js']);
+        return parent::getExtensions() + ['js'];
     }
 
-    public static function getAllTranslations($force = false)
+    public static function getAllTranslations($force = true)
     {
         if (null === static::$_allTranslations) {
             $cacheKey = 'all_' . static::$_name . '_translations';
@@ -124,4 +126,14 @@ class ToolboxContentTranslate extends Translate
         return $all[$locale] ?? [];
     }
 
+    public function getPaths()
+    {
+        $res = [];
+        foreach (static::getActiveBranches() as $branch) {
+            $res['Player - git:' . $branch] = static::$_basePath . '/branches/' . $branch;
+            $res['Player - local:' . $branch] = static::$_basePath . '/local/' . $branch;
+        }
+        return $res;
+    }
+
 }
index 6abe4c46509c07e2cfa8cd4323a2c32eb89addb8..041d997f369f9e10b50641b1c728ef608dfcd56d 100644 (file)
@@ -17,7 +17,8 @@ class ElearningTranslate extends ToolboxContentTranslate
     use QuizBranches;
 
     protected $table = 'elearning_translate';
-    protected static string $_name='elearning';
+    protected static string $_name = 'elearning';
+    protected static $_basePath='resources/quiz/player';
 
     protected $_enableRevisions = false;
 
@@ -27,18 +28,4 @@ class ElearningTranslate extends ToolboxContentTranslate
         'oneinstance' => true];
 
     protected $_operations = [ExcelExportOperation::class, ExcelImportOperation::class];
-
-
-    public function getPaths()
-    {
-        $res = [];
-        foreach (self::getActiveBranches() as $branch) {
-            $res['Player - git:' . $branch] = 'resources/quiz/player/branches/' . $branch . '/js';
-            $res['Player - local:' . $branch] = 'resources/quiz/player/local/' . $branch . '/js';
-        }
-        //$res[__('Compilateur')]='resources/compiler';
-        //$res[__('Application')]=''resources/html5app';
-        return $res;
-    }
-
 }
index 34df1d4e5884577c7d967998a0959b3c4a34f97a..22c153a708d716ef4ac9a81dfa6ebeb837edf414 100644 (file)
@@ -20,6 +20,7 @@ class FluidbookTranslate extends ToolboxContentTranslate
 
     protected $table = 'fluidbook_translate';
     protected static string $_name = 'elearning';
+    protected static $_basePath = 'resources/fluidbookpublication/player';
 
     protected static $_allTranslations = null;
 
@@ -36,19 +37,6 @@ class FluidbookTranslate extends ToolboxContentTranslate
         parent::setFields();
     }
 
-    public function getPaths()
-    {
-        $res = [];
-        foreach (self::getActiveBranches() as $branch) {
-            $res['Player - git:' . $branch] = 'resources/fluidbookpublication/player/branches/' . $branch . '/js';
-            $res['Player - local:' . $branch] = 'resources/fluidbookpublication/player/local/' . $branch . '/js';
-        }
-        //$res[__('Compilateur')]='resources/compiler';
-        //$res[__('Application')]=''resources/html5app';
-        return $res;
-    }
-
-
     public static function getAllFluidbookTranslations($force = false)
     {
         return static::getAllTranslations($force);