From 3c86d7c93eae19fe1921ee3da001a182f895dfa2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 4 May 2008 11:24:10 +0200 Subject: Fixed TOC for HTML export modes FS#1384 darcs-hash:20080504092410-7ad00-ec386b1e897c1afbf3fd9e9a68867c4284225f72.gz --- inc/actions.php | 8 ++++++-- inc/template.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/actions.php b/inc/actions.php index c0f85c97a..24516e5d5 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -392,7 +392,9 @@ function act_export($act){ ptln(''); ptln(''); ptln('
'); - print p_wiki_xhtml($ID,$REV,false); + $html = p_wiki_xhtml($ID,$REV,false); + tpl_toc(); + echo $html; ptln('
'); ptln(''); ptln(''); @@ -401,7 +403,9 @@ function act_export($act){ // html body only if($act == 'export_xhtmlbody'){ - print p_wiki_xhtml($ID,$REV,false); + $html = p_wiki_xhtml($ID,$REV,false); + tpl_toc(); + echo $html; exit; } diff --git a/inc/template.php b/inc/template.php index 5544dc02e..efd921f7d 100644 --- a/inc/template.php +++ b/inc/template.php @@ -152,7 +152,7 @@ function tpl_toc($return=false){ if(is_array($TOC)){ // if a TOC was prepared in global scope, always use it $toc = $TOC; - }elseif($ACT == 'show' && !$REV && $INFO['exists']){ + }elseif(($ACT == 'show' || substr($ACT,0,6) == 'export') && !$REV && $INFO['exists']){ // get TOC from metadata, render if neccessary $meta = p_get_metadata($ID, false, true); if(isset($meta['internal']['toc'])){ -- cgit v1.2.3