1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Sort entries in all pages alphabetically. Fixes #15

This commit is contained in:
Starbeamrainbowlabs 2015-07-15 17:11:32 +01:00
parent 3126322148
commit f6e3b9803d
3 changed files with 12 additions and 6 deletions

View file

@ -998,13 +998,16 @@ Size the image to at most 120px wide and have it float at the right ahnd size of
register_module([ register_module([
"name" => "Page list", "name" => "Page list",
"version" => "0.5", "version" => "0.6",
"author" => "Starbeamrainbowlabs", "author" => "Starbeamrainbowlabs",
"description" => "Adds a page that lists all the pages in the index along with their metadata.", "description" => "Adds a page that lists all the pages in the index along with their metadata.",
"id" => "page-list", "id" => "page-list",
"code" => function() { "code" => function() {
add_action("list", function() { add_action("list", function() {
global $pageindex, $settings; global $pageindex, $settings;
$sorted_pageindex = get_object_vars($pageindex);
ksort($sorted_pageindex, SORT_NATURAL);
$title = "All Pages"; $title = "All Pages";
$content = " <h1>$title on $settings->sitename</h1> $content = " <h1>$title on $settings->sitename</h1>
<table> <table>
@ -1015,7 +1018,7 @@ register_module([
<th>Last Edit Time</th> <th>Last Edit Time</th>
</tr>\n"; </tr>\n";
// todo list the pages in alphabetical order // todo list the pages in alphabetical order
foreach($pageindex as $pagename => $pagedetails) foreach($sorted_pageindex as $pagename => $pagedetails)
{ {
$content .= "\t\t<tr> $content .= "\t\t<tr>
<td><a href='index.php?page=$pagename'>$pagename</a></td> <td><a href='index.php?page=$pagename'>$pagename</a></td>

View file

@ -41,11 +41,11 @@
}, },
{ {
"name": "Page list", "name": "Page list",
"version": "0.5", "version": "0.6",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a page that lists all the pages in the index along with their metadata.", "description": "Adds a page that lists all the pages in the index along with their metadata.",
"id": "page-list", "id": "page-list",
"lastupdate": 1436796812 "lastupdate": 1436976553
}, },
{ {
"name": "Login", "name": "Login",

View file

@ -1,13 +1,16 @@
<?php <?php
register_module([ register_module([
"name" => "Page list", "name" => "Page list",
"version" => "0.5", "version" => "0.6",
"author" => "Starbeamrainbowlabs", "author" => "Starbeamrainbowlabs",
"description" => "Adds a page that lists all the pages in the index along with their metadata.", "description" => "Adds a page that lists all the pages in the index along with their metadata.",
"id" => "page-list", "id" => "page-list",
"code" => function() { "code" => function() {
add_action("list", function() { add_action("list", function() {
global $pageindex, $settings; global $pageindex, $settings;
$sorted_pageindex = get_object_vars($pageindex);
ksort($sorted_pageindex, SORT_NATURAL);
$title = "All Pages"; $title = "All Pages";
$content = " <h1>$title on $settings->sitename</h1> $content = " <h1>$title on $settings->sitename</h1>
<table> <table>
@ -18,7 +21,7 @@ register_module([
<th>Last Edit Time</th> <th>Last Edit Time</th>
</tr>\n"; </tr>\n";
// todo list the pages in alphabetical order // todo list the pages in alphabetical order
foreach($pageindex as $pagename => $pagedetails) foreach($sorted_pageindex as $pagename => $pagedetails)
{ {
$content .= "\t\t<tr> $content .= "\t\t<tr>
<td><a href='index.php?page=$pagename'>$pagename</a></td> <td><a href='index.php?page=$pagename'>$pagename</a></td>