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,14 +1401,23 @@ 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";
|
||||||
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('"', '"', $pagename);
|
$result .= "<option value='Loading suggestions...' />";
|
||||||
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($arrayPageIndex as $pagename => $pagedetails)
|
||||||
|
{
|
||||||
|
$escapedPageName = str_replace('"', '"', $pagename);
|
||||||
|
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$result .= "\t\t</datalist>";
|
$result .= "\t\t</datalist>";
|
||||||
|
|
||||||
|
|
17
core.php
17
core.php
|
@ -1091,14 +1091,23 @@ 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";
|
||||||
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('"', '"', $pagename);
|
$result .= "<option value='Loading suggestions...' />";
|
||||||
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($arrayPageIndex as $pagename => $pagedetails)
|
||||||
|
{
|
||||||
|
$escapedPageName = str_replace('"', '"', $pagename);
|
||||||
|
$result .= "\t\t\t<option value=\"$escapedPageName\" />\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$result .= "\t\t</datalist>";
|
$result .= "\t\t</datalist>";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue