diff options
author | Chris Smith <chris.eureka@jalakai.co.uk> | 2008-11-19 15:07:58 +0100 |
---|---|---|
committer | Chris Smith <chris.eureka@jalakai.co.uk> | 2008-11-19 15:07:58 +0100 |
commit | fe9ec250a6558c8352a35b6537cdc30d6c9f5477 (patch) | |
tree | 47380d5a506ce55edac27e7b228cb9e292616c7f /inc/html.php | |
parent | 078467f9a746c4f129640c45b549b194de3fe7d2 (diff) | |
download | rpg-fe9ec250a6558c8352a35b6537cdc30d6c9f5477.tar.gz rpg-fe9ec250a6558c8352a35b6537cdc30d6c9f5477.tar.bz2 |
FS#630: allow $conf['useheading'] to individually apply to content links and/or navigation links
$conf['useheading'] values are now:
- 0 : off, use page name in link text
- 'content' : use first heading text for links in wiki page content
- 'navigation' : use first heading text for links in non-page content, e.g. breadcrumps, backlinks, search results, etc.
- 1 : use first heading text in all links
(for backwards compatibility, any other values are mapped to 0 or 1 by empty() function.)
$conf['useheading'] value should now be checked using the useHeading($linktype) function,
where linktype can be "content" or "navigation"
darcs-hash:20081119140758-f07c6-6e26456d50dcecc949fada31b0d4e72877fde1cc.gz
Diffstat (limited to 'inc/html.php')
-rw-r--r-- | inc/html.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/html.php b/inc/html.php index 8390a7b09..636c93a13 100644 --- a/inc/html.php +++ b/inc/html.php @@ -23,7 +23,7 @@ function html_wikilink($id,$name=NULL,$search=''){ $xhtml_renderer = new Doku_Renderer_xhtml(); } - return $xhtml_renderer->internallink($id,$name,$search,true); + return $xhtml_renderer->internallink($id,$name,$search,true,'navigation'); } /** @@ -353,7 +353,7 @@ function html_search(){ $num = 1; foreach($data as $id => $cnt){ print '<div class="search_result">'; - print html_wikilink(':'.$id,$conf['useheading']?NULL:$id,$regex); + print html_wikilink(':'.$id,useHeading('navigation')?NULL:$id,$regex); print ': <span class="search_cnt">'.$cnt.' '.$lang['hits'].'</span><br />'; if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ? print '<div class="search_snippet">'.ft_snippet($id,$regex).'</div>'; @@ -628,7 +628,7 @@ function html_recent($first=0){ ))); $form->addElement(form_makeCloseTag('a')); - $form->addElement(html_wikilink(':'.$recent['id'],$conf['useheading']?NULL:$recent['id'])); + $form->addElement(html_wikilink(':'.$recent['id'],useHeading('navigation')?NULL:$recent['id'])); $form->addElement(form_makeOpenTag('span', array('class' => 'sum'))); $form->addElement(' – '.htmlspecialchars($recent['sum'])); @@ -839,7 +839,7 @@ function html_backlinks(){ print '<ul class="idx">'; foreach($data as $blink){ print '<li><div class="li">'; - print html_wikilink(':'.$blink,$conf['useheading']?NULL:$blink); + print html_wikilink(':'.$blink,useHeading('navigation')?NULL:$blink); print '</div></li>'; } print '</ul>'; |