From: Vincent Vanwaelscappel Date: Fri, 2 Aug 2024 07:39:54 +0000 (+0200) Subject: wait #7034 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fb488c00b58664cf717308abe9ae57f25788b6c6;p=fluidbook-toolbox.git wait #7034 @1 --- diff --git a/app/Fluidbook/Compiler/PWA.php b/app/Fluidbook/Compiler/PWA.php index 946a93531..e0ce37c51 100644 --- a/app/Fluidbook/Compiler/PWA.php +++ b/app/Fluidbook/Compiler/PWA.php @@ -2,6 +2,8 @@ namespace App\Fluidbook\Compiler; +use Fluidbook\Tools\SVG\SVGTools; + trait PWA { protected function writePWA() @@ -17,6 +19,11 @@ trait PWA '; } + if ($icon = $this->themeAsset('favicon')) { + $path = 'data/images/' . $icon->getFilename(); + $res .= "\n" . ' '; + $this->vdir->copy($icon->getPathname(), $path); + } return $res; } } diff --git a/app/Models/FluidbookTheme.php b/app/Models/FluidbookTheme.php index 96ca7e21c..30ade502f 100644 --- a/app/Models/FluidbookTheme.php +++ b/app/Models/FluidbookTheme.php @@ -549,7 +549,7 @@ class FluidbookTheme extends ToolboxModel 'type' => FluidbookThemeImage::class, 'label' => __('Icone (pour favicon, apps et exe)'), 'mime_types' => ['image/png'], - 'hint' => __('Image PNG de 256x256'), + 'hint' => __('Image PNG de 256x256').', '.__('pas de transparence'), 'translatable' => false, ]); $this->addField([ diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index 436cbe88b..6b7bd0760 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -167,8 +167,10 @@ trait PublicationSettings $this->_offline(); $this->_export(); $this->_demoLink(); + $this->_pwa(); } + protected function _stats() { $this->addSettingField('bigsection_stats', FormSuperSection::class, $this->__('Statistiques et vie privée')); @@ -1981,6 +1983,13 @@ trait PublicationSettings } + protected function _pwa() + { + $this->addSettingField('section_pwa', FormSection::class, $this->__('Progressive Web App')); + $this->addSettingField('pwa_ios', Checkbox::class, $this->__('Activer sur iOS'), ['default' => false]); + $this->addSettingField('pwa_ios_title', Text::class, $this->__('Titre sur l\'écran d\'accueil'), ['hint' => $this->__('Il est recommandé de ne pas dépasser 10 caractères.') . ' ' . $this->__('Laisser vide pour utiliser le titre de la publication'), 'when' => ['pwa_ios' => '1']]); + } + protected function _package() { $this->addSettingField('section_downloads', FormSection::class, $this->__('Versions disponibles au téléchargement'));