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:
parent
e45e956301
commit
388cab99d9
2 changed files with 26 additions and 8 deletions
|
@ -1401,15 +1401,24 @@ class page_renderer
|
||||||
|
|
||||||
public static function generate_all_pages_datalist()
|
public static function generate_all_pages_datalist()
|
||||||
{
|
{
|
||||||
global $pageindex;
|
global $settings, $pageindex;
|
||||||
$arrayPageIndex = get_object_vars($pageindex);
|
$arrayPageIndex = get_object_vars($pageindex);
|
||||||
ksort($arrayPageIndex);
|
ksort($arrayPageIndex);
|
||||||
$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($settings->dynamic_page_suggestion_count > 0)
|
||||||
|
{
|
||||||
|
$result .= "<option value='Loading suggestions...' />";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
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";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$result .= "\t\t</datalist>";
|
$result .= "\t\t</datalist>";
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
11
core.php
11
core.php
|
@ -1091,15 +1091,24 @@ class page_renderer
|
||||||
|
|
||||||
public static function generate_all_pages_datalist()
|
public static function generate_all_pages_datalist()
|
||||||
{
|
{
|
||||||
global $pageindex;
|
global $settings, $pageindex;
|
||||||
$arrayPageIndex = get_object_vars($pageindex);
|
$arrayPageIndex = get_object_vars($pageindex);
|
||||||
ksort($arrayPageIndex);
|
ksort($arrayPageIndex);
|
||||||
$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($settings->dynamic_page_suggestion_count > 0)
|
||||||
|
{
|
||||||
|
$result .= "<option value='Loading suggestions...' />";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
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";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$result .= "\t\t</datalist>";
|
$result .= "\t\t</datalist>";
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
Loading…
Reference in a new issue