Subversion Repositories taios

Rev

Rev 290 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
229 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$pageName = $_GET['page'];
6
if (empty($pageName))
7
{
8
    $pageName = 'Index';
9
}
10
 
11
$page = new Taios_Page('Edit Page - ' . $pageName, '../');
12
$page->drawHeader();
13
$page->drawMiddle();
14
 
290 tom 15
$page->checkLoggedIn();
16
 
229 tom 17
if ($page->isUserGM($page->getLoggedInUser()))
18
{
486 muzer 19
    $pageName = str_replace("../", "/", $pageName);
20
 
229 tom 21
    $filename = 'pages/' . $pageName . '.txt';
22
 
23
    $content = "";
24
 
25
    $fp = @fopen($filename, 'r');
26
    if ($fp)
27
    {
28
        $content = fread($fp, filesize($filename));
29
        fclose($fp);
30
    }
31
 
32
?>
33
 
34
<form action="edit-do.php" method="POST">
232 tom 35
<input type="hidden" name="page" value="<?php echo $pageName; ?>" />
229 tom 36
<table>
37
<tr>
486 muzer 38
<td><textarea name="content"><?php write($content); ?></textarea></td>
229 tom 39
</tr>
40
<tr>
41
<td><input type="submit" value="Edit" /></td>
42
</tr>
43
</table>
44
</form>
45
 
46
<?php
47
}
48
else
49
{
50
    $page->drawError('You do not have permission to access this page.');
51
}
52
 
53
$page->drawFooter();
54
 
55
?>
56