diff options
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r-- | inc/parser/xhtml.php | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index dc28423f9..ad981df35 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -52,9 +52,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function document_end() { - // add button for last section if any and more than one - if($this->lastsec > 1) $this->_secedit($this->lastsec,''); - if ( count ($this->footnotes) > 0 ) { $this->doc .= '<div class="footnotes">'.DOKU_LF; @@ -126,13 +123,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function header($text, $level, $pos) { global $conf; - //handle section editing - if($level <= $conf['maxseclevel']){ - // add button for last section if any - if($this->lastsec) $this->_secedit($this->lastsec,$pos-1); - // remember current position - $this->lastsec = $pos; - } // create a unique header id $hid = $this->_headerToLink($text,'true'); @@ -152,6 +142,22 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $this->doc .= "</a></h$level>".DOKU_LF; } + /** + * Section edit marker is replaced by an edit button when + * the page is editable. Replacement done in 'inc/html.php#html_secedit' + * + * @author Andreas Gohr <andi@splitbrain.org> + * @author Ben Coburn <btcoburn@silicodon.net> + */ + function section_edit($start, $end, $level, $name) { + global $conf; + + if ($start!=-1 && $level<=$conf['maxseclevel']) { + $name = str_replace('"', '', $name); + $this->doc .= '<!-- SECTION "'.$name.'" ['.$start.'-'.(($end===0)?'':$end).'] -->'; + } + } + function section_open($level) { $this->doc .= "<div class=\"level$level\">".DOKU_LF; } @@ -1040,18 +1046,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } /** - * Adds code for section editing button - * - * This is just aplaceholder and gets replace by the button if - * section editing is allowed - * - * @author Andreas Gohr <andi@splitbrain.org> - */ - function _secedit($f, $t){ - $this->doc .= '<!-- SECTION ['.$f.'-'.$t.'] -->'; - } - - /** * Construct a title and handle images in titles * * @author Harry Fuecks <hfuecks@gmail.com> |