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

Send short datalist if dynamic page listing is turned on - fixes #122

This commit is contained in:
Starbeamrainbowlabs 2016-11-22 07:31:58 +00:00
parent e45e956301
commit 388cab99d9
2 changed files with 26 additions and 8 deletions

View file

@ -1401,14 +1401,23 @@ class page_renderer
public static function generate_all_pages_datalist()
{
global $pageindex;
global $settings, $pageindex;
$arrayPageIndex = get_object_vars($pageindex);
ksort($arrayPageIndex);
$result = "<datalist id='allpages'>\n";
foreach($arrayPageIndex as $pagename => $pagedetails)
// If dynamic page sugggestions are enabled, then we should send a loading message instead.
if($settings->dynamic_page_suggestion_count > 0)
{
$escapedPageName = str_replace('"', '&quot;', $pagename);
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
$result .= "<option value='Loading suggestions...' />";
}
else
{
foreach($arrayPageIndex as $pagename => $pagedetails)
{
$escapedPageName = str_replace('"', '&quot;', $pagename);
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
}
}
$result .= "\t\t</datalist>";

View file

@ -1091,14 +1091,23 @@ class page_renderer
public static function generate_all_pages_datalist()
{
global $pageindex;
global $settings, $pageindex;
$arrayPageIndex = get_object_vars($pageindex);
ksort($arrayPageIndex);
$result = "<datalist id='allpages'>\n";
foreach($arrayPageIndex as $pagename => $pagedetails)
// If dynamic page sugggestions are enabled, then we should send a loading message instead.
if($settings->dynamic_page_suggestion_count > 0)
{
$escapedPageName = str_replace('"', '&quot;', $pagename);
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
$result .= "<option value='Loading suggestions...' />";
}
else
{
foreach($arrayPageIndex as $pagename => $pagedetails)
{
$escapedPageName = str_replace('"', '&quot;', $pagename);
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
}
}
$result .= "\t\t</datalist>";