mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Continue writing help section for various modules.
This commit is contained in:
parent
505b5319f0
commit
be86dac917
3 changed files with 21 additions and 2 deletions
|
@ -1,11 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Raw page source",
|
"name" => "Raw page source",
|
||||||
"version" => "0.4",
|
"version" => "0.5",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
|
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
|
||||||
"id" => "action-raw",
|
"id" => "action-raw",
|
||||||
"code" => function() {
|
"code" => function() {
|
||||||
|
global $settings;
|
||||||
|
|
||||||
add_action("raw", function() {
|
add_action("raw", function() {
|
||||||
global $env;
|
global $env;
|
||||||
|
|
||||||
|
@ -15,6 +17,9 @@ register_module([
|
||||||
exit(file_get_contents("$env->storage_prefix$env->page.md"));
|
exit(file_get_contents("$env->storage_prefix$env->page.md"));
|
||||||
exit();
|
exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
add_help_section("800-raw-page-content", "Viewing Raw Page Content", "<p>Although you can use the edit page to view a page's source, you can also ask $settings->sitename to send you the raw page source and nothing else. This feature is intented for those who want to automate their interaction with $settings->sitename.</p>
|
||||||
|
<p>To use this feature, navigate to the page for which you want to see the source, and then alter the <code>action</code> parameter in the url's query string to be <code>raw</code>. If the <code>action</code> parameter doesn't exist, add it. Note that when used on an file's page this action will return the source of the description and not the file itself.</p>");
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Uploader",
|
"name" => "Uploader",
|
||||||
"version" => "0.2",
|
"version" => "0.3",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
"description" => "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
||||||
"id" => "feature-upload",
|
"id" => "feature-upload",
|
||||||
"code" => function() {
|
"code" => function() {
|
||||||
|
global $settings;
|
||||||
|
|
||||||
add_action("upload", function() {
|
add_action("upload", function() {
|
||||||
global $settings, $env, $pageindex, $paths;
|
global $settings, $env, $pageindex, $paths;
|
||||||
|
|
||||||
|
@ -256,6 +258,12 @@ register_module([
|
||||||
$parts["{content}"] = str_replace("</h1>", "</h1>\n$preview_html", $parts["{content}"]);
|
$parts["{content}"] = str_replace("</h1>", "</h1>\n$preview_html", $parts["{content}"]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register a section on the help page on uploading files
|
||||||
|
add_help_section("28-uploading-files", "Uploading Files", "<p>$settings->sitename supports the uploading of files, though it is up to " . $admindetails["name"] . ", $settings->sitename's administrator as to whether it is enabled or not (uploads are currently " . (($settings->upload_enabled) ? "enabled" : "disabled") . ").</p>
|
||||||
|
<p>Currently Pepperminty Wiki (the software that $settings->sitename uses) only supports the uploading of images, although more file types should be supported in the future (<a href='//github.com/sbrl/Pepperminty-Wiki/issues'>open an issue on GitHub</a> if you are interested in support for more file types).</p>
|
||||||
|
<p>Uploading a file is actually quite simple. Click the "Upload" option in the "More..." menu to go to the upload page. The upload page will tell you what types of file $settings->sitename allows, and the maximum supported filesize for files that you upload (this is usually set by the web server that the wiki is running on).</p>
|
||||||
|
<p>Use the file chooser to select the file that you want to upload, and then decide on a name for it. Note that the name that you choose should not include the file extension, as this will be determined automatically. Enter a description that will appear on the file's page, and then click upload.</p>");
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ register_module([
|
||||||
"description" => "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.",
|
"description" => "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.",
|
||||||
"id" => "page-login",
|
"id" => "page-login",
|
||||||
"code" => function() {
|
"code" => function() {
|
||||||
|
global $settings;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _ _
|
* _ _
|
||||||
* | | ___ __ _(_)_ __
|
* | | ___ __ _(_)_ __
|
||||||
|
@ -86,6 +88,10 @@ register_module([
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register a section on logging in on the help page.
|
||||||
|
add_help_section("30-login", "Logging in", "<p>In order to edit $settings->sitename and have your edit attributed to you, you need to be logged in. Depending on the settings, logging in may be a required step if you want to edit at all. Thankfully, loggging in is not hard. Simply click the "Login" link in the top left, type your username and password, and then click login.</p>
|
||||||
|
<p>If you do not have an account yet and would like one, try contacting <a href='mailto:" . hide_email($settings->admindetails["email"]) . "'>" . $settings->admindetails["name"] . "</a>, $settings->sitename's administrator and ask them nicely to see if they can create you an account.</p>");
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue