diff --git a/index.php b/index.php index e5ea2e9..edd991f 100644 --- a/index.php +++ b/index.php @@ -833,7 +833,7 @@ register_module([ { 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", "

$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.

")); } else @@ -911,7 +911,7 @@ register_module([ 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"])) http_response_code(201); @@ -1283,20 +1283,20 @@ register_module([ add_action("view", function() { 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)) { // todo make this intelligent so we only redirect if the user is acutally able to create the page 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 header("location: index.php?action=edit&newpage=yes&page=" . rawurlencode($page)); exit(); } else { - //editing is disabled, show an error message + // Editing is disabled, show an error message http_response_code(404); exit(page_renderer::render_main("$page - 404 - $settings->sitename", "

$page does not exist.

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.

")); } diff --git a/module_index.json b/module_index.json index b9aecbd..61c2c51 100644 --- a/module_index.json +++ b/module_index.json @@ -29,7 +29,7 @@ "author": "Starbeamrainbowlabs", "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.", "id": "page-edit", - "lastupdate": 1436885187 + "lastupdate": 1436889893 }, { "name": "Help page", @@ -85,7 +85,7 @@ "author": "Starbeamrainbowlabs", "description": "Allows you to view pages. You should include this one.", "id": "page-view", - "lastupdate": 1436889549 + "lastupdate": 1436889857 }, { "name": "Default Parser", diff --git a/modules/page-edit.php b/modules/page-edit.php index e685e45..f33fb17 100644 --- a/modules/page-edit.php +++ b/modules/page-edit.php @@ -40,7 +40,7 @@ register_module([ { 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", "

$settings->sitename does not allow anonymous users to make edits. You can view the source of $page below, but you can't edit it.

")); } else @@ -118,7 +118,7 @@ register_module([ 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"])) http_response_code(201); diff --git a/modules/page-view.php b/modules/page-view.php index 7d11d26..b4fc649 100644 --- a/modules/page-view.php +++ b/modules/page-view.php @@ -9,20 +9,20 @@ register_module([ add_action("view", function() { 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)) { // todo make this intelligent so we only redirect if the user is acutally able to create the page 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 header("location: index.php?action=edit&newpage=yes&page=" . rawurlencode($page)); exit(); } else { - //editing is disabled, show an error message + // Editing is disabled, show an error message http_response_code(404); exit(page_renderer::render_main("$page - 404 - $settings->sitename", "

$page does not exist.

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.

")); }