]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6114
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Jul 2023 08:38:33 +0000 (10:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Jul 2023 08:38:33 +0000 (10:38 +0200)
app/Fluidbook/Compiler/Sound.php [new file with mode: 0644]
app/helpers.php [new file with mode: 0644]

diff --git a/app/Fluidbook/Compiler/Sound.php b/app/Fluidbook/Compiler/Sound.php
new file mode 100644 (file)
index 0000000..f0af0ef
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace App\Fluidbook\Compiler;
+
+trait Sound
+{
+
+    /**
+     * @throws \Exception
+     */
+    protected function writeSounds()
+    {
+        $dir = resource_path('fluidbookpublication/sounds/' . $this->fluidbookSettings->soundTheme);
+
+        if (!$this->fluidbookSettings->soundTheme || $this->fluidbookSettings->soundTheme == 'none' || !file_exists($dir)) {
+            $this->config->set('soundTheme', 'none');
+            return;
+        }
+        $this->config->set('simpleSoundTheme', file_exists($dir . '/flip.mp3'));
+        $this->vdir->copyDirectory($dir, 'data/sounds');
+    }
+}
diff --git a/app/helpers.php b/app/helpers.php
new file mode 100644 (file)
index 0000000..6d99ebc
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+if (!function_exists('dddd')) {
+    function dddd()
+    {
+        $devs = [5, 5908];
+        if (backpack_user() === null || !in_array(backpack_user()->id, $devs)) {
+            return;
+        }
+        return call_user_func_array('dd', func_get_args());
+    }
+}