summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2010-06-26 13:38:10 +0200
committerAndreas Gohr <andi@splitbrain.org>2010-06-26 13:42:11 +0200
commit8d22f1e96be5aa2c65ecb6ee934debbfe0f8f4cc (patch)
tree1d582c848d55a3f49b715049264550e9ee3c04d0 /inc/html.php
parenta992042bb4cc85fc90ec35a868ed14b3a3bfd7b7 (diff)
downloadrpg-8d22f1e96be5aa2c65ecb6ee934debbfe0f8f4cc.tar.gz
rpg-8d22f1e96be5aa2c65ecb6ee934debbfe0f8f4cc.tar.bz2
Changes to the ft_pageLookup and related event FS#1978
This patch changes the ft_pageLookup function to always return the title of pages with the result. This makes it easier to work with the array, as it no longer changes between numeric and key indexes depending on useheading. This also means that action plugins subscribed to SEARCH_QUERY_PAGELOOKUP need to be adjusted. The event contains a new data field called 'has_titles' which plugins can use to check for backwards compatibility.
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/inc/html.php b/inc/html.php
index 01823449e..7e842e052 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -336,18 +336,22 @@ function html_search(){
//do quick pagesearch
$data = array();
- if($id) $data = ft_pageLookup($id);
+ if($id) $data = ft_pageLookup($id,true,useHeading('navigation'));
if(count($data)){
print '<div class="search_quickresult">';
print '<h3>'.$lang['quickhits'].':</h3>';
print '<ul class="search_quickhits">';
- foreach($data as $id){
+ foreach($data as $id => $title){
print '<li> ';
- $ns = getNS($id);
- if($ns){
- $name = shorten(noNS($id), ' ('.$ns.')',30);
+ if (useHeading('navigation')) {
+ $name = $title;
}else{
- $name = $id;
+ $ns = getNS($id);
+ if($ns){
+ $name = shorten(noNS($id), ' ('.$ns.')',30);
+ }else{
+ $name = $id;
+ }
}
print html_wikilink(':'.$id,$name);
print '</li> ';