From b1378a3b595267a5a7291430dc9426d5340ab5ea Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sat, 11 Mar 2023 14:38:49 +0100 Subject: [PATCH] DummyBox: fix SubTemplate inheritance --- templates/DummyBox.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/templates/DummyBox.php b/templates/DummyBox.php index 23dc086..0ef5f24 100644 --- a/templates/DummyBox.php +++ b/templates/DummyBox.php @@ -8,28 +8,26 @@ class DummyBox extends SubTemplate { - protected $_class; protected $_content; - protected $_title; - public function __construct($title = '', $content = '', $class = '') + public function __construct($title = '', $content = '', $class = null) { - $this->_title = $title; + parent::__construct($title); $this->_content = $content; - $this->_class = $class; + + if (isset($class)) + $this->_class .= $class; } protected function html_content() { - echo ' -
', $this->_title ? ' -

' . $this->_title . '

' : '', ' - ', $this->_content; + if ($this->_title) + echo ' +

', $this->_title, '

'; + + echo $this->_content; foreach ($this->_subtemplates as $template) $template->html_main(); - - echo ' -
'; } }