Refactored project structure.
This commit is contained in:
parent
cfe93434ad
commit
c015d8c58b
308 changed files with 39 additions and 47 deletions
42
src/Controller/HomeController.php
Normal file
42
src/Controller/HomeController.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue