Monitoring\Controller: provide $this->backend
Every monitoring controller needs $backend, so why declaring it over and over again. Created "moduleInit" dummy function in our base action controller to allow such implementations without polluting init().
This commit is contained in:
parent
25758332ab
commit
468b290277
|
@ -134,6 +134,7 @@ class ActionController extends Zend_Controller_Action
|
|||
if ($this->requiresConfig() === false) {
|
||||
if ($this->requiresLogin() === false) {
|
||||
$this->view->tabs = new Tabs();
|
||||
$this->moduleInit();
|
||||
$this->init();
|
||||
} else {
|
||||
$url = $this->getRequestUrl();
|
||||
|
@ -148,6 +149,10 @@ class ActionController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
protected function moduleInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected function getWindowId()
|
||||
{
|
||||
if ($this->windowId === null) {
|
||||
|
|
|
@ -37,6 +37,13 @@ use Icinga\File\Csv;
|
|||
*/
|
||||
class Controller extends ActionController
|
||||
{
|
||||
/**
|
||||
* The backend used for this controller
|
||||
*
|
||||
* @var Backend
|
||||
*/
|
||||
protected $backend;
|
||||
|
||||
/**
|
||||
* Compact layout name
|
||||
*
|
||||
|
@ -47,6 +54,11 @@ class Controller extends ActionController
|
|||
*/
|
||||
protected $compactView;
|
||||
|
||||
protected function moduleInit()
|
||||
{
|
||||
$this->backend = Backend::createBackend($this->_getParam('backend'));
|
||||
}
|
||||
|
||||
protected function handleFormatRequest($query)
|
||||
{
|
||||
if ($this->compactView !== null && ($this->_getParam('view', false) === 'compact')) {
|
||||
|
|
Loading…
Reference in New Issue