modCore: adding addFooter() method to determine whether or not to add the footer part
parent
6b327d95b8
commit
2b905a4f3f
|
@ -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 == '') ? ' ' : $this->message,
|
'message' => ($this->message == '') ? ' ' : $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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue