summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2009-01-17 00:35:07 +0100
committerAnika Henke <anika@selfthinker.org>2009-01-17 00:35:07 +0100
commit851f2e8900ee6ea5806f852174ea377b206be0a0 (patch)
tree6237b7e413206799b56e195ffd64cace4db85c4d /inc
parent365be586ad4afda0558fdc0cdbcc8641699b855a (diff)
downloadrpg-851f2e8900ee6ea5806f852174ea377b206be0a0.tar.gz
rpg-851f2e8900ee6ea5806f852174ea377b206be0a0.tar.bz2
makes minimum amount of headlines configurable that determines if the TOC is built (FS#1226)
darcs-hash:20090116233507-f7d6d-aaff15652d2e698a4403b3386b5b1eb6c0fa38f3.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/parser/xhtml.php3
-rw-r--r--inc/template.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index bad1a21de..545f48b4e 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -84,7 +84,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
// Prepare the TOC
- if($this->info['toc'] && is_array($this->toc) && count($this->toc) > 2){
+ global $conf;
+ if($this->info['toc'] && is_array($this->toc) && $conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']){
global $TOC;
$TOC = $this->toc;
}
diff --git a/inc/template.php b/inc/template.php
index 6faf4881d..9d29ad291 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -152,6 +152,7 @@ function tpl_toc($return=false){
global $ID;
global $REV;
global $INFO;
+ global $conf;
$toc = array();
if(is_array($TOC)){
@@ -166,7 +167,7 @@ function tpl_toc($return=false){
$tocok = true;
}
$toc = $meta['description']['tableofcontents'];
- if(!$tocok || !is_array($toc) || count($toc) < 3){
+ if(!$tocok || !is_array($toc) || !$conf['tocminheads'] || count($toc) < $conf['tocminheads']){
$toc = array();
}
}elseif($ACT == 'admin'){