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

more comment tidyups

This commit is contained in:
Starbeamrainbowlabs 2015-07-14 17:05:20 +01:00
parent ce43496df3
commit 3126322148
4 changed files with 12 additions and 12 deletions

View file

@ -833,7 +833,7 @@ register_module([
{ {
if(!$creatingpage) if(!$creatingpage)
{ {
//the page already exists - let the user view the page source // The page already exists - let the user view the page source
exit(page_renderer::render_main("Viewing source for $page", "<p>$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.</p><textarea name='content' readonly>$pagetext</textarea>")); exit(page_renderer::render_main("Viewing source for $page", "<p>$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.</p><textarea name='content' readonly>$pagetext</textarea>"));
} }
else else
@ -911,7 +911,7 @@ register_module([
file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT)); file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
// todo update the parent page entries in the page index if they exist // Todo Update the parent page entries in the page index if they exist
if(isset($_GET["newpage"])) if(isset($_GET["newpage"]))
http_response_code(201); http_response_code(201);
@ -1283,20 +1283,20 @@ register_module([
add_action("view", function() { add_action("view", function() {
global $pageindex, $settings, $page, $parse_page_source; global $pageindex, $settings, $page, $parse_page_source;
//check to make sure that the page exists // Check to make sure that the page exists
if(!isset($pageindex->$page)) if(!isset($pageindex->$page))
{ {
// todo make this intelligent so we only redirect if the user is acutally able to create the page // todo make this intelligent so we only redirect if the user is acutally able to create the page
if($settings->editing) if($settings->editing)
{ {
//editing is enabled, redirect to the editing page // Editing is enabled, redirect to the editing page
http_response_code(307); // Temporary redirect http_response_code(307); // Temporary redirect
header("location: index.php?action=edit&newpage=yes&page=" . rawurlencode($page)); header("location: index.php?action=edit&newpage=yes&page=" . rawurlencode($page));
exit(); exit();
} }
else else
{ {
//editing is disabled, show an error message // Editing is disabled, show an error message
http_response_code(404); http_response_code(404);
exit(page_renderer::render_main("$page - 404 - $settings->sitename", "<p>$page does not exist.</p><p>Since editing is currently disabled on this wiki, you may not create this page. If you feel that this page should exist, try contacting this wiki's Administrator.</p>")); exit(page_renderer::render_main("$page - 404 - $settings->sitename", "<p>$page does not exist.</p><p>Since editing is currently disabled on this wiki, you may not create this page. If you feel that this page should exist, try contacting this wiki's Administrator.</p>"));
} }

View file

@ -29,7 +29,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.", "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
"id": "page-edit", "id": "page-edit",
"lastupdate": 1436885187 "lastupdate": 1436889893
}, },
{ {
"name": "Help page", "name": "Help page",
@ -85,7 +85,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Allows you to view pages. You should include this one.", "description": "Allows you to view pages. You should include this one.",
"id": "page-view", "id": "page-view",
"lastupdate": 1436889549 "lastupdate": 1436889857
}, },
{ {
"name": "Default Parser", "name": "Default Parser",

View file

@ -40,7 +40,7 @@ register_module([
{ {
if(!$creatingpage) if(!$creatingpage)
{ {
//the page already exists - let the user view the page source // The page already exists - let the user view the page source
exit(page_renderer::render_main("Viewing source for $page", "<p>$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.</p><textarea name='content' readonly>$pagetext</textarea>")); exit(page_renderer::render_main("Viewing source for $page", "<p>$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.</p><textarea name='content' readonly>$pagetext</textarea>"));
} }
else else
@ -118,7 +118,7 @@ register_module([
file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT)); file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT));
// todo update the parent page entries in the page index if they exist // Todo Update the parent page entries in the page index if they exist
if(isset($_GET["newpage"])) if(isset($_GET["newpage"]))
http_response_code(201); http_response_code(201);

View file

@ -9,20 +9,20 @@ register_module([
add_action("view", function() { add_action("view", function() {
global $pageindex, $settings, $page, $parse_page_source; global $pageindex, $settings, $page, $parse_page_source;
//check to make sure that the page exists // Check to make sure that the page exists
if(!isset($pageindex->$page)) if(!isset($pageindex->$page))
{ {
// todo make this intelligent so we only redirect if the user is acutally able to create the page // todo make this intelligent so we only redirect if the user is acutally able to create the page
if($settings->editing) if($settings->editing)
{ {
//editing is enabled, redirect to the editing page // Editing is enabled, redirect to the editing page
http_response_code(307); // Temporary redirect http_response_code(307); // Temporary redirect
header("location: index.php?action=edit&newpage=yes&page=" . rawurlencode($page)); header("location: index.php?action=edit&newpage=yes&page=" . rawurlencode($page));
exit(); exit();
} }
else else
{ {
//editing is disabled, show an error message // Editing is disabled, show an error message
http_response_code(404); http_response_code(404);
exit(page_renderer::render_main("$page - 404 - $settings->sitename", "<p>$page does not exist.</p><p>Since editing is currently disabled on this wiki, you may not create this page. If you feel that this page should exist, try contacting this wiki's Administrator.</p>")); exit(page_renderer::render_main("$page - 404 - $settings->sitename", "<p>$page does not exist.</p><p>Since editing is currently disabled on this wiki, you may not create this page. If you feel that this page should exist, try contacting this wiki's Administrator.</p>"));
} }