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:
parent
4f88467cbb
commit
d3e83a0aea
4 changed files with 9 additions and 8 deletions
|
@ -6,6 +6,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
|
||||||
## Changed
|
## Changed
|
||||||
- Improved the search indexing system performance - again
|
- Improved the search indexing system performance - again
|
||||||
- Another search index rebuild is required
|
- 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
|
## v0.20
|
||||||
|
|
|
@ -519,17 +519,19 @@ class page_renderer
|
||||||
*/
|
*/
|
||||||
public static function generate_all_pages_datalist() {
|
public static function generate_all_pages_datalist() {
|
||||||
global $settings, $pageindex;
|
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";
|
$result = "<datalist id='allpages'>\n";
|
||||||
|
|
||||||
// If dynamic page sugggestions are enabled, then we should send a loading message instead.
|
// If dynamic page sugggestions are enabled, then we should send a loading message instead.
|
||||||
if($settings->dynamic_page_suggestion_count > 0) {
|
if($settings->dynamic_page_suggestion_count > 0) {
|
||||||
$result .= "<option value='Loading suggestions...' />";
|
$result .= "<option value='Loading suggestions...' />";
|
||||||
} else {
|
} 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) {
|
foreach($arrayPageIndex as $pagename => $pagedetails) {
|
||||||
$escapedPageName = str_replace('"', '"', $pagename);
|
$escapedPageName = str_replace('"', '"', $pagename);
|
||||||
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
|
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
"version": "0.17.6",
|
"version": "0.17.6",
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
|
"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,
|
"optional": false,
|
||||||
"extra_data": {
|
"extra_data": {
|
||||||
"diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js"
|
"diff.min.js": "https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jsdiff\/2.2.2\/diff.min.js"
|
||||||
|
|
|
@ -52,9 +52,7 @@ register_module([
|
||||||
|
|
||||||
$pagetext = "";
|
$pagetext = "";
|
||||||
if(isset($pageindex->{$env->page}))
|
if(isset($pageindex->{$env->page}))
|
||||||
{
|
|
||||||
$pagetext = file_get_contents($filename);
|
$pagetext = file_get_contents($filename);
|
||||||
}
|
|
||||||
|
|
||||||
$isOtherUsersPage = false;
|
$isOtherUsersPage = false;
|
||||||
if(
|
if(
|
||||||
|
|
Loading…
Reference in a new issue