diff options
author | jan <jan@jandecaluwe.com> | 2005-04-16 23:14:22 +0200 |
---|---|---|
committer | jan <jan@jandecaluwe.com> | 2005-04-16 23:14:22 +0200 |
commit | bb0a59d46949357f85e4a8deabff585e56b906e5 (patch) | |
tree | bcf6edeffa67a964dd7feb719070228e0a3b4189 /inc/parser/xhtml.php | |
parent | ed630903385ab3b86504e21851a3ca0c4dea2414 (diff) | |
download | rpg-bb0a59d46949357f85e4a8deabff585e56b906e5.tar.gz rpg-bb0a59d46949357f85e4a8deabff585e56b906e5.tar.bz2 |
Support for useheading with new parser
darcs-hash:20050416211422-45605-fe8c790a6b317dc9c35a63d78c6367248cc01045.gz
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r-- | inc/parser/xhtml.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 23e351b84..b85aa911e 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -391,7 +391,7 @@ class Doku_Renderer_XHTML extends Doku_Renderer { function internallink($id, $name = NULL) { global $conf; - $name = $this->__getLinkTitle($name, $this->__simpleTitle($id), $isImage); + $name = $this->__getLinkTitle($name, $this->__simpleTitle($id), $isImage, $id); resolve_pageid($id,$exists); if ( !$isImage ) { @@ -857,11 +857,19 @@ class Doku_Renderer_XHTML extends Doku_Renderer { print '<!-- SECTION ['.$f.'-'.$t.'] -->'; } - function __getLinkTitle($title, $default, & $isImage) { + function __getLinkTitle($title, $default, & $isImage, $id=NULL) { + global $conf; + $isImage = FALSE; if ( is_null($title) ) { - return $this->__xmlEntities($default); + if ($conf['useheading'] && $id) { + $heading = p_get_first_heading($id); + if ($heading) { + return $this->__xmlEntities($heading); + } + } + return $this->__xmlEntities($default); } else if ( is_string($title) ) { |