Location: PHPKode > projects > phpWebEd > phpwebed/phpwebed/tools.php
<?
include "config.inc.php";
include "$phpWebEd_language.inc.php";

if (!check_user()) {
    echo "$no_auth_str\r\n";
    exit;
}

$contentfile = $phpWebEd_dir . "/contents/" . $content . ".html";

if ($logout == "yes") {
    setcookie("auth", "", time()-100000, "/");
    echo "<script language=\"JavaScript\">opener.location.reload();\n window.close();</script>";
}
if ($undo == "yes") {
    if (is_file($contentfile . ".bak")) {
        rename($contentfile, $contentfile . ".tmp");
        rename($contentfile . ".bak", $contentfile);
        rename($contentfile . ".tmp", $contentfile . ".bak");
    }
    echo "<script language=\"JavaScript\">opener.location.reload();\n window.close();</script>";
}
if ($delete == "yes") {
    copy($contentfile, $contentfile . ".bak");
    unlink($contentfile);
    echo "<script language=\"JavaScript\">opener.location.reload();\n window.close();</script>";
}
?>
<html>
<head>
<? echo "<title>$tools_str</title>";?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function confirm_action(action,content) {
   if (confirm("<?=$tools_confirm_str?>")) {
         window.location = "tools.php?" + action + "=yes&content=" + content;
   }
}
//-->
</script>
</head>
<body bgcolor="#DDDDDD">
<table width="100%" border="0" height="100%" cellpadding="5">
  <tr> 
    <td valign="top"> 
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><a href="tools.php?logout=yes"><?=$logout_str?></a></b></font></p>
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><?=$content?>:</b></font></p>
      <li><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="javascript:confirm_action('undo','<?=$content?>')"><?=$tools_undo_str?></a></font></li>
      <li><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="javascript:confirm_action('delete','<?=$content?>')"><?=$tools_delete_str?></a></font></li>
    </td>
  </tr>
  <tr> 
    <td valign="bottom" align="center"><hr>
      <font face="Verdana, Arial, Helvetica, sans-serif" size="1">
      <a href="javascript:window.close()"><?=$close_window_str?></a>
    </font></td>
  </tr>
</table>
</body>
</html>
Return current item: phpWebEd