summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorChris Smith <chris.eureka@jalakai.co.uk>2008-11-19 15:07:58 +0100
committerChris Smith <chris.eureka@jalakai.co.uk>2008-11-19 15:07:58 +0100
commitfe9ec250a6558c8352a35b6537cdc30d6c9f5477 (patch)
tree47380d5a506ce55edac27e7b228cb9e292616c7f /inc/template.php
parent078467f9a746c4f129640c45b549b194de3fe7d2 (diff)
downloadrpg-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/template.php')
-rw-r--r--inc/template.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/template.php b/inc/template.php
index f5f2e7760..690f4ff41 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -860,7 +860,7 @@ function tpl_youarehere($sep=' &raquo; '){
echo '<span class="bchead">'.$lang['youarehere'].': </span>';
// always print the startpage
- $title = p_get_first_heading($conf['start']);
+ $title = useHeading('navigation') ? p_get_first_heading($conf['start']) : $conf['start'];
if(!$title) $title = $conf['start'];
tpl_link(wl($conf['start']),hsc($title),'title="'.$conf['start'].'"');
@@ -875,7 +875,7 @@ function tpl_youarehere($sep=' &raquo; '){
// output
echo $sep;
if($exists){
- $title = p_get_first_heading($page);
+ $title = useHeading($page) ? p_get_first_heading($page) : $page;
if(!$title) $title = $parts[$i];
tpl_link(wl($page),hsc($title),'title="'.$page.'"');
}else{
@@ -889,7 +889,7 @@ function tpl_youarehere($sep=' &raquo; '){
if($page == $conf['start']) return;
echo $sep;
if(page_exists($page)){
- $title = p_get_first_heading($page);
+ $title = useHeading($page) ? p_get_first_heading($page) : $page;
if(!$title) $title = $parts[$i];
tpl_link(wl($page),hsc($title),'title="'.$page.'"');
}else{
@@ -989,7 +989,7 @@ function tpl_pagetitle($id=null, $ret=false){
}
$name = $id;
- if ($conf['useheading']) {
+ if (useHeading('navigation')) {
$title = p_get_first_heading($id);
if ($title) $name = $title;
}