Refactored project structure.

This commit is contained in:
Dmitry Khomutov 2018-03-04 18:04:15 +07:00
commit c015d8c58b
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
308 changed files with 39 additions and 47 deletions

View file

@ -1,42 +0,0 @@
<?php
namespace PHPCensor\Controller;
use PHPCensor\Config;
use PHPCensor\Helper\Lang;
use PHPCensor\Controller;
/**
* Home Controller - Displays the Dashboard.
*/
class HomeController extends Controller
{
/**
* Display dashboard:
*/
public function index()
{
$this->layout->title = Lang::get('dashboard');
$widgets = [
'left' => [],
'right' => [],
];
$widgets_config = Config::getInstance()->get('php-censor.dashboard_widgets', [
'all_projects' => [
'side' => 'left',
],
'last_builds' => [
'side' => 'right',
],
]);
foreach($widgets_config as $name => $params) {
$side = (isset($params['side']) and ($params['side'] == 'right')) ? 'right' : 'left';
$widgets[$side][$name] = $params;
}
$this->view->widgets = $widgets;
return $this->view->render();
}
}