diff --git a/src/psm/Module/AbstractController.class.php b/src/psm/Module/AbstractController.class.php index 92bde95a..abbcbd6d 100644 --- a/src/psm/Module/AbstractController.class.php +++ b/src/psm/Module/AbstractController.class.php @@ -86,6 +86,12 @@ abstract class AbstractController implements ControllerInterface { */ protected $modal = array(); + /** + * html code of header accessories + * @var string $header_accessories + */ + protected $header_accessories; + /** * Database object * @var \psm\Service\Database $db @@ -125,6 +131,12 @@ abstract class AbstractController implements ControllerInterface { */ protected $user_level_required_actions = array(); + /* + * Required using black background layout + * @var boolean $black_background + */ + protected $black_background = false; + /** * XHR mode? * @var boolean $xhr @@ -214,6 +226,10 @@ abstract class AbstractController implements ControllerInterface { if($this->add_menu) { $tpl_data['html_menu'] = $this->createHTMLMenu(); } + // add header accessories to page ? + if($this->header_accessories) { + $tpl_data['header_accessories'] = $this->header_accessories; + } // add modal dialog to page ? if(sizeof($this->modal)) { $html_modal = ''; @@ -240,6 +256,10 @@ abstract class AbstractController implements ControllerInterface { if(psm_update_available()) { $tpl_data['update_available'] = str_replace('{version}', 'v'.psm_get_conf('version_update_check'), psm_get_lang('system', 'update_available')); } + + if($this->black_background) { + $tpl_data['body_class'] = 'black_background'; + } // add the module's custom template to the main template to get some content $this->setTemplateId('main'); @@ -497,6 +517,14 @@ abstract class AbstractController implements ControllerInterface { return $this; } + /** + * Set the html code of the header accessories + * @param string $html + */ + public function setHeaderAccessories($html) { + $this->header_accessories = $html; + } + /** * Check if XHR is on * @return boolean diff --git a/src/psm/Module/Server/Controller/StatusController.class.php b/src/psm/Module/Server/Controller/StatusController.class.php index 60673aaf..c09e890d 100644 --- a/src/psm/Module/Server/Controller/StatusController.class.php +++ b/src/psm/Module/Server/Controller/StatusController.class.php @@ -46,6 +46,14 @@ class StatusController extends AbstractServerController { * @todo move the background colurs to the config */ protected function executeIndex() { + // set background color to black + $this->black_background = true; + + // add header accessories + $this->tpl->newTemplate('status_layout_selector', 'server/status.tpl.html'); + $html_accessories = $this->tpl->getTemplate('status_layout_selector'); + $this->setHeaderAccessories($html_accessories); + $this->setTemplateId('server_status', 'server/status.tpl.html'); $this->addFooter(false); @@ -76,6 +84,8 @@ class StatusController extends AbstractServerController { // add servers to template $this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_offline', $offline); $this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_online', $online); + $this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_offline2', $offline); + $this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'servers_online2', $online); // check if we need to add the auto refresh $auto_refresh = psm_get_conf('auto_refresh_servers'); diff --git a/src/templates/main.tpl.html b/src/templates/main.tpl.html index de2d1752..a317917a 100755 --- a/src/templates/main.tpl.html +++ b/src/templates/main.tpl.html @@ -22,7 +22,7 @@ - +