From 9702343735ce512db3e2156ed2082b22e0ed920b Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Sat, 18 Feb 2017 20:55:25 +0000
Subject: [PATCH] Added help section for user pages.

---
 build/index.php       | 4 +++-
 module_index.json     | 2 +-
 modules/page-edit.php | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/build/index.php b/build/index.php
index e8a561d..50a4e5a 100644
--- a/build/index.php
+++ b/build/index.php
@@ -4301,7 +4301,7 @@ register_module([
 	"id" => "page-edit",
 	
 	"code" => function() {
-		global $settings;
+		global $settings, $env;
 		
 		/**
 		 * @api {get} ?action=edit&page={pageName}[&newpage=yes]	Get an editing page
@@ -4660,6 +4660,8 @@ DIFFSCRIPT;
 		add_help_section("15-editing", "Editing", "<p>To edit a page on $settings->sitename, click the edit button on the top bar. Note that you will probably need to be logged in. If you do not already have an account you will need to ask $settings->sitename's administrator for an account since there is no registration form. Note that the $settings->sitename's administrator may have changed these settings to allow anonymous edits.</p>
 		<p>Editing is simple. The edit page has a sizeable box that contains a page's current contents. Once you are done altering it, add or change the comma separated list of tags in the field below the editor and then click save page.</p>
 		<p>A reference to the syntax that $settings->sitename supports can be found below.</p>");
+		
+		add_help_section("17-user-pages", "User Pages", "<p>If you are logged in, $settings->sitename allocates you your own user page that only you can edit. On $settings->sitename, user pages are sub-pages of the <a href='?page=" . rawurlencode($settings->user_page_prefix) . "'>" . htmlentities($settings->user_page_prefix) . "</a> page, and each user page can have a nested structure of pages underneath it, just like a normal page. Your user page is located at <a href='?page=" . rawurlencode(get_user_pagename($env->user)) . "'>" . htmlentities(get_user_pagename($env->user)) . "</a>.</p>");
 	}
 ]);
 
diff --git a/module_index.json b/module_index.json
index 57f01cd..e256060 100755
--- a/module_index.json
+++ b/module_index.json
@@ -140,7 +140,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": 1486826377,
+        "lastupdate": 1487451276,
         "optional": false
     },
     {
diff --git a/modules/page-edit.php b/modules/page-edit.php
index e71888b..142fb3c 100755
--- a/modules/page-edit.php
+++ b/modules/page-edit.php
@@ -7,7 +7,7 @@ register_module([
 	"id" => "page-edit",
 	
 	"code" => function() {
-		global $settings;
+		global $settings, $env;
 		
 		/**
 		 * @api {get} ?action=edit&page={pageName}[&newpage=yes]	Get an editing page
@@ -366,6 +366,8 @@ DIFFSCRIPT;
 		add_help_section("15-editing", "Editing", "<p>To edit a page on $settings->sitename, click the edit button on the top bar. Note that you will probably need to be logged in. If you do not already have an account you will need to ask $settings->sitename's administrator for an account since there is no registration form. Note that the $settings->sitename's administrator may have changed these settings to allow anonymous edits.</p>
 		<p>Editing is simple. The edit page has a sizeable box that contains a page's current contents. Once you are done altering it, add or change the comma separated list of tags in the field below the editor and then click save page.</p>
 		<p>A reference to the syntax that $settings->sitename supports can be found below.</p>");
+		
+		add_help_section("17-user-pages", "User Pages", "<p>If you are logged in, $settings->sitename allocates you your own user page that only you can edit. On $settings->sitename, user pages are sub-pages of the <a href='?page=" . rawurlencode($settings->user_page_prefix) . "'>" . htmlentities($settings->user_page_prefix) . "</a> page, and each user page can have a nested structure of pages underneath it, just like a normal page. Your user page is located at <a href='?page=" . rawurlencode(get_user_pagename($env->user)) . "'>" . htmlentities(get_user_pagename($env->user)) . "</a>.</p>");
 	}
 ]);
 
