mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 17:23:00 +00:00
Added deletion completion page and delete link to nav bar
This commit is contained in:
parent
bf388f7a8e
commit
19241a8128
3 changed files with 18 additions and 8 deletions
2
core.php
2
core.php
|
@ -541,7 +541,7 @@ switch($_GET["action"])
|
||||||
file_put_contents("./pageindex.json", json_encode($pageindex)); //save the new page index
|
file_put_contents("./pageindex.json", json_encode($pageindex)); //save the new page index
|
||||||
unlink("./$page.md"); //delete the page from the disk
|
unlink("./$page.md"); //delete the page from the disk
|
||||||
|
|
||||||
exit(renderpage("Deleting $pagename - $sitename", "Coming soon..."));
|
exit(renderpage("Deleting $page - $sitename", "<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
13
index.php
13
index.php
|
@ -68,6 +68,8 @@ $navlinks = [
|
||||||
[ "Edit", "index.php?action=edit&page={page}" ],
|
[ "Edit", "index.php?action=edit&page={page}" ],
|
||||||
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
||||||
" | ",
|
" | ",
|
||||||
|
[ $admindisplaychar . "Delete", "index.php?action=delete&page={page}" ],
|
||||||
|
" | ",
|
||||||
[ "All Pages", "index.php?action=list" ],
|
[ "All Pages", "index.php?action=list" ],
|
||||||
" | ",
|
" | ",
|
||||||
[ "Credits", "index.php?action=credits" ],
|
[ "Credits", "index.php?action=credits" ],
|
||||||
|
@ -95,12 +97,12 @@ $cookieprefix = preg_replace("/[^0-9a-z]/i", "", strtolower($sitename));
|
||||||
/*
|
/*
|
||||||
Actions:
|
Actions:
|
||||||
view - view a page
|
view - view a page
|
||||||
page - path to page
|
page - page name
|
||||||
printable=[yes/no] - make output printable
|
printable=[yes/no] - make output printable
|
||||||
edit - open editor for page
|
edit - open editor for page
|
||||||
page - path to page
|
page - page name
|
||||||
save - save edits to page
|
save - save edits to page
|
||||||
page - path to page
|
page - page name
|
||||||
list - list pages
|
list - list pages
|
||||||
category - the category to list [optional]
|
category - the category to list [optional]
|
||||||
login - login to the site
|
login - login to the site
|
||||||
|
@ -110,6 +112,9 @@ Actions:
|
||||||
string - string to hash
|
string - string to hash
|
||||||
help - get help
|
help - get help
|
||||||
credits - view the credits
|
credits - view the credits
|
||||||
|
delete - delete a page
|
||||||
|
page - page name
|
||||||
|
delete=yes - actually do the deletion (otherwise we display a prompt)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -651,7 +656,7 @@ switch($_GET["action"])
|
||||||
file_put_contents("./pageindex.json", json_encode($pageindex)); //save the new page index
|
file_put_contents("./pageindex.json", json_encode($pageindex)); //save the new page index
|
||||||
unlink("./$page.md"); //delete the page from the disk
|
unlink("./$page.md"); //delete the page from the disk
|
||||||
|
|
||||||
exit(renderpage("Deleting $pagename - $sitename", "Coming soon..."));
|
exit(renderpage("Deleting $page - $sitename", "<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -65,6 +65,8 @@ $navlinks = [
|
||||||
[ "Edit", "index.php?action=edit&page={page}" ],
|
[ "Edit", "index.php?action=edit&page={page}" ],
|
||||||
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
||||||
" | ",
|
" | ",
|
||||||
|
[ $admindisplaychar . "Delete", "index.php?action=delete&page={page}" ],
|
||||||
|
" | ",
|
||||||
[ "All Pages", "index.php?action=list" ],
|
[ "All Pages", "index.php?action=list" ],
|
||||||
" | ",
|
" | ",
|
||||||
[ "Credits", "index.php?action=credits" ],
|
[ "Credits", "index.php?action=credits" ],
|
||||||
|
@ -92,12 +94,12 @@ $cookieprefix = preg_replace("/[^0-9a-z]/i", "", strtolower($sitename));
|
||||||
/*
|
/*
|
||||||
Actions:
|
Actions:
|
||||||
view - view a page
|
view - view a page
|
||||||
page - path to page
|
page - page name
|
||||||
printable=[yes/no] - make output printable
|
printable=[yes/no] - make output printable
|
||||||
edit - open editor for page
|
edit - open editor for page
|
||||||
page - path to page
|
page - page name
|
||||||
save - save edits to page
|
save - save edits to page
|
||||||
page - path to page
|
page - page name
|
||||||
list - list pages
|
list - list pages
|
||||||
category - the category to list [optional]
|
category - the category to list [optional]
|
||||||
login - login to the site
|
login - login to the site
|
||||||
|
@ -107,5 +109,8 @@ Actions:
|
||||||
string - string to hash
|
string - string to hash
|
||||||
help - get help
|
help - get help
|
||||||
credits - view the credits
|
credits - view the credits
|
||||||
|
delete - delete a page
|
||||||
|
page - page name
|
||||||
|
delete=yes - actually do the deletion (otherwise we display a prompt)
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue