Added Home module

This commit is contained in:
Dennis Eichhorn 2018-03-28 20:01:45 +02:00
commit 1e3e30a260
14 changed files with 377 additions and 0 deletions

View File

@ -0,0 +1,35 @@
[
{
"id": 1006901001,
"pid": "/backend",
"type": 2,
"subtype": 0,
"name": "Home",
"uri": null,
"target": "self",
"icon": "fa fa-home",
"order": 10,
"from": "Home",
"permission": { "type": null, "element": null },
"parent": 0,
"children": []
},
{
"id": 1006900001,
"pid": "/backend",
"type": 1,
"subtype": 1,
"name": "Logout",
"uri": "/{/lang}/api/logout?{?}",
"target": "self",
"icon": "fa fa-power-off",
"order": 999,
"from": "Home",
"permission": {
"type": null,
"element": null
},
"parent": 0,
"children": []
}
]

View File

@ -0,0 +1,47 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Home\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool;
/**
* Navigation class.
*
* @package Modules
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Navigation
{
/**
* Install navigation providing
*
* @param string $path Path to some file
* @param DatabasePool $dbPool Database pool for database interaction
*
* @return void
*
* @since 1.0.0
*/
public static function install(string $path = null, DatabasePool $dbPool = null) : void
{
$navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer';
/** @var $class \Modules\Navigation\Admin\Installer */
$class::installExternal($dbPool, $navData);
}
}

39
Admin/Installer.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Home\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InfoManager;
use phpOMS\Module\InstallerAbstract;
/**
* Home install class.
*
* @package Modules
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Installer extends InstallerAbstract
{
/**
* {@inheritdoc}
*/
public static function install(string $path, DatabasePool $dbPool, InfoManager $info) : void
{
parent::install(__DIR__ . '/..', $dbPool, $info);
}
}

View File

@ -0,0 +1,6 @@
<?php
use phpOMS\Router\RouteVerb;
return [
];

3
Admin/Routes/console.php Normal file
View File

@ -0,0 +1,3 @@
<?php
$moduleRoutes = [];

3
Admin/Routes/socket.php Normal file
View File

@ -0,0 +1,3 @@
<?php
$moduleRoutes = [];

32
Admin/Status.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Home\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\StatusAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @package Modules
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Status extends StatusAbstract
{
}

32
Admin/Uninstaller.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Home\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\UninstallerAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @package Modules
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Uninstaller extends UninstallerAbstract
{
}

42
Admin/Updater.php Normal file
View File

@ -0,0 +1,42 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Home\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\UpdaterAbstract;
use phpOMS\System\File\Directory;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @package Modules
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Updater extends UpdaterAbstract
{
/**
* {@inheritdoc}
*/
public static function update(DatabasePool $dbPool, InfoManager $info)
{
Directory::deletePath(__DIR__ . '/Update');
mkdir('Update');
parent::update($dbPool, $info);
}
}

85
Controller.php Normal file
View File

@ -0,0 +1,85 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Home;
use Modules\Navigation\Models\Navigation;
use Modules\Navigation\Views\NavigationView;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
use phpOMS\Views\View;
/**
* Home class.
*
* @package Modules
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module path.
*
* @var string
* @since 1.0.0
*/
public const MODULE_PATH = __DIR__;
/**
* Module version.
*
* @var string
* @since 1.0.0
*/
public const MODULE_VERSION = '1.0.0';
/**
* Module name.
*
* @var string
* @since 1.0.0
*/
public const MODULE_NAME = 'Home';
/**
* Module id.
*
* @var int
* @since 1.0.0
*/
public const MODULE_ID = 1006900000;
/**
* Providing.
*
* @var string[]
* @since 1.0.0
*/
protected static $providing = [];
/**
* Dependencies.
*
* @var string[]
* @since 1.0.0
*/
protected static $dependencies = [
];
}

1
README.md Normal file
View File

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

View File

@ -0,0 +1,16 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
return ['Navigation' => [
'Home' => 'Home',
'Logout' => 'Logout',
]];

BIN
img/module_teaser_small.png Normal file

Binary file not shown.

36
info.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": {
"id": 1006900000,
"internal": "Home",
"external": "Backend Home"
},
"category": "General",
"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 home module.",
"directory": "Home",
"dependencies": {
"Admin": "1.0.0"
},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"/backend"
],
"type": 5,
"from": "Home",
"for": "Navigation",
"file": "Navigation"
}
]
}