icingaweb2-module-businessp.../application/controllers/IndexController.php

33 lines
889 B
PHP
Raw Normal View History

2015-03-16 04:08:00 -04:00
<?php
2015-11-17 08:21:59 -05:00
namespace Icinga\Module\Businessprocess\Controllers;
2015-03-16 04:08:00 -04:00
use Icinga\Module\Businessprocess\Controller;
2015-11-17 08:21:59 -05:00
class IndexController extends Controller
2015-03-16 04:08:00 -04:00
{
/**
* Show a welcome page if no process is available
*/
public function indexAction()
{
$this->tabs()->add('welcome', array(
'label' => $this->translate('Business Processes'),
'url' => $this->getRequest()->getUrl()
))->activate('welcome');
$configs = $this->storage()->listProcesses();
if (! empty($configs)) {
// Redirect to show the first process if there is any
$this->redirectNow(
'businessprocess/process/show',
array('config' => key($configs))
);
}
// Check back from time to time, maybe someone created a process
$this->setAutorefreshInterval(30);
}
}