Location: PHPKode > scripts > Static Parser Engine,Parser-class > static-parser-engine/page_parsed.php
<?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']==''){
      $body=unparseCode($_POST, '', $template_file);
      savePage($_GET['path'], $_POST['fname'], $body);
   }else{
      $body=unparseCode($_POST, $_GET['path'], $_GET['fname']);
      savePage($_GET['path'], $_GET['fname'], $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">
  <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
  <script type="text/javascript">

window.onload = function()
{
        // Automatically calculates the editor base path based on the _samples directory.
        // This is usefull only for these samples. A real application should use something like this:
        // var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
<?php
if($_GET['fname']!="")
   $parsed_vars=parseCode(getPage($_GET['path'], $_GET['fname']), $_GET['path'], $_GET['fname']);
else
   $parsed_vars=parseCode(getPage($_GET['path']), $_GET['path']);

foreach($toparse as $key=>$value){
   if($parsed_vars[$key]!="" && $value[3]=='wysiwyg'){ ?>
        var oFCKeditor = new FCKeditor('<?=$key?>', '100%', '100%') ;
        oFCKeditor.BasePath = '/spe.php/fckeditor/' ;        // '/fckeditor/' is the default value.
        oFCKeditor.ReplaceTextarea();
<?php } } ?>

}

        </script>
</head>

<body>
<b>Static Parser Engine v1.0</b><br /><br />

<form name="FormName" action="" method="post">
<input name="act" type="hidden" value="save">
<table border=0 cellspacing=5 cellpadding=5 width=100%>
<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;">&nbsp;<b>WYSIWYG</b> <b>|</b> <a href="page.php?path=<?=$_GET['path']?>&fname=<?=$_GET['fname']?>">HTML</a>&nbsp;</span><br />
  <br />
<?php

foreach($toparse as $key=>$value){
   if($parsed_vars[$key]!=""){
      if($value[3]=='wysiwyg'){
         echo '<tr><td valign=top height=400 colspan=2><b>'.$value[2].'</b><br />';
         echo '<textarea name="'.$key.'" cols=90 rows=15>'.$parsed_vars[$key].'</textarea><br />';
      }else{
         echo '<tr><td nowrap><b>'.$value[2].'</b>';
         echo '<td width=100%><textarea name="'.$key.'" cols=40 rows=2 style="width:100%">'.$parsed_vars[$key].'</textarea>';
      }
   }
}

?>

</table><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>
Return current item: Static Parser Engine,Parser-class