diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-02-03 19:53:11 +0100 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-02-03 19:53:11 +0100 |
commit | 48606867454b93c7d11708b8193fbc2a4368aaf9 (patch) | |
tree | d2528ff5f97c1aaea72e808b79ebbb1099c459a0 /lib/exe/ajax.php | |
parent | d91a4ef556635b5298c47df2856851f0694b2885 (diff) | |
download | rpg-48606867454b93c7d11708b8193fbc2a4368aaf9.tar.gz rpg-48606867454b93c7d11708b8193fbc2a4368aaf9.tar.bz2 |
use var and remove suggestions when needed
Use variable for maximum number of suggestions for quicksearch.
And hide suggestions when search field is emptied, or when no suggestion are found.
Diffstat (limited to 'lib/exe/ajax.php')
-rw-r--r-- | lib/exe/ajax.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index fdc28d4f1..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; @@ -72,7 +74,7 @@ function ajax_qsearch(){ echo '<li>' . html_wikilink(':'.$id,$name) . '</li>'; $counter ++; - if($counter > 50) { + if($counter > $maxnumbersuggestions) { echo '<li>...</li>'; break; } |