summaryrefslogtreecommitdiff
path: root/lib/exe/ajax.php
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-06-16 14:41:59 +0200
committerAdrian Lang <lang@cosmocode.de>2010-06-16 15:45:05 +0200
commit80423ab626c72923f347e2196ce660957dcc216f (patch)
tree2991cebd7702f6fff1a662be569755db8e160a99 /lib/exe/ajax.php
parent782807733e52295b535005074a62cee46640b0db (diff)
downloadrpg-80423ab626c72923f347e2196ce660957dcc216f.tar.gz
rpg-80423ab626c72923f347e2196ce660957dcc216f.tar.bz2
Perform quick search in title as well
Diffstat (limited to 'lib/exe/ajax.php')
-rw-r--r--lib/exe/ajax.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index a402c236f..9c10ca548 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -50,27 +50,28 @@ function ajax_qsearch(){
global $conf;
global $lang;
- $query = cleanID($_POST['q']);
- if(empty($query)) $query = cleanID($_GET['q']);
+ $query = $_POST['q'];
+ if(empty($query)) $query = $_GET['q'];
if(empty($query)) return;
- $data = array();
- $data = ft_pageLookup($query);
+ $data = ft_pageLookup($query, true, false);
if(!count($data)) return;
print '<strong>'.$lang['quickhits'].'</strong>';
print '<ul>';
- foreach($data as $id){
- print '<li>';
- $ns = getNS($id);
- if($ns){
- $name = shorten(noNS($id), ' ('.$ns.')',30);
- }else{
- $name = $id;
+ foreach($data as $id => $title){
+ if (useHeading('navigation')) {
+ $name = $title;
+ } else {
+ $ns = getNS($id);
+ if($ns){
+ $name = shorten(noNS($id), ' ('.$ns.')',30);
+ }else{
+ $name = $id;
+ }
}
- print html_wikilink(':'.$id,$name);
- print '</li>';
+ echo '<li>' . html_wikilink(':'.$id,$name) . '</li>';
}
print '</ul>';
}