<?php
/* Smarty version 4.3.2, created on 2024-04-08 17:33:58
  from '/var/www/html/public/legacy/include/SuiteEditor/tpls/SuiteEditorMozaik.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.3.2',
  'unifunc' => 'content_66142a86677f15_49326279',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '8291f5a21a8b049dac718ece9cd4af75ed8bcbe8' => 
    array (
      0 => '/var/www/html/public/legacy/include/SuiteEditor/tpls/SuiteEditorMozaik.tpl',
      1 => 1709743133,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_66142a86677f15_49326279 (Smarty_Internal_Template $_smarty_tpl) {
?>
<!-- [Mozaik Editor implementation] -->

<?php echo '<script'; ?>
>
    /**
     * Mozaik value getter function
     *
     * @returns string - Mozaik value
     */
    SuiteEditor.getValue = function() {
        return $('#<?php echo $_smarty_tpl->tpl_vars['elementId']->value;?>
').getMozaikValue();
    };

    /**
     * Mozaik value setter function
     *
     * @param htmlCode
     */
    SuiteEditor.apply = function(htmlCode) {
        $('#<?php echo $_smarty_tpl->tpl_vars['elementId']->value;?>
').html(htmlCode ? htmlCode : '');
        $('#<?php echo $_smarty_tpl->tpl_vars['elementId']->value;?>
').mozaik(window.mozaikSettings.<?php echo $_smarty_tpl->tpl_vars['elementId']->value;?>
);
    };

    /**
     * Mozaik value insert function
     *
     * @param text
     * @param elemId
     */
    SuiteEditor.insert = function(text, elemId) {
        if(typeof elemId === 'undefined') {
            elemId = '<?php echo $_smarty_tpl->tpl_vars['elementId']->value;?>
';
        }
        if(elemId != '<?php echo $_smarty_tpl->tpl_vars['elementId']->value;?>
') {
            throw 'incorrect editor element id (Mozaik id: '+elemId+')';
        }
        if($('#'+elemId+' .mozaik-list .mozaik-elem').length > 0) {
            // similar as the original insert_variable_html(text);
            tinyMCE.activeEditor.execCommand('mceInsertRawHTML', false, text);
        }
    };

<?php echo '</script'; ?>
>

<?php echo $_smarty_tpl->tpl_vars['mozaik']->value;
}
}
