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

This commit is contained in:
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;
/**
* 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 == '') ? '&nbsp' : $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;
}
}
?>