Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rbbrioso28 committed Oct 22, 2021
2 parents 6f593ae + 744353d commit 4ff0b7d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/plugins/MelisFrontGdprBannerPlugin.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'/MelisFront/plugins/css/plugin.gdprBanner.css',
],
'js' => [
'/MelisFront/plugins/js/plugin.melisGdprBanner.init.js',
'/MelisFront/plugins/js/plugin.melisGdprBanner.init.js?v=3',
],
],
],
Expand Down
2 changes: 1 addition & 1 deletion public/plugins/js/plugin.melisGdprBanner.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ window.MelisGdprBanner = (function () {
* src: https://zellwk.com/blog/looping-through-js-objects/
*/
options = Object.entries({defaultOptions,options});
var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + "; SameSite=Lax";
for (const [key, value] of options) {
updatedCookie += "; " + key + "=" + value;
}
Expand Down
18 changes: 11 additions & 7 deletions public/plugins/js/plugin.melistagHTML.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ function melistagHTML_init(idPlugin) {
if (typeof idPlugin === "undefined") idPlugin = null;

var tinyMceOption = {
templates:
"/melis/MelisCms/PageEdition/getTinyTemplates?idPage=" +
melisActivePageId,
templates: "/melis/MelisCms/PageEdition/getTinyTemplates?idPage=" + melisActivePageId
};

if (idPlugin != null) {
if ( idPlugin != null ) {
tinyMceOption.setup = "melistagHTML_savePlugin";
}

Expand All @@ -28,20 +26,26 @@ function melistagHTML_savePlugin(editor) {
$("body").on("blur", "div.html-editable", function() {
// get all data-attributes from the clicked
var currentdata = $(this).data();
// var currentdata = $(this).closest(".html-editable").data();

var pluginDivId = $(this).closest('.html-editable').attr('id');

var content = tinyMCE.get(pluginDivId).getContent({ format: "html" });

// get the content of the active tinyMCE editor.
var content = tinyMCE.activeEditor.getContent({ format: "html" });
// var content = tinyMCE.activeEditor.getContent({ format: "html" });

var data = {
melisPluginName: currentdata.plugin,
melisPluginTag: currentdata.melisTag,
melisPluginId: currentdata.tagId,
tagType: currentdata.tagType,
tagId: currentdata.tagId,
tagValue: content,
tagValue: content
};

melisPluginEdition.calcFrameHeight();
melisPluginEdition.savePluginUpdate(data, currentdata.siteModule);
});

melistagHTML_init();
melistagHTML_init();
7 changes: 6 additions & 1 deletion public/plugins/js/plugin.melistagMEDIA.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ function melistagMEDIA_savePlugin(editor) {
$("body").on("blur", "div.media-editable", function() {
// get all data-attributes from the clicked
var currentdata = $(this).data();
// var currentdata = $(this).closest(".html-editable").data();

var pluginDivId = $(this).closest('.media-editable').attr('id');

var content = tinyMCE.get(pluginDivId).getContent({ format: "html" });

// get the content of the active tinyMCE editor.
var content = tinyMCE.activeEditor.getContent({ format: "html" });
// var content = tinyMCE.activeEditor.getContent({ format: "html" });

var data = {
melisPluginName: currentdata.plugin,
Expand Down
7 changes: 6 additions & 1 deletion public/plugins/js/plugin.melistagTEXTAREA.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ function melistagTEXTAREA_savePlugin(editor) {
$("body").on("blur", "div.textarea-editable", function() {
// get all data-attributes from the clicked
var currentdata = $(this).data();
// var currentdata = $(this).closest(".html-editable").data();

var pluginDivId = $(this).closest('.textarea-editable').attr('id');

var content = tinyMCE.get(pluginDivId).getContent({ format: "html" });

// get the content of the active tinyMCE editor.
var content = tinyMCE.activeEditor.getContent({ format: "html" });
// var content = tinyMCE.activeEditor.getContent({ format: "html" });

var data = {
melisPluginName: currentdata.plugin,
Expand Down
10 changes: 6 additions & 4 deletions src/Controller/Plugin/MelisFrontTagPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ public function back()

public function loadDbXmlToPluginConfig()
{

$configValues = array();

$xml = simplexml_load_string($this->pluginXmlDbValue);

if ($xml)
{
$type = isset($this->pluginFrontConfig['type']) ? $this->pluginFrontConfig['type'] : 'html';
Expand Down Expand Up @@ -179,11 +181,11 @@ public function savePluginConfigToXml($parameters)
}

private function getWidths()
{
{
// Create an array with the variables that will be available in the view
$this->pluginFrontConfig['widthDesktop'] = isset($this->widthDesktop[0]) ? $this->widthDesktop[0] : 100;
$this->pluginFrontConfig['widthTablet'] = isset($this->widthTablet[0]) ? $this->widthTablet[0] : 100;
$this->pluginFrontConfig['widthMobile'] = isset($this->widthMobile[0]) ? $this->widthMobile[0] : 100;
$this->pluginFrontConfig['widthDesktop'] = (is_array($this->widthDesktop) && isset($this->widthDesktop[0])) ? $this->widthDesktop[0] : 100;
$this->pluginFrontConfig['widthTablet'] = (is_array($this->widthTablet) && isset($this->widthTablet[0])) ? $this->widthTablet[0] : 100;
$this->pluginFrontConfig['widthMobile'] = (is_array($this->widthMobile) && isset($this->widthMobile[0])) ? $this->widthMobile[0] : 100;
$this->pluginFrontConfig['pluginContainerId'] = isset($this->pluginContainerId[0]) ? $this->pluginContainerId[0] : null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Service/MelisSiteConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function getSiteConfig($siteId, $returnAll = false)

if (!empty($dbConfigData)) {
foreach ($dbConfigData as $dbConf) {
if ($dbConf['sconf_lang_id'] === '-1') {
if ($dbConf['sconf_lang_id'] == '-1') {
$siteConfig = ArrayUtils::merge(
$siteConfig,
[
Expand Down

0 comments on commit 4ff0b7d

Please sign in to comment.