1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-26 05:32:59 +00:00

Added directory writeable state & total size to dev help

This commit is contained in:
Starbeamrainbowlabs 2016-03-26 14:23:38 +00:00
parent fc3f751eda
commit 31ab53ead3
3 changed files with 17 additions and 3 deletions

View file

@ -3127,14 +3127,21 @@ register_module([
<h3>Registered Help Sections</h3> <h3>Registered Help Sections</h3>
<p>The following help sections are currently registered:</p> <p>The following help sections are currently registered:</p>
<table><tr><th>Index</th><th>Title</th><th>Length</th></tr>\n"; <table><tr><th>Index</th><th>Title</th><th>Length</th></tr>\n";
$totalSize = 0;
foreach($help_sections as $index => $section) foreach($help_sections as $index => $section)
{ {
$content .= "\t\t\t<tr><td>$index</td><td>" . $section["title"] . "</td><td>" . human_filesize(strlen($section["content"])) . "</td></tr>\n"; $sectionLength = strlen($section["content"]);
$totalSize += $sectionLength;
$content .= "\t\t\t<tr><td>$index</td><td>" . $section["title"] . "</td><td>" . human_filesize($sectionLength) . "</td></tr>\n";
} }
$content .= "\t\t\t<tr><th colspan='2' style='text-align: right;'>Total:</th><td>" . human_filesize($totalSize) . "</td></tr>\n";
$content .= "\t\t</table>\n"; $content .= "\t\t</table>\n";
$content .= "<h3>Registered Actions</h3> $content .= "<h3>Registered Actions</h3>
<p>The following actions are currently registered:</p>\n"; <p>The following actions are currently registered:</p>\n";
$content .= "<p>" . implode(", ", array_keys(get_object_vars($actions))) . "</p>"; $content .= "<p>" . implode(", ", array_keys(get_object_vars($actions))) . "</p>";
$content .= "<h3>Environment</h3>\n";
$content .= "<p>$settings->sitename's root directory is " . (!is_writeable(__DIR__) ? "not " : "") . "writeable.</p>";
} }
else else
{ {

View file

@ -122,7 +122,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a rather useful help page. Access through the 'help' action. This module also exposes help content added to Pepperminty Wiki's inbuilt invisible help section system.", "description": "Adds a rather useful help page. Access through the 'help' action. This module also exposes help content added to Pepperminty Wiki's inbuilt invisible help section system.",
"id": "page-help", "id": "page-help",
"lastupdate": 1458824937, "lastupdate": 1459002158,
"optional": false "optional": false
}, },
{ {

View file

@ -29,14 +29,21 @@ register_module([
<h3>Registered Help Sections</h3> <h3>Registered Help Sections</h3>
<p>The following help sections are currently registered:</p> <p>The following help sections are currently registered:</p>
<table><tr><th>Index</th><th>Title</th><th>Length</th></tr>\n"; <table><tr><th>Index</th><th>Title</th><th>Length</th></tr>\n";
$totalSize = 0;
foreach($help_sections as $index => $section) foreach($help_sections as $index => $section)
{ {
$content .= "\t\t\t<tr><td>$index</td><td>" . $section["title"] . "</td><td>" . human_filesize(strlen($section["content"])) . "</td></tr>\n"; $sectionLength = strlen($section["content"]);
$totalSize += $sectionLength;
$content .= "\t\t\t<tr><td>$index</td><td>" . $section["title"] . "</td><td>" . human_filesize($sectionLength) . "</td></tr>\n";
} }
$content .= "\t\t\t<tr><th colspan='2' style='text-align: right;'>Total:</th><td>" . human_filesize($totalSize) . "</td></tr>\n";
$content .= "\t\t</table>\n"; $content .= "\t\t</table>\n";
$content .= "<h3>Registered Actions</h3> $content .= "<h3>Registered Actions</h3>
<p>The following actions are currently registered:</p>\n"; <p>The following actions are currently registered:</p>\n";
$content .= "<p>" . implode(", ", array_keys(get_object_vars($actions))) . "</p>"; $content .= "<p>" . implode(", ", array_keys(get_object_vars($actions))) . "</p>";
$content .= "<h3>Environment</h3>\n";
$content .= "<p>$settings->sitename's root directory is " . (!is_writeable(__DIR__) ? "not " : "") . "writeable.</p>";
} }
else else
{ {