From fb718d5f326368ba26fd6fc2f16c6b75198d35c2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 9 Mar 2019 23:21:29 +0100 Subject: [PATCH] Make app,localization in url optional+tld+subdomain --- Admin/Install/Navigation.install.json | 38 +++++++++---------- Admin/Routes/Web/Api.php | 12 +++--- Admin/Routes/Web/Backend.php | 18 ++++----- .../department-selector.tpl.php | 4 +- .../position-selector.tpl.php | 4 +- .../UnitTagSelector/unit-selector.tpl.php | 4 +- Theme/Backend/department-create.tpl.php | 2 +- Theme/Backend/department-list.tpl.php | 2 +- Theme/Backend/department-profile.tpl.php | 2 +- Theme/Backend/position-create.tpl.php | 2 +- Theme/Backend/position-list.tpl.php | 2 +- Theme/Backend/position-profile.tpl.php | 2 +- Theme/Backend/unit-create.tpl.php | 2 +- Theme/Backend/unit-list.tpl.php | 2 +- Theme/Backend/unit-profile.tpl.php | 2 +- info.json | 4 +- 16 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index ab2f561..255c7a0 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -1,7 +1,7 @@ [ { "id": 1004701001, - "pid": "/backend", + "pid": "/", "type": 2, "subtype": 0, "name": "Organization", @@ -15,11 +15,11 @@ "children": [ { "id": 1004702001, - "pid": "/backend", + "pid": "/", "type": 2, "subtype": 1, "name": "Units", - "uri": "{/lang}/backend/organization/unit/list?{?}", + "uri": "{/prefix}organization/unit/list?{?}", "target": "self", "icon": null, "order": 1, @@ -29,11 +29,11 @@ "children": [ { "id": 1004702101, - "pid": "/backend/organization/unit", + "pid": "/organization/unit", "type": 3, "subtype": 1, "name": "List", - "uri": "{/lang}/backend/organization/unit/list?{?}", + "uri": "{/prefix}organization/unit/list?{?}", "target": "self", "icon": null, "order": 5, @@ -44,11 +44,11 @@ }, { "id": 1004702102, - "pid": "/backend/organization/unit", + "pid": "/organization/unit", "type": 3, "subtype": 1, "name": "Create", - "uri": "{/lang}/backend/organization/unit/create?{?}", + "uri": "{/prefix}organization/unit/create?{?}", "target": "self", "icon": null, "order": 25, @@ -61,11 +61,11 @@ }, { "id": 1004703001, - "pid": "/backend", + "pid": "/", "type": 2, "subtype": 1, "name": "Departments", - "uri": "{/lang}/backend/organization/department/list?{?}", + "uri": "{/prefix}organization/department/list?{?}", "target": "self", "icon": null, "order": 5, @@ -75,11 +75,11 @@ "children": [ { "id": 1004703101, - "pid": "/backend/organization/department", + "pid": "/organization/department", "type": 3, "subtype": 1, "name": "List", - "uri": "{/lang}/backend/organization/department/list?{?}", + "uri": "{/prefix}organization/department/list?{?}", "target": "self", "icon": null, "order": 5, @@ -90,11 +90,11 @@ }, { "id": 1004703102, - "pid": "/backend/organization/department", + "pid": "/organization/department", "type": 3, "subtype": 1, "name": "Create", - "uri": "{/lang}/backend/organization/department/create?{?}", + "uri": "{/prefix}organization/department/create?{?}", "target": "self", "icon": null, "order": 25, @@ -107,11 +107,11 @@ }, { "id": 1004704001, - "pid": "/backend", + "pid": "/", "type": 2, "subtype": 1, "name": "Positions", - "uri": "{/lang}/backend/organization/position/list?{?}", + "uri": "{/prefix}organization/position/list?{?}", "target": "self", "icon": null, "order": 20, @@ -121,11 +121,11 @@ "children": [ { "id": 1004704101, - "pid": "/backend/organization/position", + "pid": "/organization/position", "type": 3, "subtype": 1, "name": "List", - "uri": "{/lang}/backend/organization/position/list?{?}", + "uri": "{/prefix}organization/position/list?{?}", "target": "self", "icon": null, "order": 5, @@ -136,11 +136,11 @@ }, { "id": 1004704102, - "pid": "/backend/organization/position", + "pid": "/organization/position", "type": 3, "subtype": 1, "name": "Create", - "uri": "{/lang}/backend/organization/position/create?{?}", + "uri": "{/prefix}organization/position/create?{?}", "target": "self", "icon": null, "order": 25, diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 301139c..453fca3 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/api/organization/position.*$' => [ + '^.*/organization/position.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiPositionCreate', 'verb' => RouteVerb::PUT, @@ -44,7 +44,7 @@ return [ ], ], ], - '^.*/api/organization/department.*$' => [ + '^.*/organization/department.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiDepartmentCreate', 'verb' => RouteVerb::PUT, @@ -82,7 +82,7 @@ return [ ], ], ], - '^.*/api/organization/unit.*$' => [ + '^.*/organization/unit.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiUnitCreate', 'verb' => RouteVerb::PUT, @@ -121,7 +121,7 @@ return [ ], ], - '^.*/api/organization/find/unit.*$' => [ + '^.*/organization/find/unit.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiUnitFind', 'verb' => RouteVerb::GET, @@ -132,7 +132,7 @@ return [ ], ], ], - '^.*/api/organization/find/department.*$' => [ + '^.*/organization/find/department.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiDepartmentFind', 'verb' => RouteVerb::GET, @@ -143,7 +143,7 @@ return [ ], ], ], - '^.*/api/organization/find/position.*$' => [ + '^.*/organization/find/position.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiPositionFind', 'verb' => RouteVerb::GET, diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index dbaef75..299ac9f 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/backend/organization/unit/list.*$' => [ + '^.*/organization/unit/list.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewUnitList', 'verb' => RouteVerb::GET, @@ -17,7 +17,7 @@ return [ ], ], ], - '^.*/backend/organization/unit/profile.*$' => [ + '^.*/organization/unit/profile.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewUnitProfile', 'verb' => RouteVerb::GET, @@ -28,7 +28,7 @@ return [ ], ], ], - '^.*/backend/organization/unit/create.*$' => [ + '^.*/organization/unit/create.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewUnitCreate', 'verb' => RouteVerb::GET, @@ -39,7 +39,7 @@ return [ ], ], ], - '^.*/backend/organization/department/list.*$' => [ + '^.*/organization/department/list.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewDepartmentList', 'verb' => RouteVerb::GET, @@ -50,7 +50,7 @@ return [ ], ], ], - '^.*/backend/organization/department/profile.*$' => [ + '^.*/organization/department/profile.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewDepartmentProfile', 'verb' => RouteVerb::GET, @@ -61,7 +61,7 @@ return [ ], ], ], - '^.*/backend/organization/department/create.*$' => [ + '^.*/organization/department/create.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewDepartmentCreate', 'verb' => RouteVerb::GET, @@ -72,7 +72,7 @@ return [ ], ], ], - '^.*/backend/organization/position/list.*$' => [ + '^.*/organization/position/list.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewPositionList', 'verb' => RouteVerb::GET, @@ -83,7 +83,7 @@ return [ ], ], ], - '^.*/backend/organization/position/profile.*$' => [ + '^.*/organization/position/profile.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewPositionProfile', 'verb' => RouteVerb::GET, @@ -94,7 +94,7 @@ return [ ], ], ], - '^.*/backend/organization/position/create.*$' => [ + '^.*/organization/position/create.*$' => [ [ 'dest' => '\Modules\Organization\Controller\BackendController:viewPositionCreate', 'verb' => RouteVerb::GET, diff --git a/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php b/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php index a03b92a..b5ef158 100644 --- a/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php +++ b/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php @@ -5,9 +5,9 @@ { "key": 1, "listener": "click", "action": [ {"key": 1, "type": "dom.popup", "selector": "#org-department-selector-tpl", "aniIn": "fadeIn", "id": "printHtml($this->getId()); ?>"}, - {"key": 2, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, + {"key": 2, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, {"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}, - {"key": 4, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, + {"key": 4, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, {"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1} ] } diff --git a/Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php b/Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php index 28f895c..f5645de 100644 --- a/Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php +++ b/Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php @@ -5,9 +5,9 @@ { "key": 1, "listener": "click", "action": [ {"key": 1, "type": "dom.popup", "selector": "#org-position-selector-tpl", "aniIn": "fadeIn", "id": "printHtml($this->getId()); ?>"}, - {"key": 2, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, + {"key": 2, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, {"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}, - {"key": 4, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, + {"key": 4, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, {"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1} ] } diff --git a/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php b/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php index 761d901..8f5a4f9 100644 --- a/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php +++ b/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php @@ -5,9 +5,9 @@ { "key": 1, "listener": "click", "action": [ {"key": 1, "type": "dom.popup", "selector": "#org-unit-selector-tpl", "aniIn": "fadeIn", "id": "printHtml($this->getId()); ?>"}, - {"key": 2, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, + {"key": 2, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, {"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name"}, "position": -1}, - {"key": 4, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, + {"key": 4, "type": "message.request", "uri": "", "method": "GET", "request_type": "json"}, {"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name"}, "position": -1} ] } diff --git a/Theme/Backend/department-create.tpl.php b/Theme/Backend/department-create.tpl.php index 31428bd..3d0b4e1 100644 --- a/Theme/Backend/department-create.tpl.php +++ b/Theme/Backend/department-create.tpl.php @@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Department') ?>

-
+ getData('list:elements') as $key => $value) : $c++; - $url = \phpOMS\Uri\UriFactory::build('{/lang}/backend/organization/department/profile?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('{/prefix}organization/department/profile?{?}&id=' . $value->getId()); ?>
diff --git a/Theme/Backend/department-list.tpl.php b/Theme/Backend/department-list.tpl.php index a30013e..e13687b 100644 --- a/Theme/Backend/department-list.tpl.php +++ b/Theme/Backend/department-list.tpl.php @@ -38,7 +38,7 @@ echo $this->getData('nav')->render(); ?>
printHtml($value->getId()); ?> printHtml($value->getName()); ?> diff --git a/Theme/Backend/department-profile.tpl.php b/Theme/Backend/department-profile.tpl.php index b88eee0..65ec7d5 100644 --- a/Theme/Backend/department-profile.tpl.php +++ b/Theme/Backend/department-profile.tpl.php @@ -23,7 +23,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Department') ?>

- +
diff --git a/Theme/Backend/position-create.tpl.php b/Theme/Backend/position-create.tpl.php index 95ada6a..9a2b15f 100644 --- a/Theme/Backend/position-create.tpl.php +++ b/Theme/Backend/position-create.tpl.php @@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Position') ?>

- + $value) : ++$count; - $url = \phpOMS\Uri\UriFactory::build('{/lang}/backend/organization/position/profile?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('{/prefix}organization/position/profile?{?}&id=' . $value->getId()); ?>
diff --git a/Theme/Backend/position-list.tpl.php b/Theme/Backend/position-list.tpl.php index a832549..2b281a1 100644 --- a/Theme/Backend/position-list.tpl.php +++ b/Theme/Backend/position-list.tpl.php @@ -40,7 +40,7 @@ echo $this->getData('nav')->render(); ?>
printHtml($value->getId()); ?> printHtml($value->getName()); ?> diff --git a/Theme/Backend/position-profile.tpl.php b/Theme/Backend/position-profile.tpl.php index a0d47b5..8753b4f 100644 --- a/Theme/Backend/position-profile.tpl.php +++ b/Theme/Backend/position-profile.tpl.php @@ -23,7 +23,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Position') ?>

- +
diff --git a/Theme/Backend/unit-create.tpl.php b/Theme/Backend/unit-create.tpl.php index 01e02a6..dc9edfb 100644 --- a/Theme/Backend/unit-create.tpl.php +++ b/Theme/Backend/unit-create.tpl.php @@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Unit') ?>

- + getData('list:elements') as $key => $value) : - $url = \phpOMS\Uri\UriFactory::build('{/lang}/backend/organization/unit/profile?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('{/prefix}organization/unit/profile?{?}&id=' . $value->getId()); ?>
diff --git a/Theme/Backend/unit-list.tpl.php b/Theme/Backend/unit-list.tpl.php index 3d557bc..b932f86 100644 --- a/Theme/Backend/unit-list.tpl.php +++ b/Theme/Backend/unit-list.tpl.php @@ -37,7 +37,7 @@ echo $this->getData('nav')->render(); ?>
printHtml($value->getId()); ?> printHtml($value->getName()); ?> diff --git a/Theme/Backend/unit-profile.tpl.php b/Theme/Backend/unit-profile.tpl.php index 44d9dc6..5875c47 100644 --- a/Theme/Backend/unit-profile.tpl.php +++ b/Theme/Backend/unit-profile.tpl.php @@ -23,7 +23,7 @@ echo $this->getData('nav')->render(); ?>

getHtml('Unit') ?>

- +
diff --git a/info.json b/info.json index 786e49b..e07d5f4 100644 --- a/info.json +++ b/info.json @@ -26,7 +26,7 @@ "load": [ { "pid": [ - "/backend/organization" + "/organization" ], "type": 4, "for": "Organization", @@ -35,7 +35,7 @@ }, { "pid": [ - "/backend" + "/" ], "type": 5, "from": "Organization",