summaryrefslogtreecommitdiff
path: root/lib/exe/ajax.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-02-03 11:16:09 -0800
committerAndreas Gohr <andi@splitbrain.org>2013-02-03 11:16:09 -0800
commit3bcae82d222952f2653babf77001a17532f94656 (patch)
tree03b90a81666e556fe125a49b1ba77ef2581283b4 /lib/exe/ajax.php
parent907f24f7352841e6c3030e143ec75661c55244d8 (diff)
parent48606867454b93c7d11708b8193fbc2a4368aaf9 (diff)
downloadrpg-3bcae82d222952f2653babf77001a17532f94656.tar.gz
rpg-3bcae82d222952f2653babf77001a17532f94656.tar.bz2
Merge pull request #170 from splitbrain/dont_hide_searchsuggestions
Don't hide search suggestion during typing & limit suggestions.
Diffstat (limited to 'lib/exe/ajax.php')
-rw-r--r--lib/exe/ajax.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 9989269cf..9769503a7 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -45,6 +45,8 @@ function ajax_qsearch(){
global $lang;
global $INPUT;
+ $maxnumbersuggestions = 50;
+
$query = $INPUT->post->str('q');
if(empty($query)) $query = $INPUT->get->str('q');
if(empty($query)) return;
@@ -57,6 +59,7 @@ function ajax_qsearch(){
print '<strong>'.$lang['quickhits'].'</strong>';
print '<ul>';
+ $counter = 0;
foreach($data as $id => $title){
if (useHeading('navigation')) {
$name = $title;
@@ -69,6 +72,12 @@ function ajax_qsearch(){
}
}
echo '<li>' . html_wikilink(':'.$id,$name) . '</li>';
+
+ $counter ++;
+ if($counter > $maxnumbersuggestions) {
+ echo '<li>...</li>';
+ break;
+ }
}
print '</ul>';
}