<script src='./../ckeditor/ckeditor.js'></script>
<script>
CKEDITOR.config.language = '<?PHP echo $tlanguage;?>';
//CKEDITOR.dtd.$removeEmpty['span'] = false;
//CKEDITOR.dtd.$removeEmpty['&nbsp;'] = true;

CKEDITOR.config.fillEmptyBlocks = false; 
CKEDITOR.config.ignoreEmptyParagraph = false;
CKEDITOR.config.basicEntities = false;
CKEDITOR.config.extraAllowedContent = '*(*);*{*}';

CKEDITOR.config.width = '100%';
CKEDITOR.config.height = 300;
CKEDITOR.config.filebrowserWindowWidth = '275';
CKEDITOR.config.filebrowserWindowHeight = '200'
CKEDITOR.config.baseHref = '<?PHP echo @$documentbaseurl;?>';
</script>

<?PHP
if (isset($_POST['editorLMs'])) {
$lastsaveX=$loadingEdit." ".$lastsave;

define("DATA_FILE", "./../".$SYSD."/mails/".$sitecontent.".inc.php");
extract($_POST);
$file=($_POST['editorLMs']);
$file=preg_replace("/\r|\r/s", "\r", $file);
$file=str_replace("<p></p>
","", $file);
$file=str_replace('\"','"',$file);
$file=str_replace('\\"','"',$file);
$fileX=strlen($file);
//echo $fileX;
if($fileX == 9){$file=str_replace('<p></p>','',$file);}

$saveEditortext="./../".$SYSD."/mails/".$sitecontent.".inc.php";
$handle=fopen($saveEditortext, "w");
fwrite($handle,$file);
fclose($handle);
$oldumask = umask(0);
chmod($saveEditortext, 0644);
umask($oldumask);
}
?>

<div class="animated fadeInLoad">
<div class="col-md-12">
<div class="box boxStyle2 infoBox">

<div class="padd10">

<?PHP 
echo "
<div>
<span class='ftL'>".$areaX.": <b>".$wsArea."</b></span>
<span class='ftR resT font13 fwb'>".$lastsaveX."</span>
</div>
<div class='clearX infoboxline'></div>
";

echo "
<form action='$editaction' method='post'>
";

$fileZcontent=file($fileXcontent);
echo "
<div>
<textarea id='editorLMs' name='editorLMs'>";
foreach($fileZcontent as $textZcontent){
echo $textZcontent;
}
echo "</textarea>
</div>

<div class='editor-btn1'>
<button type='submit' id='save' name='save' class='btn form-btn1'><i class='fa fa-arrow-circle-right'></i> ".$save1."</button>
</div>
</form>
";
?>

</div><!-- ./Box -->
</div><!-- ./Box -->
</div><!-- col-12 -->
</div><!-- End animated -->
<div class="clearX"></div>

<script>
CKEDITOR.replace( 'editorLMs',{
customConfig: './../ckeditor/configS.js',
contentsCss: 'body {font-family:inherit;font-size:inherit;padding:0 10px;color:#000;background:#fff;}',
coreStyles_bold: { element: 'b' },
coreStyles_italic: { element: 'i' },
coreStyles_underline: { element: 'u' },
coreStyles_strike: { element: 'strike' },
});
</script>
