1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

made json pretty print in the page index when deleting a page

This commit is contained in:
Starbeamrainbowlabs 2014-12-28 10:19:18 +00:00
parent 19241a8128
commit f21d077312
2 changed files with 2 additions and 2 deletions

View file

@ -538,7 +538,7 @@ switch($_GET["action"])
<p><a href='index.php?action=view&page=$page'>Click here to go back.</a>")); <p><a href='index.php?action=view&page=$page'>Click here to go back.</a>"));
} }
unset($pageindex->$page); //delete the page from the page index unset($pageindex->$page); //delete the page from the page index
file_put_contents("./pageindex.json", json_encode($pageindex)); //save the new page index file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT)); //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 $page - $sitename", "<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>")); exit(renderpage("Deleting $page - $sitename", "<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>"));

View file

@ -653,7 +653,7 @@ switch($_GET["action"])
<p><a href='index.php?action=view&page=$page'>Click here to go back.</a>")); <p><a href='index.php?action=view&page=$page'>Click here to go back.</a>"));
} }
unset($pageindex->$page); //delete the page from the page index unset($pageindex->$page); //delete the page from the page index
file_put_contents("./pageindex.json", json_encode($pageindex)); //save the new page index file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT)); //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 $page - $sitename", "<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>")); exit(renderpage("Deleting $page - $sitename", "<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>"));