Rev 232 | Rev 496 | 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 | { |
||
19 | $filename = 'pages/' . $pageName . '.txt'; |
||
20 | |||
21 | $content = ""; |
||
22 | |||
23 | $fp = @fopen($filename, 'r'); |
||
24 | if ($fp) |
||
25 | { |
||
26 | $content = fread($fp, filesize($filename)); |
||
27 | fclose($fp); |
||
28 | } |
||
29 | |||
30 | ?> |
||
31 | |||
32 | <form action="edit-do.php" method="POST"> |
||
232 | tom | 33 | <input type="hidden" name="page" value="<?php echo $pageName; ?>" /> |
229 | tom | 34 | <table> |
35 | <tr> |
||
36 | <td><textarea name="content"><?php echo $content; ?></textarea></td> |
||
37 | </tr> |
||
38 | <tr> |
||
39 | <td><input type="submit" value="Edit" /></td> |
||
40 | </tr> |
||
41 | </table> |
||
42 | </form> |
||
43 | |||
44 | <?php |
||
45 | } |
||
46 | else |
||
47 | { |
||
48 | $page->drawError('You do not have permission to access this page.'); |
||
49 | } |
||
50 | |||
51 | $page->drawFooter(); |
||
52 | |||
53 | ?> |
||
54 |