Skip to content

Commit 1d870c8

Browse files
committed
!410 - update
1 parent bb35c6e commit 1d870c8

File tree

32 files changed

+750
-111
lines changed

32 files changed

+750
-111
lines changed

apps/Core/Components/Devtools/Modules/ModulesComponent.php

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public function viewAction()
6161
if (count($modulesArr['modules']) > 0) {
6262
$modules[$modulesType]['value'] = ucfirst($modulesType);
6363
$modules[$modulesType]['childs'] = $modulesArr['modules'];
64+
} else {
65+
$modules[$modulesType]['childs'] = [];
6466
}
6567
}
6668

@@ -91,9 +93,7 @@ public function viewAction()
9193
$this->view->categoryArr = ${$type . 'CategoryArr'};
9294

9395
if ($type === 'components') {
94-
$baseMenuStructure = $this->basepackages->menus->getMenusForAppType($module['app_type']);
95-
96-
$this->view->menuBaseStructure = $baseMenuStructure;
96+
$this->view->menuBaseStructure = $this->basepackages->menus->getMenusForAppType($module['app_type']);
9797
}
9898
} else {
9999
$this->view->categoryArr = ['core' => ['id' => 'providers', 'name' => 'Providers']];
@@ -274,11 +274,50 @@ protected function processModulesArr($modulesArr)
274274
if ($module['app_type'] === 'core') {
275275
unset($modulesArr['modules'][$key]);
276276
}
277-
} else {
278-
$module['name'] = ucfirst($module['app_type']) . ' : ' . $module['name'];
279277
}
280278
}
281279

282280
return $modulesArr;
283281
}
282+
283+
public function getAppTypeMenusAction()
284+
{
285+
if ($this->request->isPost()) {
286+
if (!$this->checkCSRF()) {
287+
return;
288+
}
289+
290+
if (isset($this->postData()['app_type'])) {
291+
$this->addResponse(
292+
'Menu structure for app_type generated', 0,
293+
$this->modules->manager->packagesData->responseData =
294+
[
295+
'menus_html' =>
296+
$this->generateTree(
297+
$this->basepackages->menus->getMenusForAppType(
298+
$this->postData()['app_type']
299+
)
300+
)
301+
]
302+
);
303+
} else {
304+
$this->addResponse('Please provide module type and module id', 1);
305+
}
306+
} else {
307+
$this->addResponse('Method Not Allowed', 1);
308+
}
309+
}
310+
311+
private function generateTree($menusTree)
312+
{
313+
return $this->adminltetags->useTag(
314+
'tree',
315+
[
316+
'treeMode' => 'jstree',
317+
'treeData' => $menusTree,
318+
'groupIcon' => '{"icon" : "fas fa-fw fa-circle-dot text-sm"}',
319+
'itemIcon' => '{"icon" : "fas fa-fw fa-circle-dot text-sm"}'
320+
]
321+
);
322+
}
284323
}

apps/Core/Components/Domains/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"settings" : {
3232
"mandatory" : {
33-
"admin" : true
33+
"core" : true
3434
}
3535
}
3636
}

apps/Core/Components/Modules/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"settings" : {
3131
"mandatory" : {
32-
"admin" : true
32+
"core" : true
3333
}
3434
}
3535
}

apps/Core/Components/System/Core/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"settings" : {
3838
"mandatory" : {
39-
"admin" : true
39+
"core" : true
4040
}
4141
}
4242
}

apps/Core/Components/System/Email/Queue/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"settings" : {
4343
"mandatory" : {
44-
"admin" : true
44+
"core" : true
4545
}
4646
}
4747
}

apps/Core/Components/System/Email/Services/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"settings" : {
4343
"mandatory" : {
44-
"admin" : true
44+
"core" : true
4545
}
4646
}
4747
}

apps/Core/Components/System/Filters/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"settings" : {
3838
"mandatory" : {
39-
"admin" : true
39+
"core" : true
4040
}
4141
}
4242
}

apps/Core/Components/System/Geo/Cities/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"settings" : {
4343
"mandatory" : {
44-
"admin" : true
44+
"core" : true
4545
}
4646
}
4747
}

apps/Core/Components/System/Geo/Countries/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"settings" : {
4343
"mandatory" : {
44-
"admin" : true
44+
"core" : true
4545
}
4646
}
4747
}

apps/Core/Components/System/Geo/States/Install/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"settings" : {
4343
"mandatory" : {
44-
"admin" : true
44+
"core" : true
4545
}
4646
}
4747
}

0 commit comments

Comments
 (0)