Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improv. add other langage in tinymce #328

Open
wants to merge 9 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions app/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,11 @@ public function __initConfiguration()
]);
}

// partie sociale
$facebook_link = $this->Configuration->getKey('facebook');
$skype_link = $this->Configuration->getKey('skype');
$youtube_link = $this->Configuration->getKey('youtube');
$twitter_link = $this->Configuration->getKey('twitter');

// Variables
$google_analytics = $this->Configuration->getKey('google_analytics');
$configuration_end_code = $this->Configuration->getKey('end_layout_code');
$condition = $this->Configuration->getKey('condition');
$config_lang = $this->Configuration->getKey('lang');

$this->loadModel('SocialButton');
$findSocialButtons = $this->SocialButton->find('all', ['order' => 'order']);
Expand All @@ -189,12 +184,9 @@ public function __initConfiguration()
'reCaptcha',
'captcha',
'condition',
'config_lang',
'website_name',
'theme_config',
'facebook_link',
'skype_link',
'youtube_link',
'twitter_link',
'findSocialButtons',
'google_analytics',
'configuration_end_code'
Expand Down
24 changes: 12 additions & 12 deletions app/View/Layouts/admin.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
$('body').removeClass("dark-mode");
}

$.get('<?= $this->Html->url(['action' => 'switchAdminDarkMode', 'controller' => 'admin', 'admin' => true]) ?>');
$.get('<?= $this->Html->url(['plugin' => null, 'controller' => 'admin', 'action' => 'switchAdminDarkMode', 'admin' => true]) ?>');

// Update TinyMCE
if ($("#editor").length) {
tinymce.remove("#editor");
tinyParams.skin = btn.is(":checked") ? 'oxide-dark' : "";
tinyParams.content_css = btn.is(":checked") ? "dark" : "";
tinyParams.skin = btn.is(":checked") ? 'oxide-dark' : "oxide";
tinyParams.content_css = btn.is(":checked") ? "dark" : "default";
tinymce.init(tinyParams);
}

Expand Down Expand Up @@ -227,19 +227,19 @@

<script type="text/javascript">
let tinyParams = {
selector: "textarea",
selector: "textarea#editor",
height: 300,
width: '100%',
language: 'fr_FR',
width: "100%",
<?php if((strpos($config_lang, 'en') !== 0)) {
echo "language: '".$config_lang."',\n";
} ?>
plugins: "code image link",
toolbar: "fontselect fontsizeselect bold italic underline strikethrough link image forecolor backcolor alignleft aligncenter alignright alignjustify cut copy paste bullist numlist outdent indent blockquote code"
};
<?php
if ($admin_dark_mode) { ?>
tinyParams.skin = 'oxide-dark';
tinyParams.content_css = "dark";
<?php }
?>
<?php if ($admin_dark_mode) { ?>
tinyParams.skin = 'oxide-dark';
tinyParams.content_css = "dark";
<?php } ?>
</script>

<?php echo $this->fetch('content'); ?>
Expand Down
92 changes: 0 additions & 92 deletions app/webroot/js/admin/tinymce/OLD/jquery.tinymce.min.js

This file was deleted.

Loading