1 <!-- $Id: editpage.php,v 1.8 2001-01-01 23:13:32 ahollosi Exp $ -->
4 // editpage relies on $pagename and $ScriptUrl
7 $pagename = rawurldecode($edit);
8 if (get_magic_quotes_gpc()) {
9 $pagename = stripslashes($pagename);
11 $banner = htmlspecialchars($pagename);
12 $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore);
15 $pagename = rawurldecode($copy);
16 if (get_magic_quotes_gpc()) {
17 $pagename = stripslashes($pagename);
19 $banner = htmlspecialchars (sprintf (gettext ("Copy of %s"), $pagename));
20 $pagehash = RetrievePage($dbi, $pagename, $ArchivePageStore);
23 ExitWiki(gettext ("No page name passed into editpage!"));
27 if (is_array($pagehash)) {
29 if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && !defined('WIKI_ADMIN')) {
31 $html .= gettext ("This page has been locked by the administrator and cannot be edited.");
33 $html .= gettext ("Sorry for the inconvenience.");
35 GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while editing %s"), $pagename), 0);
39 $textarea = implode("\n", $pagehash["content"]);
41 // $cdbi = OpenDataBase($WikiPageStore);
42 $currentpage = RetrievePage($dbi, $pagename, $WikiPageStore);
43 $pagehash["version"] = $currentpage["version"];
45 elseif ($pagehash["version"] > 1) {
46 if(IsInArchive($dbi, $pagename))
47 $pagehash["copy"] = 1;
50 $textarea = sprintf(gettext ("Describe %s here."),
51 htmlspecialchars($pagename));
53 $pagehash["version"] = 0;
54 $pagehash["lastmodified"] = time();
55 $pagehash["author"] = '';
58 GeneratePage('EDITPAGE', $textarea, $pagename, $pagehash);