Subversion Repositories taios

Rev

Rev 229 | Rev 486 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require '../_taios.php';

$pageName = $_GET['page'];
if (empty($pageName))
{
    $pageName = 'Index';
}

$page = new Taios_Page('Edit Page - ' . $pageName, '../');
$page->drawHeader();
$page->drawMiddle();

if ($page->isUserGM($page->getLoggedInUser()))
{
    $filename = 'pages/' . $pageName . '.txt';
   
    $content = "";

    $fp = @fopen($filename, 'r');
    if ($fp)
    {
        $content = fread($fp, filesize($filename));
        fclose($fp);
    }
   
?>

<form action="edit-do.php" method="POST">
<input type="hidden" name="page" value="<?php echo $pageName; ?>" />
<table>
<tr>
<td><textarea name="content"><?php echo $content; ?></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Edit" /></td>
</tr>
</table>
</form>

<?php
}
else
{
    $page->drawError('You do not have permission to access this page.');
}

$page->drawFooter();

?>