This commit is contained in:
Dennis Eichhorn 2015-11-29 21:57:18 +01:00
commit 5a98f505fa
9 changed files with 342 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Dashboard\Admin\Install;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Navigation
{
public static function install($dbPool)
{
$navData = json_decode(file_get_contents(__DIR__ . '/nav.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer';
$class::installExternal($dbPool, $navData);
}
}

View File

@ -0,0 +1,63 @@
[
{
"id": 1000201001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 0,
"name": "Home",
"uri": null,
"target": "self",
"icon": "fa fa-home",
"order": 10,
"from": "Dashboard",
"permission": null,
"parent": 0,
"children": [
{
"id": 1000202001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Dashboard",
"uri": "/{/lang}/backend",
"target": "self",
"icon": null,
"order": 1,
"from": "Dashboard",
"permission": null,
"parent": 1000201001,
"children": []
}
]
},
{
"id": 1000200001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 1,
"subtype": 1,
"name": "Logout",
"uri": "/{/lang}/api/logout",
"target": "self",
"icon": "fa fa-power-off",
"order": 999,
"from": "Dashboard",
"permission": null,
"parent": 0,
"children": []
},
{
"id": 1000210001,
"pid": "40a630e157504605e40ba241f6b1f78ab1dd97b9",
"type": 1,
"subtype": 1,
"name": "Logout",
"uri": "/{/lang}/api/logout",
"target": "self",
"icon": "fa fa-power-off",
"order": 999,
"from": "Dashboard",
"permission": null,
"parent": 0,
"children": []
}
]

39
Admin/Installer.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Dashboard\Admin;
use phpOMS\DataStorage\Database\Pool;
/**
* Dashboard install class.
*
* @category Modules
* @package Modules\BackendDashboard
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Installer
{
/**
* {@inheritdoc}
*/
public static function install(Pool $dbPool, array $info)
{
}
}

129
Controller.php Normal file
View File

@ -0,0 +1,129 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Dashboard;
use Modules\Navigation\Models\Navigation;
use Modules\Navigation\Views\NavigationView;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\RequestDestination;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
use phpOMS\Views\View;
use phpOMS\Views\ViewLayout;
/**
* Dashboard class.
*
* @category Modules
* @package Modules\Dashboard
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module name.
*
* @var \string
* @since 1.0.0
*/
protected static $module = 'Dashboard';
/**
* Localization files.
*
* @var \string
* @since 1.0.0
*/
protected static $localization = [
RequestDestination::BACKEND => ['backend'],
];
/**
* Providing.
*
* @var \string
* @since 1.0.0
*/
protected static $providing = [
'Content',
];
/**
* Dependencies.
*
* @var \string
* @since 1.0.0
*/
protected static $dependencies = [];
/**
* Routing elements.
*
* @var array
* @since 1.0.0
*/
protected static $routes = [
'^.*/backend/dashboard/list.*$' => [['dest' => '\Modules\Dashboard\Controller:viewDashboard', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
];
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Dashboard/Theme/backend/dashboard');
$view->addData('nav', $this->createNavigation(1000301001, $request, $response));
return $view;
}
/**
* @param int $pageId Page/parent Id for navigation
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
private function createNavigation(\int $pageId, RequestAbstract $request, ResponseAbstract $response)
{
$nav = Navigation::getInstance($request, $this->app->dbPool);
$navView = new NavigationView($this->app, $request, $response);
$navView->setTemplate('/Modules/Navigation/Theme/backend/mid');
$navView->setNav($nav->getNav());
$navView->setLanguage($request->getL11n()->language);
$navView->setParent($pageId);
return $navView;
}
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Backend Dashboard #

View File

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG['Navigation'] = [
'Dashboard' => 'Dashboard',
'Home' => 'Home',
'Logout' => 'Logout',
];

BIN
img/module_teaser_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

52
info.json Normal file
View File

@ -0,0 +1,52 @@
{
"name": {
"id": 1000200000,
"internal": "Dashboard",
"external": "OMS Backend Dashboard"
},
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "The backend dashboard module.",
"directory": "Dashboard",
"dependencies": {},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"3788e96aebafcdf3acc1a87861d559695e9a531f",
"40a630e157504605e40ba241f6b1f78ab1dd97b9"
],
"type": 4,
"for": 0,
"from": "Controlling",
"file": "Dashboard"
},
{
"pid": [
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
],
"type": 5,
"from": "Dashboard",
"for": "Navigation",
"file": "nav.backend"
},
{
"pid": [
"40a630e157504605e40ba241f6b1f78ab1dd97b9"
],
"type": 5,
"from": "Dashboard",
"for": "Navigation",
"file": "nav.reporter"
}
]
}