wysiwyg->logmsg. "(". $_REQUEST['path']. ")"); } } else { $readfile = $_SERVER['DOCUMENT_ROOT']. $_REQUEST['path']; if (is_file($readfile)) { $body = file_get_contents($readfile); $body = str_replace("\n", "\r", $body); $body = str_replace("\r\r", "\r", $body); if (preg_match("/^(.*)(.*)(<\/body>.*)$/i", $body, $m)) { $errordialog = " $('#confirmdialog').html('\ ". $Language->wysiwyg->confirm. "
(". $Language->wysiwyg->htmlalert. ")
'); $(function() { $('#confirmdialog').dialog({ title: '". $Language->caption->confirm. "', resizable: true,width: 400,height:240,modal:true,show:'blind',hide:'blind', buttons: { ". $Language->button->edit. ": function() { $(this).dialog('close'); }, ". $Language->button->cancel. ": function() { $(this).dialog('close'); $('#wysiwygform').fadeOut('slow'); } } }); });"; $header = tag_encode($m[1]); $body = $m[2]; $footer = str_replace("\r", " ", $m[3]); $heads = split("\r", $m[1]); if (count($heads)) { foreach ($heads as $l) { if (preg_match("/href=(\"|\')(.+)(\.css)(\"|\')/i", $l, $m)) { $css = "$m[2]$m[3]"; if (!in_array($css, $styles)) { $styles[] = $css; } } if (preg_match("/src=(\"|\')(.+)(\.js)(\"|\')/i", $l, $m)) { $js = "$m[2]$m[3]"; if (!in_array($js, $scripts)) { $scripts[] = $js; } } } } } $body = str_replace("<", "<", $body); $body = str_replace(">", ">", $body); if ($_REQUEST['encode']) { $encode = $_REQUEST['encode']; } elseif (!$body) { $encode = $Init['Encode']; } else { $encode = getEncoding($body, $Init['Encode']); } $encode != "UTF-8" && $body = mb_convert_encoding($body, "UTF-8", $encode); } else { $encode = $Init['Encode']; } foreach ($mb_encode as $v) { $select = ""; $encode && $encode == $v && $select = "selected"; $encode_options .= " "; } $abs = str_replace("../", "/", $_REQUEST['dir']); $html .= "
"; $javascript = " var filedialog; var previewwin; tinymce_initialize('#editor', '100%', '', '". $Init['Css']. "'); parent.top.set_status('mainwindow', '". $Language->wysiwyg->statusbar. "'); function save(flag) { if (document.editform.path.value=='') { saveas(flag); } else { document.editform.saveflag.value=flag; var text = '\ ". $Language->wysiwyg->overrideconfirm. "'; if (!flag) { text += '
". $Language->wysiwyg->saveendmsg. "'; } document.getElementById('confirmdialog').innerHTML = text; $(function() { $('#confirmdialog').dialog({ title: '". $Language->caption->confirm. "', resizable: false,width: 400,height:170,modal:true,show:'blind',hide:'blind', buttons: { ". $Language->button->override. ": function() { $(this).dialog('close'); if (flag) { document.editform.target='blind'; } else { document.editform.target=''; } document.editform.submit(); }, ". $Language->button->cancel. ": function() { $(this).dialog('close'); } } }); }); } } function saveas(flag) { document.editform.saveflag.value=flag; path = document.editform.path.value; fileDialog = window.open('filedialog.php?cd=1&ud=../&ua=/&func=savefile&types=html&path='+path,'fileDialog', 'width=920,height=600,status=no'); filedialog.focus(); } function savefile(file) { document.editform.path.value=file; document.editform.submit(); } function openfile(file) { location.href='ctrl.php?cmd=wysiwyg&path='+file; } function windowGoResize() { var size = GetWindowSize(); var v = 80; document.getElementById('editor').style.height=size[1]-v+'px'; } windowGoResize(); window.onresize=windowGoResize; $(window).unload(function(){ window.unload=parent.top.set_status('mainwindow', ''); }); $errordialog"; } ?>