From 54292bb6fbc98006b8457133e6dc0f6c5ce3f746 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 31 Dec 2015 18:05:19 +0100 Subject: [PATCH] Restructure --- Admin/Activate.php | 2 +- Admin/Deactivate.php | 2 +- Admin/Install/Navigation.php | 2 ++ Admin/Uninstall.php | 2 +- Admin/Update.php | 5 ++++- Controller.php | 12 +++++------- .../Lang/Navigation.en.lang.php} | 0 Theme/{lang => backend/Lang}/api.en.lang.php | 0 .../backend.en.lang.php => backend/Lang/en.lang.php} | 0 Theme/backend/profile-single.tpl.php | 6 +++--- info.json | 4 ++-- 11 files changed, 19 insertions(+), 16 deletions(-) rename Theme/{lang/nav.backend.en.lang.php => backend/Lang/Navigation.en.lang.php} (100%) rename Theme/{lang => backend/Lang}/api.en.lang.php (100%) rename Theme/{lang/backend.en.lang.php => backend/Lang/en.lang.php} (100%) diff --git a/Admin/Activate.php b/Admin/Activate.php index 1cb3e0e..7e2092e 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -15,7 +15,7 @@ */ namespace Modules\Profile\Admin; -use phpOMS\DataStorage\Database\DatabaseType; + use phpOMS\DataStorage\Database\Pool; use phpOMS\Module\ActivateAbstract; diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index 9c9d638..5940d05 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -15,7 +15,7 @@ */ namespace Modules\Profile\Admin; -use phpOMS\DataStorage\Database\DatabaseType; + use phpOMS\DataStorage\Database\Pool; use phpOMS\Module\DeactivateAbstract; diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 27ce226..7c7e4fa 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -14,6 +14,7 @@ * @link http://orange-management.com */ namespace Modules\Profile\Admin\Install; +use phpOMS\DataStorage\Database\Pool; /** * Navigation class. @@ -33,6 +34,7 @@ class Navigation $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/Uninstall.php b/Admin/Uninstall.php index 900834a..2cd4022 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -15,7 +15,7 @@ */ namespace Modules\Profile\Admin; -use phpOMS\DataStorage\Database\DatabaseType; + use phpOMS\DataStorage\Database\Pool; use phpOMS\Module\UninstallAbstract; diff --git a/Admin/Update.php b/Admin/Update.php index e108c50..5f0149c 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -15,9 +15,10 @@ */ namespace Modules\Profile\Admin; -use phpOMS\DataStorage\Database\DatabaseType; + use phpOMS\DataStorage\Database\Pool; use phpOMS\Module\UpdateAbstract; +use phpOMS\System\FileSystem; /** * Navigation class. @@ -38,6 +39,8 @@ class Update extends UpdateAbstract */ public static function update(Pool $dbPool, array $info) { + FileSystem::deletePath(__DIR__ . '/Update'); + mkdir('Update'); parent::update($dbPool, $info); } } diff --git a/Controller.php b/Controller.php index c4bc6c6..58a004e 100644 --- a/Controller.php +++ b/Controller.php @@ -62,7 +62,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var \string * @since 1.0.0 */ - protected static $module = 'Profile'; + const MODULE_NAME = 'Profile'; /** * Localization files. @@ -71,7 +71,7 @@ class Controller extends ModuleAbstract implements WebInterface * @since 1.0.0 */ protected static $localization = [ - RequestDestination::BACKEND => ['backend'], + RequestDestination::BACKEND => [''], ]; /** @@ -80,9 +80,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var \string * @since 1.0.0 */ - protected static $providing = [ - 'Content', - ]; + protected static $providing = []; /** * Dependencies. @@ -115,7 +113,7 @@ class Controller extends ModuleAbstract implements WebInterface public function viewProfileList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { $view = new View($this->app, $request, $response); - $view->setTemplate('/Modules/Profile/Theme/backend/profile-list'); + $view->setTemplate('/Modules/Profile/Theme/Backend/profile-list'); return $view; } @@ -134,7 +132,7 @@ class Controller extends ModuleAbstract implements WebInterface { $nav = Navigation::getInstance($request, $this->app->dbPool); $navView = new NavigationView($this->app, $request, $response); - $navView->setTemplate('/Modules/Navigation/Theme/backend/mid'); + $navView->setTemplate('/Modules/Navigation/Theme/Backend/mid'); $navView->setNav($nav->getNav()); $navView->setLanguage($request->getL11n()->language); $navView->setParent($pageId); diff --git a/Theme/lang/nav.backend.en.lang.php b/Theme/backend/Lang/Navigation.en.lang.php similarity index 100% rename from Theme/lang/nav.backend.en.lang.php rename to Theme/backend/Lang/Navigation.en.lang.php diff --git a/Theme/lang/api.en.lang.php b/Theme/backend/Lang/api.en.lang.php similarity index 100% rename from Theme/lang/api.en.lang.php rename to Theme/backend/Lang/api.en.lang.php diff --git a/Theme/lang/backend.en.lang.php b/Theme/backend/Lang/en.lang.php similarity index 100% rename from Theme/lang/backend.en.lang.php rename to Theme/backend/Lang/en.lang.php diff --git a/Theme/backend/profile-single.tpl.php b/Theme/backend/profile-single.tpl.php index 83b99f2..6e1540c 100644 --- a/Theme/backend/profile-single.tpl.php +++ b/Theme/backend/profile-single.tpl.php @@ -17,13 +17,13 @@ * @var \phpOMS\Views\View $this */ $nav = new \Modules\Navigation\Views\NavigationView($this->app, $this->request, $this->response); -$nav->setTemplate('/Modules/Navigation/Theme/backend/mid'); +$nav->setTemplate('/Modules/Navigation/Theme/Backend/mid'); $nav->setNav($this->getData('nav')); $nav->setLanguage($this->l11n->language); $nav->setParent(1000301001); $sidenav = new \Modules\Navigation\Views\NavigationView($this->app, $this->request, $this->response); -$sidenav->setTemplate('/Modules/Navigation/Theme/backend/mid-side'); +$sidenav->setTemplate('/Modules/Navigation/Theme/Backend/mid-side'); $sidenav->setNav($this->getData('nav')); $sidenav->setLanguage($this->l11n->language); $sidenav->setParent(1000301001); @@ -33,7 +33,7 @@ $sidenav->setParent(1000301001);
- +
render(); ?> diff --git a/info.json b/info.json index 17b50f9..8e7730a 100644 --- a/info.json +++ b/info.json @@ -35,7 +35,7 @@ ], "type": 5, "for": "Content", - "file": "backend", + "file": "", "from": "Profile" }, { @@ -45,7 +45,7 @@ "type": 5, "from": "Profile", "for": "Navigation", - "file": "nav.backend" + "file": "Navigation" } ] }