From 71861554071070dc8f30d5bac2afafd1d82278df Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 21 Jun 2023 19:45:04 +0100 Subject: [PATCH] Fix image placeholders and translation --- CRM/Mosaico/Graphics/Intervention.php | 2 +- CRM/Mosaico/Page/Editor.php | 10 +++++----- CRM/Mosaico/Utils.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Mosaico/Graphics/Intervention.php b/CRM/Mosaico/Graphics/Intervention.php index 3745c7653..42433b723 100644 --- a/CRM/Mosaico/Graphics/Intervention.php +++ b/CRM/Mosaico/Graphics/Intervention.php @@ -11,7 +11,7 @@ */ class CRM_Mosaico_Graphics_Intervention extends CRM_Mosaico_Graphics_Interface { - const FONT_PATH = 'packages/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.ttf'; + const FONT_PATH = 'packages/mosaico/dist/rs/notoregular/noto-sans-400-normal.ttf'; /** * CRM_Mosaico_Graphics_Intervention constructor. diff --git a/CRM/Mosaico/Page/Editor.php b/CRM/Mosaico/Page/Editor.php index 22fddddaf..d9d892a13 100644 --- a/CRM/Mosaico/Page/Editor.php +++ b/CRM/Mosaico/Page/Editor.php @@ -24,8 +24,8 @@ protected function getScriptUrls() { $mosaicoDistUrl = CRM_Mosaico_Utils::getMosaicoDistUrl('relative'); $mosaicoExtUrl = CRM_Core_Resources::singleton()->getUrl('uk.co.vedaconsulting.mosaico'); return [ - "{$mosaicoDistUrl}/rs/mosaico-libs-and-tinymce.min.js?v=0.18&r={$cacheCode}", - "{$mosaicoDistUrl}/rs/mosaico.min.js?v=0.18&r={$cacheCode}", + "{$mosaicoDistUrl}/mosaico-libs-and-tinymce.min.js?v=0.18&r={$cacheCode}", + "{$mosaicoDistUrl}/mosaico.min.js?v=0.18&r={$cacheCode}", ]; } @@ -34,8 +34,8 @@ protected function getStyleUrls() { $mosaicoDistUrl = CRM_Mosaico_Utils::getMosaicoDistUrl('relative'); // $mosaicoExtUrl = CRM_Core_Resources::singleton()->getUrl('uk.co.vedaconsulting.mosaico'); return [ - "{$mosaicoDistUrl}/rs/mosaico-libs-and-tinymce.min.css?v=0.18&r={$cacheCode}", - "{$mosaicoDistUrl}/rs/mosaico-material.min.css?v=0.18&r={$cacheCode}", + "{$mosaicoDistUrl}/mosaico-libs-and-tinymce.min.css?v=0.18&r={$cacheCode}", + "{$mosaicoDistUrl}/mosaico-material.min.css?v=0.18&r={$cacheCode}", ]; } @@ -89,7 +89,7 @@ protected function createMosaicoConfig() { // Adding translation strings if exist $locale = CRM_Core_I18n::getLocale(); $lang = CRM_Core_I18n_PseudoConstant::shortForLong($locale); - $translationFile = CRM_Core_Resources::singleton()->getPath(E::LONG_NAME, "packages/mosaico/dist/lang/mosaico-{$lang}.json"); + $translationFile = CRM_Core_Resources::singleton()->getPath(E::LONG_NAME, "packages/mosaico/dist/rs/lang/mosaico-{$lang}.json"); if (file_exists($translationFile)) { $config['strings'] = json_decode(file_get_contents($translationFile)); } diff --git a/CRM/Mosaico/Utils.php b/CRM/Mosaico/Utils.php index b7587faef..ca3b61a1b 100644 --- a/CRM/Mosaico/Utils.php +++ b/CRM/Mosaico/Utils.php @@ -161,7 +161,7 @@ public static function getLayoutPath() { public static function getMosaicoDistUrl($preferFormat, $file = NULL) { $key = "distUrl"; if (!isset(Civi::$statics[__CLASS__][$key])) { - Civi::$statics[__CLASS__][$key] = CRM_Core_Resources::singleton()->getUrl('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist'); + Civi::$statics[__CLASS__][$key] = CRM_Core_Resources::singleton()->getUrl('uk.co.vedaconsulting.mosaico', 'packages/mosaico/dist/rs'); } return self::filterAbsoluteRelative($preferFormat, Civi::$statics[__CLASS__][$key] . ($file ? "/$file" : '')); }