diff --git a/Admin/Activate.php b/Admin/Activate.php new file mode 100644 index 0000000..2ad8a23 --- /dev/null +++ b/Admin/Activate.php @@ -0,0 +1,44 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Dashboard\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\ActivateAbstract; +use phpOMS\Module\InfoManager; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Activate extends ActivateAbstract +{ + + /** + * {@inheritdoc} + */ + public static function activate(DatabasePool $dbPool, InfoManager $info) + { + parent::activate($dbPool, $info); + } +} diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php new file mode 100644 index 0000000..537d1dd --- /dev/null +++ b/Admin/Deactivate.php @@ -0,0 +1,44 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Dashboard\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\DeactivateAbstract; +use phpOMS\Module\InfoManager; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Deactivate extends DeactivateAbstract +{ + + /** + * {@inheritdoc} + */ + public static function deactivate(DatabasePool $dbPool, InfoManager $info) + { + parent::deactivate($dbPool, $info); + } +} diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json new file mode 100644 index 0000000..5096f49 --- /dev/null +++ b/Admin/Install/Navigation.install.json @@ -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": [] + } +] diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php new file mode 100644 index 0000000..8a71b71 --- /dev/null +++ b/Admin/Install/Navigation.php @@ -0,0 +1,40 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Dashboard\Admin\Install; +use phpOMS\DataStorage\Database\DatabasePool; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Navigation +{ + public static function install(string $path, DatabasePool $dbPool) + { + $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); + } +} diff --git a/Admin/Installer.php b/Admin/Installer.php new file mode 100644 index 0000000..46187d2 --- /dev/null +++ b/Admin/Installer.php @@ -0,0 +1,43 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Dashboard\Admin; + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\InfoManager; +use phpOMS\Module\InstallerAbstract; + +/** + * Dashboard install class. + * + * @category Modules + * @package Modules\BackendDashboard + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Installer extends InstallerAbstract +{ + + /** + * {@inheritdoc} + */ + public static function install(string $path, DatabasePool $dbPool, InfoManager $info) + { + parent::install($path, $dbPool, $info); + } +} diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php new file mode 100644 index 0000000..4690664 --- /dev/null +++ b/Admin/Routes/Web/Backend.php @@ -0,0 +1,12 @@ + [ + [ + 'dest' => '\Modules\Dashboard\Controller:viewDashboard', + 'verb' => RouteVerb::GET, + ], + ], +]; diff --git a/Admin/Routes/console.php b/Admin/Routes/console.php new file mode 100644 index 0000000..1ecbfac --- /dev/null +++ b/Admin/Routes/console.php @@ -0,0 +1,3 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Dashboard\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\UninstallAbstract; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Uninstall extends UninstallAbstract +{ + + /** + * {@inheritdoc} + */ + public static function uninstall(DatabasePool $dbPool, InfoManager $info) + { + parent::uninstall($dbPool, $info); + } +} diff --git a/Admin/Update.php b/Admin/Update.php new file mode 100644 index 0000000..de9d3b7 --- /dev/null +++ b/Admin/Update.php @@ -0,0 +1,46 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Dashboard\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\UpdateAbstract; +use phpOMS\System\File\Directory; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Update extends UpdateAbstract +{ + + /** + * {@inheritdoc} + */ + public static function update(DatabasePool $dbPool, array $info) + { + Directory::deletePath(__DIR__ . '/Update'); + mkdir('Update'); + parent::update($dbPool, $info); + } +} diff --git a/Controller.php b/Controller.php new file mode 100644 index 0000000..3bc8615 --- /dev/null +++ b/Controller.php @@ -0,0 +1,102 @@ + + * @author Dennis Eichhorn + * @copyright 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\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 + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @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 = 'Dashboard'; + + /** + * Providing. + * + * @var string + * @since 1.0.0 + */ + protected static $providing = []; + + /** + * Dependencies. + * + * @var string + * @since 1.0.0 + */ + protected static $dependencies = [ + ]; + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Dashboard/Theme/Backend/dashboard'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000301001, $request, $response)); + + return $view; + } + +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..6f4510d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Backend Dashboard # diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php new file mode 100644 index 0000000..635bb50 --- /dev/null +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -0,0 +1,20 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +return ['Navigation' => [ + 'Dashboard' => 'Dashboard', + 'Home' => 'Home', + 'Logout' => 'Logout', +]]; diff --git a/Theme/Backend/dashboard.tpl.php b/Theme/Backend/dashboard.tpl.php new file mode 100644 index 0000000..dd5a7f7 --- /dev/null +++ b/Theme/Backend/dashboard.tpl.php @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/img/module_teaser_small.png b/img/module_teaser_small.png new file mode 100644 index 0000000..f56e6ff Binary files /dev/null and b/img/module_teaser_small.png differ diff --git a/info.json b/info.json new file mode 100644 index 0000000..3ca31b6 --- /dev/null +++ b/info.json @@ -0,0 +1,44 @@ +{ + "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": { + "Admin" : "1.0.0" + }, + "providing": { + "Navigation": "*" + }, + "load": [ + { + "pid": [ + "3788e96aebafcdf3acc1a87861d559695e9a531f" + ], + "type": 4, + "for": "Content", + "from": "Dashboard", + "file": "Dashboard" + }, + { + "pid": [ + "754a08ddf8bcb1cf22f310f09206dd783d42f7dd" + ], + "type": 5, + "from": "Dashboard", + "for": "Navigation", + "file": "Navigation" + } + ] +}