Skip to content
Snippets Groups Projects
Commit e41c4da9 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

some TOC fixes

darcs-hash:20060219164726-7ad00-eb637e1db83e2f3b6c3629da18214b6587590b24.gz
parent 6dbf01cc
No related branches found
No related tags found
No related merge requests found
......@@ -11,8 +11,6 @@ class Doku_Handler {
var $meta = array(
'section' => FALSE,
'toc' => TRUE,
'cache' => TRUE,
);
var $rewriteBlocks = TRUE;
......@@ -115,7 +113,7 @@ class Doku_Handler {
}
function notoc($match, $state, $pos) {
$this->meta['toc'] = FALSE;
$this->_addCall('notoc',array(),$pos);
return TRUE;
}
......
......@@ -13,6 +13,7 @@ require_once DOKU_INC . 'inc/pluginutils.php';
class Doku_Renderer {
var $info = array(
'cache' => TRUE, // may the rendered result cached?
'toc' => TRUE, // render the TOC?
);
......@@ -20,6 +21,10 @@ class Doku_Renderer {
$this->info['cache'] = FALSE;
}
function notoc() {
$this->info['toc'] = FALSE;
}
//handle plugin rendering
function plugin($name,$data){
$plugin =& plugin_load('syntax',$name);
......
......@@ -89,7 +89,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
// prepend the TOC
$this->doc = $this->render_TOC().$this->doc;
if($this->info['toc']){
$this->doc = $this->render_TOC().$this->doc;
}
}
/**
......@@ -98,7 +100,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* @author Andreas Gohr <andi@splitbrain.org>
*/
function render_TOC(){
if(!count($this->toc)) return '';
if(count($this->toc) < 3) return '';
global $lang;
$out = '<div class="toc">'.DOKU_LF;
$out .= '<div class="tocheader toctoggle" id="toc__header">';
......@@ -175,7 +177,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$hid = $this->_headerToLink($text,'true');
//handle TOC
//FIXME if($this->meta['toc'] &&
if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
// the TOC is one of our standard ul list arrays ;-)
$this->toc[] = array( 'hid' => $hid,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment