diff options
Diffstat (limited to 'inc/parser/xhtmlsummary.php')
-rw-r--r-- | inc/parser/xhtmlsummary.php | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/inc/parser/xhtmlsummary.php b/inc/parser/xhtmlsummary.php index 867b71f6a..4641bf836 100644 --- a/inc/parser/xhtmlsummary.php +++ b/inc/parser/xhtmlsummary.php @@ -1,6 +1,4 @@ <?php -if(!defined('DOKU_INC')) die('meh.'); - /** * The summary XHTML form selects either up to the first two paragraphs * it find in a page or the first section (whichever comes first) @@ -20,32 +18,25 @@ class Doku_Renderer_xhtmlsummary extends Doku_Renderer_xhtml { // Namespace these variables to // avoid clashes with parent classes - var $sum_paragraphs = 0; - var $sum_capture = true; - var $sum_inSection = false; - var $sum_summary = ''; - var $sum_pageTitle = false; + protected $sum_paragraphs = 0; + protected $sum_capture = true; + protected $sum_inSection = false; + protected $sum_summary = ''; + protected $sum_pageTitle = false; - function document_start() { + /** @inheritdoc */ + public function document_start() { $this->doc .= DOKU_LF.'<div>'.DOKU_LF; } - function document_end() { + /** @inheritdoc */ + public function document_end() { $this->doc = $this->sum_summary; $this->doc .= DOKU_LF.'</div>'.DOKU_LF; } - // FIXME not supported anymore - function toc_open() { - $this->sum_summary .= $this->doc; - } - - // FIXME not supported anymore - function toc_close() { - $this->doc = ''; - } - - function header($text, $level, $pos) { + /** @inheritdoc */ + public function header($text, $level, $pos) { if ( !$this->sum_pageTitle ) { $this->info['sum_pagetitle'] = $text; $this->sum_pageTitle = true; @@ -55,27 +46,31 @@ class Doku_Renderer_xhtmlsummary extends Doku_Renderer_xhtml { $this->doc .= "</h$level>".DOKU_LF; } - function section_open($level) { + /** @inheritdoc */ + public function section_open($level) { if ( $this->sum_capture ) { $this->sum_inSection = true; } } - function section_close() { + /** @inheritdoc */ + public function section_close() { if ( $this->sum_capture && $this->sum_inSection ) { $this->sum_summary .= $this->doc; $this->sum_capture = false; } } - function p_open() { + /** @inheritdoc */ + public function p_open() { if ( $this->sum_capture && $this->sum_paragraphs < 2 ) { $this->sum_paragraphs++; } parent :: p_open(); } - function p_close() { + /** @inheritdoc */ + public function p_close() { parent :: p_close(); if ( $this->sum_capture && $this->sum_paragraphs >= 2 ) { $this->sum_summary .= $this->doc; |