mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 16:33:00 +00:00
Lots of small stability fixes.
This commit is contained in:
parent
f7af7c455a
commit
9e63f0f64b
6 changed files with 44 additions and 35 deletions
|
@ -2807,7 +2807,7 @@ register_module([
|
|||
|
||||
register_module([
|
||||
"name" => "Help page",
|
||||
"version" => "0.6",
|
||||
"version" => "0.7",
|
||||
"author" => "Starbeamrainbowlabs",
|
||||
"description" => "Adds the help action. You really want this one.",
|
||||
"id" => "page-help",
|
||||
|
@ -2838,16 +2838,15 @@ register_module([
|
|||
|
||||
$content = " <h1>$settings->sitename Help</h1>
|
||||
<p>Welcome to $settings->sitename!</p>
|
||||
<p>$settings->sitename is powered by Pepperminty wiki, a complete wiki in a box you can drop into your server.</p>";
|
||||
<p>$settings->sitename is powered by Pepperminty Wiki, a complete wiki in a box you can drop into your server.</p>";
|
||||
// todo Insert a table of contents here?
|
||||
|
||||
foreach($help_sections as $index => $section)
|
||||
{
|
||||
|
||||
var_dump($help_sections);
|
||||
// todo Insert a table of contents here?
|
||||
|
||||
foreach($help_sections as $index => $section)
|
||||
{
|
||||
// Todo add a button that you can click to get a permanent link
|
||||
// to this section.
|
||||
$content .= "<h2 id='$index'>" . $section["title"];
|
||||
$content .= "<h2 id='$index'>" . $section["title"] . "</h2>\n";
|
||||
$content .= $section["content"] . "\n";
|
||||
}
|
||||
|
||||
|
@ -2855,8 +2854,7 @@ register_module([
|
|||
});
|
||||
|
||||
// Register a help section on general navigation
|
||||
add_help_section("5-navigation", "Navigation", "<h2>Navigating</h2>
|
||||
<p>All the navigation links can be found on the top bar, along with a search box (if your site administrator has enabled it). There is also a "More..." menu in the top right that contains some additional links that you may fine useful.</p>
|
||||
add_help_section("5-navigation", "Navigating", "<p>All the navigation links can be found on the top bar, along with a search box (if your site administrator has enabled it). There is also a "More..." menu in the top right that contains some additional links that you may fine useful.</p>
|
||||
<p>This page, along with the credits page, can be found on the bar at the bottom of every page.</p>");
|
||||
|
||||
add_help_section("999-extra", "Extra Information", "<p>You can find out whch version of Pepperminty Wiki $settings->sitename is using by visiting the <a href='?action=credits'>credits</a> page.</p>
|
||||
|
@ -3399,8 +3397,7 @@ register_module([
|
|||
// Register the help section
|
||||
if($settings->parser != "default")
|
||||
return; // Don't register the help section if we aren't the currently set parser.
|
||||
add_help_section("20-parser-default", "Editor Syntax", "<h2>Editing</h2>
|
||||
<p>$settings->sitename's editor uses a modified version of slimdown, a flavour of markdown that is implementated using regular expressions. See the credits page for more information and links to the original source for this. A quick reference can be found below:</p>
|
||||
add_help_section("20-parser-default", "Editor Syntax", "<p>$settings->sitename's editor uses a modified version of slimdown, a flavour of markdown that is implementated using regular expressions. See the credits page for more information and links to the original source for this. A quick reference can be found below:</p>
|
||||
<table>
|
||||
<tr><th>Type This</th><th>To get this</th>
|
||||
<tr><td><code>_italics_</code></td><td><em>italics</em></td></tr>
|
||||
|
|
4
core.php
4
core.php
|
@ -918,7 +918,9 @@ function register_save_preprocessor($func)
|
|||
$help_sections = [];
|
||||
function add_help_section($index, $title, $content)
|
||||
{
|
||||
$help_section[$index] = [
|
||||
global $help_sections;
|
||||
|
||||
$help_sections[$index] = [
|
||||
"title" => $title,
|
||||
"content" => $content
|
||||
];
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
|
||||
"id": "feature-upload",
|
||||
"lastupdate": 1450706563,
|
||||
"lastupdate": 1450706993,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
@ -100,11 +100,11 @@
|
|||
},
|
||||
{
|
||||
"name": "Help page",
|
||||
"version": "0.6",
|
||||
"version": "0.7",
|
||||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds the help action. You really want this one.",
|
||||
"id": "page-help",
|
||||
"lastupdate": 1450687304,
|
||||
"lastupdate": 1450708446,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
@ -167,7 +167,7 @@
|
|||
"author": "Johnny Broadway & Starbeamrainbowlabs",
|
||||
"description": "The default parser for Pepperminty Wiki. Based on Johnny Broadway's Slimdown (with more than a few modifications). This parser's features are documented in the help page.",
|
||||
"id": "parser-default",
|
||||
"lastupdate": 1450687319,
|
||||
"lastupdate": 1450708466,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -260,7 +260,7 @@ register_module([
|
|||
});
|
||||
|
||||
// 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>
|
||||
add_help_section("28-uploading-files", "Uploading Files", "<p>$settings->sitename supports the uploading of files, though it is up to " . $settings->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>");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
register_module([
|
||||
"name" => "Help page",
|
||||
"version" => "0.6",
|
||||
"version" => "0.7",
|
||||
"author" => "Starbeamrainbowlabs",
|
||||
"description" => "Adds the help action. You really want this one.",
|
||||
"id" => "page-help",
|
||||
|
@ -11,37 +11,48 @@ register_module([
|
|||
add_action("help", function() {
|
||||
global $settings, $version, $help_sections;
|
||||
|
||||
if(isset($_GET["dev"]) and $_GET["dev"] == "yes")
|
||||
{
|
||||
$title = "Developers Help - $settings->sitename";
|
||||
$content = "<p>$settings->sitename runs on Pepperminty Wiki, an entire wiki packed into a single file. This page contains some information that developers may find useful.</p>
|
||||
<p>A full guide to developing a Pepperminty Wiki module can be found <a href='//github.com/sbrl/Pepperminty-Wiki/blob/master/Module_API_Docs.md#module-api-documentation'>on GitHub</a>.</p>
|
||||
<p>A full guide to Pepperminty Wiki can be found <a href=''
|
||||
<p>The following help sections are currently registered:</p>
|
||||
<table><tr><th>Index</th><th>Title</th><th>Length</th></tr>\n";
|
||||
foreach($help_sections as $index => $section)
|
||||
{
|
||||
$content .= "\t\t\t<tr><td>$index</td><td>" . $section["title"] . "</td><td>" . strlen($section["content"]) . "</td></tr>\n";
|
||||
}
|
||||
$content .= "\t\t</table>";
|
||||
}
|
||||
$title = "Help - $settings->sitename";
|
||||
|
||||
// Sort the help sections by key
|
||||
ksort($help_sections, SORT_NATURAL);
|
||||
|
||||
$content .= " <h1>$settings->sitename Help</h1>
|
||||
$content = " <h1>$settings->sitename Help</h1>
|
||||
<p>Welcome to $settings->sitename!</p>
|
||||
<p>$settings->sitename is powered by Pepperminty wiki, a complete wiki in a box you can drop into your server.</p>";
|
||||
<p>$settings->sitename is powered by Pepperminty Wiki, a complete wiki in a box you can drop into your server.</p>";
|
||||
// todo Insert a table of contents here?
|
||||
|
||||
foreach($help_sections as $index => $section)
|
||||
{
|
||||
|
||||
// todo Insert a tabel of contents here?
|
||||
|
||||
foreach($help_sections as $index => $section)
|
||||
{
|
||||
// Todo add a button that you can click to get a permanent link
|
||||
// to this section.
|
||||
$content .= "<h2 id='$index'>" . $section["title"];
|
||||
$content .= "<h2 id='$index'>" . $section["title"] . "</h2>\n";
|
||||
$content .= $section["content"] . "\n";
|
||||
}
|
||||
|
||||
$content = " <h1>$settings->sitename Help</h1>
|
||||
<h2>Administrator Actions</h2>
|
||||
<p>By default, the <code>delete</code> and <code>move</code> actions are shown on the nav bar. These can be used by administrators to delete or move pages.</p>
|
||||
<p>The other thing admininistrators can do is update the wiki (provided they know the site's secret). This page can be found here: <a href='?action=update'>Update $settings->sitename</a>.</p>
|
||||
<p>$settings->sitename is currently running on Pepperminty Wiki <code>$version</code></p>";
|
||||
exit(page_renderer::render_main($title, $content));
|
||||
});
|
||||
|
||||
// Register a help section on general navigation
|
||||
add_help_section("5-navigation", "Navigation", "<h2>Navigating</h2>
|
||||
<p>All the navigation links can be found on the top bar, along with a search box (if your site administrator has enabled it). There is also a "More..." menu in the top right that contains some additional links that you may fine useful.</p>
|
||||
add_help_section("5-navigation", "Navigating", "<p>All the navigation links can be found on the top bar, along with a search box (if your site administrator has enabled it). There is also a "More..." menu in the top right that contains some additional links that you may fine useful.</p>
|
||||
<p>This page, along with the credits page, can be found on the bar at the bottom of every page.</p>");
|
||||
|
||||
add_help_section("999-extra", "Extra Information", "<p>You can find out whch version of Pepperminty Wiki $settings->sitename is using by visiting the <a href='?action=credits'>credits</a> page.</p>
|
||||
<p>Information for developers can be found on <a href='?action=help&dev=yes'>this page</a>.</p>");
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -15,8 +15,7 @@ register_module([
|
|||
// Register the help section
|
||||
if($settings->parser != "default")
|
||||
return; // Don't register the help section if we aren't the currently set parser.
|
||||
add_help_section("20-parser-default", "Editor Syntax", "<h2>Editing</h2>
|
||||
<p>$settings->sitename's editor uses a modified version of slimdown, a flavour of markdown that is implementated using regular expressions. See the credits page for more information and links to the original source for this. A quick reference can be found below:</p>
|
||||
add_help_section("20-parser-default", "Editor Syntax", "<p>$settings->sitename's editor uses a modified version of slimdown, a flavour of markdown that is implementated using regular expressions. See the credits page for more information and links to the original source for this. A quick reference can be found below:</p>
|
||||
<table>
|
||||
<tr><th>Type This</th><th>To get this</th>
|
||||
<tr><td><code>_italics_</code></td><td><em>italics</em></td></tr>
|
||||
|
|
Loading…
Reference in a new issue