<?PHP 
define("DATA_FILE", $fileXcontent);
extract($_POST);
@$textcodeX=($_POST['textcodeX']);

if (isset($_POST['save'])) {
$lastsaveX=$loadingEdit." ".$lastsave;
$textcodeX=preg_replace("/\r|\r/s", "\r", $textcodeX);
$textcodeX=str_replace('\"','"',$textcodeX);
$textcodeX=str_replace("'","'",$textcodeX);

@$savefile=$fileXcontent;
$handle=fopen($savefile, "w");
@fwrite($handle,$textcodeX);
fclose($handle);
$oldumask = umask(0);
chmod($savefile, 0644);
umask($oldumask);
}
?>

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

<?PHP 
if($wsArea == ""){
$wsArea="";
}else{
$wsArea=", ".$wsArea;
}

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

$fileZcontent=file($fileXcontent);

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

<div>
<textarea id='textcodeX' name='textcodeX' class='texteditor' wrap='virtual'>";
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> ".$saveD."</button>
</div>
</form>
";

if($showlinkZ != ""){ echo "
<div class='editor-btn2'>
<button onclick=\"window.open('$showlinkZ','testpage')\" id='preview' name='preview' class='btn form-btn1'><i class='fa fa-external-link'></i> ".$preview2."</button> &nbsp; 
</div>
";
}
?>

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