From 7b3002067d469bde3f35eeb7002c58f7c171cfbb Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Wed, 18 Jun 2014 20:24:56 +0200 Subject: [PATCH] Added proper internationalization --- local/modules/Tinymce/Config/config.xml | 8 ++++++ local/modules/Tinymce/Tinymce.php | 9 ++---- .../default/includes/tinymce_init.tpl | 28 ++++++++++++------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/local/modules/Tinymce/Config/config.xml b/local/modules/Tinymce/Config/config.xml index 42d3733f9..b3ee6037b 100644 --- a/local/modules/Tinymce/Config/config.xml +++ b/local/modules/Tinymce/Config/config.xml @@ -3,4 +3,12 @@ + + + + + + + + diff --git a/local/modules/Tinymce/Tinymce.php b/local/modules/Tinymce/Tinymce.php index 7a3f488a8..388499b13 100644 --- a/local/modules/Tinymce/Tinymce.php +++ b/local/modules/Tinymce/Tinymce.php @@ -14,7 +14,6 @@ namespace Tinymce; use Propel\Runtime\Connection\ConnectionInterface; use Symfony\Component\Filesystem\Filesystem; -use Thelia\Install\Database; use Thelia\Module\BaseModule; class Tinymce extends BaseModule @@ -27,7 +26,6 @@ class Tinymce extends BaseModule public function __construct() { $this->jsPath = __DIR__ . DS .'Resources' . DS . 'js' . DS . 'tinymce'; - $this->mediaPath = __DIR__ . DS .'Resources' . DS . 'media'; $this->webJsPath = THELIA_WEB_DIR . 'tinymce'; $this->webMediaPath = THELIA_WEB_DIR . 'media'; @@ -37,15 +35,14 @@ class Tinymce extends BaseModule */ public function postActivation(ConnectionInterface $con = null) { - // Create symbolic links in the web directory, to make the TinyMCE code - // and the content of the 'media' directory available. $fs = new Filesystem(); + // Create symbolic links in the web directory, to make the TinyMCE code available. if (false === $fs->exists($this->webJsPath)) { $fs->symlink($this->jsPath, $this->webJsPath); } - // Create the media directory in the web root + // Create the media directory in the web root, if required if (false === $fs->exists($this->webMediaPath)) { $fs->mkdir($this->webMediaPath."/upload"); @@ -61,7 +58,6 @@ class Tinymce extends BaseModule $fs = new Filesystem(); $fs->remove($this->webJsPath); - $fs->remove($this->mediaPath); } /** @@ -69,6 +65,7 @@ class Tinymce extends BaseModule */ public function destroy(ConnectionInterface $con = null, $deleteModuleData = false) { + // If we have to delete module data, remove the media directory. if ($deleteModuleData) { $fs = new Filesystem(); diff --git a/local/modules/Tinymce/templates/backOffice/default/includes/tinymce_init.tpl b/local/modules/Tinymce/templates/backOffice/default/includes/tinymce_init.tpl index 72d5c68b6..4b93be9a0 100644 --- a/local/modules/Tinymce/templates/backOffice/default/includes/tinymce_init.tpl +++ b/local/modules/Tinymce/templates/backOffice/default/includes/tinymce_init.tpl @@ -11,24 +11,29 @@ // Set it to true to display the menubar. menubar : false, - // Available language are in Resources/js/tinymce/langs - //language: "{lang attr='locale'}", + // Use our smarty plugin to guess the best available language + language: "{tinymce_lang}", - // Available language are in Resources/js/tinymce/plugins + // See available plugins at http://www.tinymce.com/wiki.php/Plugins plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking", "table contextmenu directionality emoticons paste textcolor responsivefilemanager", - "youtube" + "fullscreen code youtube" ], - toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect | filemanager | link unlink anchor | image media | youtube | forecolor backcolor | print preview code ", - image_advtab: true , - external_filemanager_path:"{url file='/tinymce/filemanager/'}", - filemanager_title:"{intl l='Files manager'}" , + // See available controls at http://www.tinymce.com/wiki.php/Controls + toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | hr | styleselect | filemanager | code | fullscreen", + toolbar2: "link unlink anchor | image responsivefilemanager media youtube | forecolor backcolor | charmap | print preview ", + + image_advtab: true, + + // File manager configuration + external_filemanager_path: "{url file='/tinymce/filemanager/'}", + filemanager_title: "{intl l='File manager'}" , external_plugins: { "filemanager" : "{url file='/tinymce/filemanager/plugin.min.js'}"}, - // Always paste as text, removing external formatting + // Always paste as text, removing external formatting when pasting text //paste_as_text: true, // All newlines are

, Shift+enter inserts
@@ -37,6 +42,9 @@ relative_urls : false, document_base_url : "{url path="/media"}", - content_css: "{stylesheets file='assets/css/editor.less' filters='less' source='Tinymce'}{$asset_url}{/stylesheets}" + // Styles (CSS or LESS) available in the editor could be defined in assets/css/editor.less file. + {stylesheets file='assets/css/editor.less' filters='less' source='Tinymce'} + content_css: "{$asset_url}" + {/stylesheets} });