deblan.tv/vendor/trinity/src/Trinity/.svn/pristine/fb/fb238b78423c878789bc6af9217357d5ce14e2d8.svn-base
2015-03-02 21:57:49 +01:00

51 lines
1.3 KiB
Plaintext

<?php
namespace Trinity\Bundle\DashBoardBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Trinity\Bundle\DashBoardBundle\DashBoard\ConfigurationTransformer;
use Trinity\Bundle\UserBundle\Model\UserPeer;
/**
* @Route("/admin")
*/
class DefaultController extends Controller
{
protected $router;
protected $rac;
protected $config;
protected function init()
{
$this->rac = $this->get('trinity.security.route_access_control');
$this->router = $this->container->get('router');
$this->config = $this->container->getParameter('trinity_dash_board.dash');
}
/**
* @Route("/", name="TrinityDashBoardBundle_index")
* @Template()
*/
public function indexAction()
{
$this->init();
return $this->render(
$this->config['template'],
array(
'dashboard' => $this->getDashboard(),
'connections' => UserPeer::getLastConnections(),
)
);
}
public function getDashboard()
{
$transformer = new ConfigurationTransformer($this->rac, $this->router, $this->config);
return $transformer->getDash();
}
}