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

page_renderer: Don't generate the page list for the datalist if it's not displayed

This commit is contained in:
Starbeamrainbowlabs 2019-12-08 20:27:20 +00:00
parent 4f88467cbb
commit d3e83a0aea
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 9 additions and 8 deletions

View file

@ -6,6 +6,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
## Changed
- Improved the search indexing system performance - again
- Another search index rebuild is required
- Don't generate the list of pages for the datalist if it isn't going to be displayed - especially noticeable on wikis with lots of pages
-
## v0.20

View file

@ -519,17 +519,19 @@ class page_renderer
*/
public static function generate_all_pages_datalist() {
global $settings, $pageindex;
$arrayPageIndex = get_object_vars($pageindex);
$sorter = new Collator("");
uksort($arrayPageIndex, function($a, $b) use($sorter) : int {
return $sorter->compare($a, $b);
});
$result = "<datalist id='allpages'>\n";
// If dynamic page sugggestions are enabled, then we should send a loading message instead.
if($settings->dynamic_page_suggestion_count > 0) {
$result .= "<option value='Loading suggestions...' />";
} else {
$arrayPageIndex = get_object_vars($pageindex);
$sorter = new Collator("");
uksort($arrayPageIndex, function($a, $b) use($sorter) : int {
return $sorter->compare($a, $b);
});
foreach($arrayPageIndex as $pagename => $pagedetails) {
$escapedPageName = str_replace('"', '&quot;', $pagename);
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";

View file

@ -225,7 +225,7 @@
"version": "0.17.6",
"author": "Starbeamrainbowlabs",
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
"lastupdate": 1573400642,
"lastupdate": 1575835535,
"optional": false,
"extra_data": {
"diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js"

View file

@ -52,9 +52,7 @@ register_module([
$pagetext = "";
if(isset($pageindex->{$env->page}))
{
$pagetext = file_get_contents($filename);
}
$isOtherUsersPage = false;
if(