modCore: adding addFooter() method to determine whether or not to add the footer part

pull/5/head
Pepijn Over 2014-01-10 15:12:51 +01:00
parent 6b327d95b8
commit 2b905a4f3f
1 changed files with 21 additions and 3 deletions

View File

@ -39,6 +39,11 @@ abstract class modCore {
*/ */
public $mode; public $mode;
/**
* Add footer to page?
* @var boolean $add_footer
*/
protected $add_footer = true;
/** /**
* smDatabase object * 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 * Then the tpl_id set in $this->getTemplateId() will be added to the main template automatically
*/ */
public function createHTML() { public function createHTML() {
// add JS and CSS files // add footer to page?
$this->tpl->addJS('monitor.js'); if($this->add_footer) {
$this->tpl->addCSS('monitor.css'); $this->tpl->newTemplate('main_footer', 'main.tpl.html');
$html_footer = $this->tpl->getTemplate('main_footer');
} else {
$html_footer = '';
}
if(sm_get_conf('show_update')) { if(sm_get_conf('show_update')) {
// user wants updates, lets see what we can do // user wants updates, lets see what we can do
@ -90,6 +99,7 @@ abstract class modCore {
array( array(
'content' => $this->tpl->getTemplate($this->getTemplateId()), 'content' => $this->tpl->getTemplate($this->getTemplateId()),
'message' => ($this->message == '') ? '&nbsp' : $this->message, 'message' => ($this->message == '') ? '&nbsp' : $this->message,
'html_footer' => $html_footer,
) )
); );
@ -166,6 +176,14 @@ abstract class modCore {
public function getTemplateId() { public function getTemplateId() {
return $this->tpl_id; return $this->tpl_id;
} }
/**
* Hide or show the footer of the page
* @param boolean $value
*/
protected function addFooter($value) {
$this->add_footer = $value;
}
} }
?> ?>