From: Vincent Vanwaelscappel Date: Mon, 1 May 2023 08:24:41 +0000 (+0200) Subject: wip #5851 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=aaeefc90bc52df3a37b50f385f755fe33cf7fd93;p=fluidbook-toolbox.git wip #5851 @1 --- diff --git a/app/Fluidbook/Compiler.php b/app/Fluidbook/Compiler.php index 5461ab701..0824e4591 100644 --- a/app/Fluidbook/Compiler.php +++ b/app/Fluidbook/Compiler.php @@ -1711,7 +1711,7 @@ height="0" width="0" style="display:none;visibility:hidden"> $socialTitle = htmlspecialchars($this->fluidbookSettings->facebook_title ?: $titre, ENT_COMPAT); $socialDescription = htmlspecialchars($this->fluidbookSettings->facebook_description ?: $this->fluidbookSettings->seoDescription, ENT_COMPAT); - $socialImage = 'https://toolbox.fluidbook.com/services/socialimage/' . $this->getFluidbook()->cid; + $socialImage = backpack_url('services/socialimage/' . $this->getFluidbook()->cid); $dim = self::getSocialImageSize($this->getFluidbook()); $socialImageWidth = $dim[0]; diff --git a/app/Http/Controllers/Admin/Operations/Files/DownloadOperation.php b/app/Http/Controllers/Admin/Operations/Files/DownloadOperation.php index ad92565ab..e0d73f9e1 100644 --- a/app/Http/Controllers/Admin/Operations/Files/DownloadOperation.php +++ b/app/Http/Controllers/Admin/Operations/Files/DownloadOperation.php @@ -94,13 +94,13 @@ trait DownloadOperation kind display-image url - https://toolbox.fluidbook.com/images/ios/57.png + '.backpack_url('images/ios/57.png').' kind full-size-image url - https://toolbox.fluidbook.com/images/ios/57.png + '.backpack_url('images/ios/57.png').' metadata diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/SocialImageOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/SocialImageOperation.php index d4520467f..c8eb25da7 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/SocialImageOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/Services/SocialImageOperation.php @@ -89,11 +89,8 @@ trait SocialImageOperation if (!file_exists($lock) || filemtime($lock) < time() - 3600) { touch($lock); - $url = 'https://toolbox.fluidbook.com/fluidbook-publication/preview/' . $id . '_' . $fluidbook->hash . '_' . time() . '/?nointerface=1'; - if ((file_exists($res) && filemtime($res) < $limit) || isset($_GET['forcecompile'])) { - $url .= '&force=1'; - } - $url .= '#/page/0'; + $params = ['nointerface' => 1, 'force' => (file_exists($res) && filemtime($res) < $limit) || isset($_GET['forcecompile'])]; + $url = backpack_url('/fluidbook-publication/preview/' . $id . '_' . $fluidbook->hash . '_' . time() . '/', $params); $w = 1200; $h = 628; diff --git a/app/Http/Controllers/Admin/Operations/FluidbookQuote/CreateFromWebsite.php b/app/Http/Controllers/Admin/Operations/FluidbookQuote/CreateFromWebsite.php index 562eaca67..f276017d4 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookQuote/CreateFromWebsite.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookQuote/CreateFromWebsite.php @@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Route; use Spatie\Permission\Models\Role; + // __('!! Demandes de devis fluidbook') trait CreateFromWebsite { @@ -104,9 +105,9 @@ trait CreateFromWebsite if ($post && !$spam) { try { $quote->slack_ts = Slack::send(Slack::fluidbookQuoteChannel, 'Demande de devis', FluidbookQuoteReceived::getMarkdown($post), - ['Je vais voir' => 'https://toolbox.fluidbook.com/fluidbook-quote?status=0', - 'Je m\'en charge' => ['url' => 'https://toolbox.fluidbook.com/fluidbook-quote/' . $quote->id . '/assign/me', 'style' => 'primary'], - 'C\'est du SPAM' => ['url' => 'https://toolbox.fluidbook.com/fluidbook-quote/' . $quote->id . '/spam', 'style' => 'danger'], + ['Je vais voir' => backpack_url('fluidbook-quote', ['status' => 0]), + 'Je m\'en charge' => ['url' => backpack_url('fluidbook-quote/' . $quote->id . '/assign/me'), 'style' => 'primary'], + 'C\'est du SPAM' => ['url' => backpack_url('fluidbook-quote/' . $quote->id . '/spam'), 'style' => 'danger'], ], false); $quote->saveQuietly(); } catch (\Exception $e) { diff --git a/app/Mail/FluidbookQuoteReceived.php b/app/Mail/FluidbookQuoteReceived.php index 8e5d2ae47..4fb56909c 100644 --- a/app/Mail/FluidbookQuoteReceived.php +++ b/app/Mail/FluidbookQuoteReceived.php @@ -19,7 +19,7 @@ class FluidbookQuoteReceived extends Base $this->subject('[Fluidbook Workshop]' . $spam . ' Demande de devis'); if (!$spam) { - $footer = 'Veuillez-vous rendre sur la [Toolbox](https://toolbox.fluidbook.com/fluidbook-quote) pour prendre en charge la demande ou la confier à un revendeur'; + $footer = 'Veuillez-vous rendre sur la [Toolbox](' . backpack_url('fluidbook-quote') . ') pour prendre en charge la demande ou la confier à un revendeur'; } else { $footer = 'Cette demande est un SPAM supposé. Elle n\'a pas été enregistrée dans la Toolbox.'; } diff --git a/app/Models/File.php b/app/Models/File.php index 095fea46f..fcdd05ec8 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -17,6 +17,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Cache; + // __('!! Partage de fichiers') class File extends ToolboxModel { @@ -213,6 +214,6 @@ class File extends ToolboxModel public function getURL() { - return config('url', 'https://toolbox.fluidbook.com') . '/file/' . $this->hash . '/' . $this->name; + return backpack_url('file/' . $this->hash . '/' . $this->name); } } diff --git a/app/Models/FluidbookTheme.php b/app/Models/FluidbookTheme.php index 80c97cc8d..269135e0c 100644 --- a/app/Models/FluidbookTheme.php +++ b/app/Models/FluidbookTheme.php @@ -812,7 +812,7 @@ class FluidbookTheme extends ToolboxSettingsModel } else { $get = ''; } - return 'https://toolbox.fluidbook.com/fluidbook-publication/preview/20098-' . $id . '_f2e0452eed6dba9878016ce5603fdc54_' . time() . '/' . $get . '#/page/' . $page; + return backpack_url('fluidbook-publication/preview/20098-' . $id . '_f2e0452eed6dba9878016ce5603fdc54_' . time() . '/' . $get . '#/page/' . $page); } diff --git a/app/Slack/Slack.php b/app/Slack/Slack.php index 57a1dd26c..b9fa119c8 100644 --- a/app/Slack/Slack.php +++ b/app/Slack/Slack.php @@ -66,7 +66,7 @@ class Slack $data = ['url' => $data]; } if (!$data['url']) { - $data['url'] = 'https://toolbox.fluidbook.com/404'; + $data['url'] = backpack_url('404'); } if ($i < 6) { $a['elements'][] = array_merge([