From 2b905a4f3ff21355e1b3cf21ac4689f1e2211b90 Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Fri, 10 Jan 2014 15:12:51 +0100 Subject: [PATCH] modCore: adding addFooter() method to determine whether or not to add the footer part --- classes/mod/modCore.class.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/classes/mod/modCore.class.php b/classes/mod/modCore.class.php index 5d6b11c6..1d986966 100755 --- a/classes/mod/modCore.class.php +++ b/classes/mod/modCore.class.php @@ -39,6 +39,11 @@ abstract class modCore { */ public $mode; + /** + * Add footer to page? + * @var boolean $add_footer + */ + protected $add_footer = true; /** * smDatabase object @@ -74,9 +79,13 @@ abstract class modCore { * Then the tpl_id set in $this->getTemplateId() will be added to the main template automatically */ public function createHTML() { - // add JS and CSS files - $this->tpl->addJS('monitor.js'); - $this->tpl->addCSS('monitor.css'); + // add footer to page? + if($this->add_footer) { + $this->tpl->newTemplate('main_footer', 'main.tpl.html'); + $html_footer = $this->tpl->getTemplate('main_footer'); + } else { + $html_footer = ''; + } if(sm_get_conf('show_update')) { // user wants updates, lets see what we can do @@ -90,6 +99,7 @@ abstract class modCore { array( 'content' => $this->tpl->getTemplate($this->getTemplateId()), 'message' => ($this->message == '') ? ' ' : $this->message, + 'html_footer' => $html_footer, ) ); @@ -166,6 +176,14 @@ abstract class modCore { public function getTemplateId() { return $this->tpl_id; } + + /** + * Hide or show the footer of the page + * @param boolean $value + */ + protected function addFooter($value) { + $this->add_footer = $value; + } } ?> \ No newline at end of file