<?php
// ---------------------------------
// Static Parser Engine v1.0
// (c) 2007 by Sergey V. Bogomolov
// web: http://bogomolov.in.ua
// ---------------------------------
include "core.php";
if($_POST['act']=='save'){
if($_GET['fname']==''){
savePage($_GET['path'], $_POST['fname'], $_POST['body']);
}else{
savePage($_GET['path'], $_GET['fname'], $_POST['body']);
}
header('Location: index.php?path='.$_GET['path']);
//exit;
}
header("Cache-Control: no-cache, must-revalidate"); ?>
<html>
<head>
<title>Static Parser Engine v1.0</title>
<meta http-equiv="content-type" content="text/html; charset=<?=$codepage?>"/>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<b>Static Parser Engine v1.0</b><br /><br />
<?php
$body=getPage($_GET['path'], $_GET['fname']);
$parsed_vars=parseCode($body, $_GET['path'], $_GET['fname']);
?>
<form name="FormName" action="" method="post">
<input name="act" type="hidden" value="save">
<table border=0 cellspacing=5 cellpadding=5>
<tr valign=top>
<td colspan=2><a target=_blank href="/<?=$parsed_vars['url']?>">http://<?=$_SERVER['HTTP_HOST']?>/<?=$parsed_vars['url']?></a><?php if($_GET['fname']==''){ ?><input name="fname" type="text" value=".<?=$exts[0]?>" style="font-size:10px;color:blue;font-family:verdana;border-style:solid;border-width:1; border-color:red;"><?php } ?><br /><br />
<span style="background-color: #eeeeee; height:15px; valign: middle;"> <a href="page_parsed.php?path=<?=$_GET['path']?>&fname=<?=$_GET['fname']?>">WYSIWYG</a> <b>|</b> <b>HTML</b> </span><br />
<br />
<tr>
<td colspan=2>
<textarea name="body" rows=22 cols=80 style="width:100%"><?=$body?></textarea><br /> <br />
<input type="submit" value="Save page">
<input type="button" value="Cancel" onClick="document.location.href='<?php echo 'index.php?path='.$_GET['path']?>'">
</form>
</body>
</html>