update 2024-03-14

This commit is contained in:
Robot 2024-03-14 14:29:20 +02:00
parent c7492eb08e
commit 8f6a478760
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
238 changed files with 18324 additions and 5130 deletions

View File

@ -81,6 +81,7 @@ This repository contains an index (see below) of all the approved powers within
- **final class CustomTabs** | [Details](src/9551b683-67b6-4367-bb14-4b016def37e3) | [Code](src/9551b683-67b6-4367-bb14-4b016def37e3/code.php) | [Settings](src/9551b683-67b6-4367-bb14-4b016def37e3/settings.json) | Super__9551b683_67b6_4367_bb14_4b016def37e3__Power
- **final class DatabaseKeys** | [Details](src/0d8db719-39a6-48b4-85a6-2f97e784e588) | [Code](src/0d8db719-39a6-48b4-85a6-2f97e784e588/code.php) | [Settings](src/0d8db719-39a6-48b4-85a6-2f97e784e588/settings.json) | Super__0d8db719_39a6_48b4_85a6_2f97e784e588__Power
- **final class DatabaseTables** | [Details](src/b3c36de1-9b18-4ea8-8383-6ab8f0e33996) | [Code](src/b3c36de1-9b18-4ea8-8383-6ab8f0e33996/code.php) | [Settings](src/b3c36de1-9b18-4ea8-8383-6ab8f0e33996/settings.json) | Super__b3c36de1_9b18_4ea8_8383_6ab8f0e33996__Power
- **final class DatabaseUninstall** | [Details](src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac) | [Code](src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.php) | [Settings](src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/settings.json) | Super__a7fc4913_6b1a_4eea_a168_fceb75fcf6ac__Power
- **final class DatabaseUniqueGuid** | [Details](src/58b7f907-4195-4ca3-886c-17877be59887) | [Code](src/58b7f907-4195-4ca3-886c-17877be59887/code.php) | [Settings](src/58b7f907-4195-4ca3-886c-17877be59887/settings.json) | Super__58b7f907_4195_4ca3_886c_17877be59887__Power
- **final class DatabaseUniqueKeys** | [Details](src/ce0899a9-6271-4fc4-800a-697c122bb112) | [Code](src/ce0899a9-6271-4fc4-800a-697c122bb112/code.php) | [Settings](src/ce0899a9-6271-4fc4-800a-697c122bb112/settings.json) | Super__ce0899a9_6271_4fc4_800a_697c122bb112__Power
- **final class DoNotEscape** | [Details](src/0d9d3294-0bed-4c44-b1a1-e172f62cafb2) | [Code](src/0d9d3294-0bed-4c44-b1a1-e172f62cafb2/code.php) | [Settings](src/0d9d3294-0bed-4c44-b1a1-e172f62cafb2/settings.json) | Super__0d9d3294_0bed_4c44_b1a1_e172f62cafb2__Power
@ -139,6 +140,7 @@ This repository contains an index (see below) of all the approved powers within
- **final class PermissionGlobalAction** | [Details](src/a601888d-12b6-427f-94ae-95004206e24e) | [Code](src/a601888d-12b6-427f-94ae-95004206e24e/code.php) | [Settings](src/a601888d-12b6-427f-94ae-95004206e24e/settings.json) | Super__a601888d_12b6_427f_94ae_95004206e24e__Power
- **final class PermissionViews** | [Details](src/480d11b9-783b-45d5-bce1-b0c2fcaad08a) | [Code](src/480d11b9-783b-45d5-bce1-b0c2fcaad08a/code.php) | [Settings](src/480d11b9-783b-45d5-bce1-b0c2fcaad08a/settings.json) | Super__480d11b9_783b_45d5_bce1_b0c2fcaad08a__Power
- **final class Request** | [Details](src/98419ff3-6628-4539-8365-37f88378bced) | [Code](src/98419ff3-6628-4539-8365-37f88378bced/code.php) | [Settings](src/98419ff3-6628-4539-8365-37f88378bced/settings.json) | Super__98419ff3_6628_4539_8365_37f88378bced__Power
- **final class Router** | [Details](src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5) | [Code](src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.php) | [Settings](src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/settings.json) | Super__4a4cf7a3_d0f9_439e_96fb_82d7a4ae0cf5__Power
- **final class ScriptMediaSwitch** | [Details](src/17bf80af-3609-4f36-a520-be1a339c278b) | [Code](src/17bf80af-3609-4f36-a520-be1a339c278b/code.php) | [Settings](src/17bf80af-3609-4f36-a520-be1a339c278b/settings.json) | Super__17bf80af_3609_4f36_a520_be1a339c278b__Power
- **final class ScriptUserSwitch** | [Details](src/9042fac6-5ca5-4ebe-94fe-cf9b0718ed36) | [Code](src/9042fac6-5ca5-4ebe-94fe-cf9b0718ed36/code.php) | [Settings](src/9042fac6-5ca5-4ebe-94fe-cf9b0718ed36/settings.json) | Super__9042fac6_5ca5_4ebe_94fe_cf9b0718ed36__Power
- **final class Search** | [Details](src/2e764839-8ec6-4726-af50-b5678e0714a4) | [Code](src/2e764839-8ec6-4726-af50-b5678e0714a4/code.php) | [Settings](src/2e764839-8ec6-4726-af50-b5678e0714a4/settings.json) | Super__2e764839_8ec6_4726_af50_b5678e0714a4__Power
@ -195,6 +197,11 @@ This repository contains an index (see below) of all the approved powers within
- **final class Layout** | [Details](src/a0f032db-2242-41df-8e4a-5e9e6f88201d) | [Code](src/a0f032db-2242-41df-8e4a-5e9e6f88201d/code.php) | [Settings](src/a0f032db-2242-41df-8e4a-5e9e6f88201d/settings.json) | Super__a0f032db_2242_41df_8e4a_5e9e6f88201d__Power
- **final class Permission** | [Details](src/7f01622a-74c9-4e67-b111-3eb488035206) | [Code](src/7f01622a-74c9-4e67-b111-3eb488035206/code.php) | [Settings](src/7f01622a-74c9-4e67-b111-3eb488035206/settings.json) | Super__7f01622a_74c9_4e67_b111_3eb488035206__Power
- **final class Request** | [Details](src/cfdf0968-f394-4459-933c-ad1674fb1041) | [Code](src/cfdf0968-f394-4459-933c-ad1674fb1041/code.php) | [Settings](src/cfdf0968-f394-4459-933c-ad1674fb1041/settings.json) | Super__cfdf0968_f394_4459_933c_ad1674fb1041__Power
- **final class Router** | [Details](src/1294a7c7-46fb-4527-a69d-f8db830fd39a) | [Code](src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.php) | [Settings](src/1294a7c7-46fb-4527-a69d-f8db830fd39a/settings.json) | Super__1294a7c7_46fb_4527_a69d_f8db830fd39a__Power
- **final class RouterConstructorDefault** | [Details](src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f) | [Code](src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.php) | [Settings](src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/settings.json) | Super__e5278bf3_6dfb_42a0_b699_148b5ab8e45f__Power
- **final class RouterConstructorManual** | [Details](src/ec7bdbf9-8377-446e-9f40-64e23ae96b59) | [Code](src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.php) | [Settings](src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/settings.json) | Super__ec7bdbf9_8377_446e_9f40_64e23ae96b59__Power
- **final class RouterMethodsDefault** | [Details](src/17c590ed-8a44-485c-9be8-9a144a6b7429) | [Code](src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.php) | [Settings](src/17c590ed-8a44-485c-9be8-9a144a6b7429/settings.json) | Super__17c590ed_8a44_485c_9be8_9a144a6b7429__Power
- **final class RouterMethodsManual** | [Details](src/6034587d-82a3-4b19-ac58-40507f79122a) | [Code](src/6034587d-82a3-4b19-ac58-40507f79122a/code.php) | [Settings](src/6034587d-82a3-4b19-ac58-40507f79122a/settings.json) | Super__6034587d_82a3_4b19_ac58_40507f79122a__Power
- **final class SiteFieldData** | [Details](src/15b4addf-bf6b-4691-9c92-858c7de9c2c1) | [Code](src/15b4addf-bf6b-4691-9c92-858c7de9c2c1/code.php) | [Settings](src/15b4addf-bf6b-4691-9c92-858c7de9c2c1/settings.json) | Super__15b4addf_bf6b_4691_9c92_858c7de9c2c1__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Customcode](#vdm-joomla-componentbuilder-compiler-customcode)
@ -232,16 +239,21 @@ This repository contains an index (see below) of all the approved powers within
- **interface LanguageInterface** | [Details](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83) | [Code](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/code.php) | [Settings](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/settings.json) | Super__d6592c9b_93a6_41b3_83c7_c43a0a80cb83__Power
- **interface PlaceholderInterface** | [Details](src/a6cdd935-c038-4a54-8446-54bed87f003c) | [Code](src/a6cdd935-c038-4a54-8446-54bed87f003c/code.php) | [Settings](src/a6cdd935-c038-4a54-8446-54bed87f003c/settings.json) | Super__a6cdd935_c038_4a54_8446_54bed87f003c__Power
- **interface PowerInterface** | [Details](src/1133c2d7-ba7e-4c95-8cde-01f084d04682) | [Code](src/1133c2d7-ba7e-4c95-8cde-01f084d04682/code.php) | [Settings](src/1133c2d7-ba7e-4c95-8cde-01f084d04682/settings.json) | Super__1133c2d7_ba7e_4c95_8cde_01f084d04682__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaFive](#vdm-joomla-componentbuilder-compiler-joomlafive)
- **final class Header** | [Details](src/95deb809-5f43-400b-939f-f9ceef720b13) | [Code](src/95deb809-5f43-400b-939f-f9ceef720b13/code.php) | [Settings](src/95deb809-5f43-400b-939f-f9ceef720b13/settings.json) | Super__95deb809_5f43_400b_939f_f9ceef720b13__Power
- **final class History** | [Details](src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f) | [Code](src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.php) | [Settings](src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/settings.json) | Super__8ab6fe75_ba5a_4316_9ef8_1eccceec813f__Power
- **class Event** | [Details](src/77224dc6-8024-47eb-896e-18ec3aa23420) | [Code](src/77224dc6-8024-47eb-896e-18ec3aa23420/code.php) | [Settings](src/77224dc6-8024-47eb-896e-18ec3aa23420/settings.json) | Super__77224dc6_8024_47eb_896e_18ec3aa23420__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaFour](#vdm-joomla-componentbuilder-compiler-joomlafour)
- **final class Event** | [Details](src/4729c2b0-f12b-4397-8d77-055d38bca98b) | [Code](src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php) | [Settings](src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json) | Super__4729c2b0_f12b_4397_8d77_055d38bca98b__Power
- **final class Header** | [Details](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49) | [Code](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php) | [Settings](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json) | Super__1ee227b9_da0f_4e7b_ae66_99a9d53f6f49__Power
- **class Event** | [Details](src/4729c2b0-f12b-4397-8d77-055d38bca98b) | [Code](src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php) | [Settings](src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json) | Super__4729c2b0_f12b_4397_8d77_055d38bca98b__Power
- **class History** | [Details](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba) | [Code](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php) | [Settings](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json) | Super__25c7ca86_6088_4f5f_b9fe_13504779c6ba__Power
- **final class History** | [Details](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba) | [Code](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php) | [Settings](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json) | Super__25c7ca86_6088_4f5f_b9fe_13504779c6ba__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaThree](#vdm-joomla-componentbuilder-compiler-joomlathree)
- **final class Event** | [Details](src/4b86f62e-ce41-4325-a11a-08148807d0df) | [Code](src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php) | [Settings](src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json) | Super__4b86f62e_ce41_4325_a11a_08148807d0df__Power
- **final class Header** | [Details](src/7b56a097-9979-477b-b18a-c9dfc2f1e13b) | [Code](src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php) | [Settings](src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json) | Super__7b56a097_9979_477b_b18a_c9dfc2f1e13b__Power
- **class Event** | [Details](src/4b86f62e-ce41-4325-a11a-08148807d0df) | [Code](src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php) | [Settings](src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json) | Super__4b86f62e_ce41_4325_a11a_08148807d0df__Power
- **class History** | [Details](src/87db51b9-1126-4c21-858b-53dbd3a68b61) | [Code](src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php) | [Settings](src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json) | Super__87db51b9_1126_4c21_858b_53dbd3a68b61__Power
- **final class History** | [Details](src/87db51b9-1126-4c21-858b-53dbd3a68b61) | [Code](src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php) | [Settings](src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json) | Super__87db51b9_1126_4c21_858b_53dbd3a68b61__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Joomlamodule](#vdm-joomla-componentbuilder-compiler-joomlamodule)
- **class Data** | [Details](src/cb11e8d9-69c2-4095-831c-59908ea402e7) | [Code](src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php) | [Settings](src/cb11e8d9-69c2-4095-831c-59908ea402e7/settings.json) | Super__cb11e8d9_69c2_4095_831c_59908ea402e7__Power
@ -271,7 +283,6 @@ This repository contains an index (see below) of all the approved powers within
- **class Customalias** | [Details](src/5f8e8fa6-3793-44af-882d-9cfb209434e9) | [Code](src/5f8e8fa6-3793-44af-882d-9cfb209434e9/code.php) | [Settings](src/5f8e8fa6-3793-44af-882d-9cfb209434e9/settings.json) | Super__5f8e8fa6_3793_44af_882d_9cfb209434e9__Power
- **class Custombuttons** | [Details](src/ebe3287d-bfa0-4519-b663-f442f4dea432) | [Code](src/ebe3287d-bfa0-4519-b663-f442f4dea432/code.php) | [Settings](src/ebe3287d-bfa0-4519-b663-f442f4dea432/settings.json) | Super__ebe3287d_bfa0_4519_b663_f442f4dea432__Power
- **class Customimportscripts** | [Details](src/037c7274-fb16-455d-989a-bf1da022620b) | [Code](src/037c7274-fb16-455d-989a-bf1da022620b/code.php) | [Settings](src/037c7274-fb16-455d-989a-bf1da022620b/settings.json) | Super__037c7274_fb16_455d_989a_bf1da022620b__Power
- **class Customtabs** | [Details](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c) | [Code](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php) | [Settings](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json) | Super__fa8c1125_d370_4cb6_a7ff_eb32193c198c__Power
- **class Dynamicget** | [Details](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6) | [Code](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/code.php) | [Settings](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/settings.json) | Super__79740ee8_4d10_4b51_9ff5_18e1386ec1c6__Power
- **class Fields** | [Details](src/e6a64c41-405e-4bbc-9722-27402c22bbea) | [Code](src/e6a64c41-405e-4bbc-9722-27402c22bbea/code.php) | [Settings](src/e6a64c41-405e-4bbc-9722-27402c22bbea/settings.json) | Super__e6a64c41_405e_4bbc_9722_27402c22bbea__Power
- **class Filesfolders** | [Details](src/f4578c04-a81e-4218-b80d-b0612196eaf0) | [Code](src/f4578c04-a81e-4218-b80d-b0612196eaf0/code.php) | [Settings](src/f4578c04-a81e-4218-b80d-b0612196eaf0/settings.json) | Super__f4578c04_a81e_4218_b80d_b0612196eaf0__Power
@ -290,6 +301,7 @@ This repository contains an index (see below) of all the approved powers within
- **class Phpadminview** | [Details](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe) | [Code](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/code.php) | [Settings](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/settings.json) | Super__c20a63e0_0eeb_4424_9d08_b1bf0f049dfe__Power
- **class Phpcustomview** | [Details](src/489da602-27c7-418c-bf59-1d45ad42bdcc) | [Code](src/489da602-27c7-418c-bf59-1d45ad42bdcc/code.php) | [Settings](src/489da602-27c7-418c-bf59-1d45ad42bdcc/settings.json) | Super__489da602_27c7_418c_bf59_1d45ad42bdcc__Power
- **class Relations** | [Details](src/a8eb2fb1-88ed-4af8-842d-898eb915b588) | [Code](src/a8eb2fb1-88ed-4af8-842d-898eb915b588/code.php) | [Settings](src/a8eb2fb1-88ed-4af8-842d-898eb915b588/settings.json) | Super__a8eb2fb1_88ed_4af8_842d_898eb915b588__Power
- **class Router** | [Details](src/402239e6-ceec-4ee0-af62-22d462417bf6) | [Code](src/402239e6-ceec-4ee0-af62-22d462417bf6/code.php) | [Settings](src/402239e6-ceec-4ee0-af62-22d462417bf6/settings.json) | Super__402239e6_ceec_4ee0_af62_22d462417bf6__Power
- **class Siteviews** | [Details](src/e0075978-315d-4807-8507-ce9c6922a885) | [Code](src/e0075978-315d-4807-8507-ce9c6922a885/code.php) | [Settings](src/e0075978-315d-4807-8507-ce9c6922a885/settings.json) | Super__e0075978_315d_4807_8507_ce9c6922a885__Power
- **class Sql** | [Details](src/d4b418a7-bf9b-4768-969d-e07c36916fd2) | [Code](src/d4b418a7-bf9b-4768-969d-e07c36916fd2/code.php) | [Settings](src/d4b418a7-bf9b-4768-969d-e07c36916fd2/settings.json) | Super__d4b418a7_bf9b_4768_969d_e07c36916fd2__Power
- **class Sqldump** | [Details](src/a6e1227c-1efe-407d-84ef-03c6989a6a88) | [Code](src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php) | [Settings](src/a6e1227c-1efe-407d-84ef-03c6989a6a88/settings.json) | Super__a6e1227c_1efe_407d_84ef_03c6989a6a88__Power
@ -315,7 +327,8 @@ This repository contains an index (see below) of all the approved powers within
- **class Adminview** | [Details](src/2dd1289a-4000-43cc-8c62-77ff32de56bf) | [Code](src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.php) | [Settings](src/2dd1289a-4000-43cc-8c62-77ff32de56bf/settings.json) | Super__2dd1289a_4000_43cc_8c62_77ff32de56bf__Power
- **class ArchitectureController** | [Details](src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60) | [Code](src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php) | [Settings](src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json) | Super__56ba30f5_a5c4_4c4c_be6f_a56f7f9cbc60__Power
- **class ArchitectureModel** | [Details](src/bbd36fbf-d905-47e8-8e67-9ea6ec734712) | [Code](src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php) | [Settings](src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json) | Super__bbd36fbf_d905_47e8_8e67_9ea6ec734712__Power
- **class Builder** | [Details](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7) | [Code](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php) | [Settings](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json) | Super__2c76c06e_a371_4b73_9fbe_b4d9b4df55d7__Power
- **class BuilderAJ** | [Details](src/c7230c8c-ea88-4d8d-8c53-6136133195b7) | [Code](src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.php) | [Settings](src/c7230c8c-ea88-4d8d-8c53-6136133195b7/settings.json) | Super__c7230c8c_ea88_4d8d_8c53_6136133195b7__Power
- **class BuilderLZ** | [Details](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7) | [Code](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php) | [Settings](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json) | Super__2c76c06e_a371_4b73_9fbe_b4d9b4df55d7__Power
- **class Compiler** | [Details](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69) | [Code](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/code.php) | [Settings](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/settings.json) | Super__ea5ed06e_72ae_4906_9167_1cc0fa32fe69__Power
- **class Component** | [Details](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c) | [Code](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php) | [Settings](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json) | Super__8a63e87b_b39b_4a15_8044_9b2a2f4fb61c__Power
- **class Creator** | [Details](src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b) | [Code](src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php) | [Settings](src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json) | Super__8fdd604f_53e7_4a91_9935_afcfd2f6ac1b__Power
@ -378,6 +391,9 @@ This repository contains an index (see below) of all the approved powers within
- **class Generator** | [Details](src/a7101bbc-3c81-4b52-a4aa-522291f7594b) | [Code](src/a7101bbc-3c81-4b52-a4aa-522291f7594b/code.php) | [Settings](src/a7101bbc-3c81-4b52-a4aa-522291f7594b/settings.json) | Super__a7101bbc_3c81_4b52_a4aa_522291f7594b__Power
- **class Gitea** | [Details](src/510dc0f6-da3f-4a78-b43d-3a03e2cb5fae) | [Code](src/510dc0f6-da3f-4a78-b43d-3a03e2cb5fae/code.php) | [Settings](src/510dc0f6-da3f-4a78-b43d-3a03e2cb5fae/settings.json) | Super__510dc0f6_da3f_4a78_b43d_3a03e2cb5fae__Power
- **class Power** | [Details](src/02bc072b-1e89-46c1-9732-4da77b1a9ac9) | [Code](src/02bc072b-1e89-46c1-9732-4da77b1a9ac9/code.php) | [Settings](src/02bc072b-1e89-46c1-9732-4da77b1a9ac9/settings.json) | Super__02bc072b_1e89_46c1_9732_4da77b1a9ac9__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFive](#vdm-joomla-componentbuilder-compiler-component-joomlafive)
- **final class Settings** | [Details](src/69d2b980-a665-48cd-96f8-757bf3810b41) | [Code](src/69d2b980-a665-48cd-96f8-757bf3810b41/code.php) | [Settings](src/69d2b980-a665-48cd-96f8-757bf3810b41/settings.json) | Super__69d2b980_a665_48cd_96f8_757bf3810b41__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour](#vdm-joomla-componentbuilder-compiler-component-joomlafour)
- **final class Settings** | [Details](src/e7fff971-b031-42bf-8009-ef554e30854d) | [Code](src/e7fff971-b031-42bf-8009-ef554e30854d/code.php) | [Settings](src/e7fff971-b031-42bf-8009-ef554e30854d/settings.json) | Super__e7fff971_b031_42bf_8009_ef554e30854d__Power
@ -387,22 +403,30 @@ This repository contains an index (see below) of all the approved powers within
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor](#vdm-joomla-componentbuilder-compiler-customcode-extractor)
- **class Paths** | [Details](src/053803e6-1251-4aed-aefe-46a8e84198d2) | [Code](src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php) | [Settings](src/053803e6-1251-4aed-aefe-46a8e84198d2/settings.json) | Super__053803e6_1251_4aed_aefe_46a8e84198d2__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFive](#vdm-joomla-componentbuilder-compiler-extension-joomlafive)
- **final class InstallScript** | [Details](src/73183d13-9b2e-4879-b05a-52298d5b31f7) | [Code](src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.php) | [Settings](src/73183d13-9b2e-4879-b05a-52298d5b31f7/settings.json) | Super__73183d13_9b2e_4879_b05a_52298d5b31f7__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour](#vdm-joomla-componentbuilder-compiler-extension-joomlafour)
- **class InstallScript** | [Details](src/d42e1fac-3c05-4a22-8878-2abd43019811) | [Code](src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php) | [Settings](src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json) | Super__d42e1fac_3c05_4a22_8878_2abd43019811__Power
- **final class InstallScript** | [Details](src/d42e1fac-3c05-4a22-8878-2abd43019811) | [Code](src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php) | [Settings](src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json) | Super__d42e1fac_3c05_4a22_8878_2abd43019811__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree](#vdm-joomla-componentbuilder-compiler-extension-joomlathree)
- **class InstallScript** | [Details](src/1d929017-a5de-4e0f-9b5a-838934857e26) | [Code](src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php) | [Settings](src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json) | Super__1d929017_a5de_4e0f_9b5a_838934857e26__Power
- **final class InstallScript** | [Details](src/1d929017-a5de-4e0f-9b5a-838934857e26) | [Code](src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php) | [Settings](src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json) | Super__1d929017_a5de_4e0f_9b5a_838934857e26__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive](#vdm-joomla-componentbuilder-compiler-field-joomlafive)
- **final class CoreField** | [Details](src/4c143764-1b84-4b9f-86c5-8de119b26f1a) | [Code](src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.php) | [Settings](src/4c143764-1b84-4b9f-86c5-8de119b26f1a/settings.json) | Super__4c143764_1b84_4b9f_86c5_8de119b26f1a__Power
- **final class CoreRule** | [Details](src/8b56b62d-b960-4823-b9bb-c71675a71b85) | [Code](src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.php) | [Settings](src/8b56b62d-b960-4823-b9bb-c71675a71b85/settings.json) | Super__8b56b62d_b960_4823_b9bb_c71675a71b85__Power
- **final class InputButton** | [Details](src/163fa7ca-21bd-4e7f-a618-26fe10b870fe) | [Code](src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.php) | [Settings](src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/settings.json) | Super__163fa7ca_21bd_4e7f_a618_26fe10b870fe__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour](#vdm-joomla-componentbuilder-compiler-field-joomlafour)
- **final class CoreField** | [Details](src/c6818275-cdf7-4fce-a365-90d95a77a71c) | [Code](src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php) | [Settings](src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json) | Super__c6818275_cdf7_4fce_a365_90d95a77a71c__Power
- **final class CoreRule** | [Details](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb) | [Code](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php) | [Settings](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json) | Super__43f46bb2_ab6d_47c7_9fd9_f1745a3576fb__Power
- **final class InputButton** | [Details](src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe) | [Code](src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php) | [Settings](src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json) | Super__1b8a40e9_7847_4341_8a8e_dfdc2d531bbe__Power
- **class CoreField** | [Details](src/c6818275-cdf7-4fce-a365-90d95a77a71c) | [Code](src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php) | [Settings](src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json) | Super__c6818275_cdf7_4fce_a365_90d95a77a71c__Power
- **class CoreRule** | [Details](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb) | [Code](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php) | [Settings](src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json) | Super__43f46bb2_ab6d_47c7_9fd9_f1745a3576fb__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree](#vdm-joomla-componentbuilder-compiler-field-joomlathree)
- **final class CoreField** | [Details](src/e6683873-b74e-4b54-8466-69f8a9282033) | [Code](src/e6683873-b74e-4b54-8466-69f8a9282033/code.php) | [Settings](src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json) | Super__e6683873_b74e_4b54_8466_69f8a9282033__Power
- **final class CoreRule** | [Details](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957) | [Code](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php) | [Settings](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json) | Super__24da9672_e47f_4bb1_b6c0_0ebfc17f0957__Power
- **final class InputButton** | [Details](src/2bc33733-e900-4a9c-8cb3-c537aa9db785) | [Code](src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php) | [Settings](src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json) | Super__2bc33733_e900_4a9c_8cb3_c537aa9db785__Power
- **class CoreField** | [Details](src/e6683873-b74e-4b54-8466-69f8a9282033) | [Code](src/e6683873-b74e-4b54-8466-69f8a9282033/code.php) | [Settings](src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json) | Super__e6683873_b74e_4b54_8466_69f8a9282033__Power
- **class CoreRule** | [Details](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957) | [Code](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php) | [Settings](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json) | Super__24da9672_e47f_4bb1_b6c0_0ebfc17f0957__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component](#vdm-joomla-componentbuilder-compiler-interfaces-component)
- **interface PlaceholderInterface** | [Details](src/97698747-c2ce-4e09-a470-acf6d8e86281) | [Code](src/97698747-c2ce-4e09-a470-acf6d8e86281/code.php) | [Settings](src/97698747-c2ce-4e09-a470-acf6d8e86281/settings.json) | Super__97698747_c2ce_4e09_a470_acf6d8e86281__Power
@ -427,12 +451,32 @@ This repository contains an index (see below) of all the approved powers within
- **interface CoreFieldInterface** | [Details](src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900) | [Code](src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/code.php) | [Settings](src/e2f5fddf-cbc8-44ee-836c-7f3fb08d8900/settings.json) | Super__e2f5fddf_cbc8_44ee_836c_7f3fb08d8900__Power
- **interface CoreRuleInterface** | [Details](src/b9f05dc4-d23a-499a-a826-9749b81818ed) | [Code](src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php) | [Settings](src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json) | Super__b9f05dc4_d23a_499a_a826_9749b81818ed__Power
- **interface InputButtonInterface** | [Details](src/c600f58c-3fe2-4d2d-b711-2660eab6effe) | [Code](src/c600f58c-3fe2-4d2d-b711-2660eab6effe/code.php) | [Settings](src/c600f58c-3fe2-4d2d-b711-2660eab6effe/settings.json) | Super__c600f58c_3fe2_4d2d_b711_2660eab6effe__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model](#vdm-joomla-componentbuilder-compiler-interfaces-model)
- **interface CustomtabsInterface** | [Details](src/fcf42c53-0967-4c87-9699-a4d86adfdadf) | [Code](src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.php) | [Settings](src/fcf42c53-0967-4c87-9699-a4d86adfdadf/settings.json) | Super__fcf42c53_0967_4c87_9699_a4d86adfdadf__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive](#vdm-joomla-componentbuilder-compiler-model-joomlafive)
- **final class Customtabs** | [Details](src/92cc3144-1d3d-45b2-b49f-c7d356950033) | [Code](src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.php) | [Settings](src/92cc3144-1d3d-45b2-b49f-c7d356950033/settings.json) | Super__92cc3144_1d3d_45b2_b49f_c7d356950033__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour](#vdm-joomla-componentbuilder-compiler-model-joomlafour)
- **final class Customtabs** | [Details](src/42648fb4-dfdc-4986-a180-69e5726a25c4) | [Code](src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.php) | [Settings](src/42648fb4-dfdc-4986-a180-69e5726a25c4/settings.json) | Super__42648fb4_dfdc_4986_a180_69e5726a25c4__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree](#vdm-joomla-componentbuilder-compiler-model-joomlathree)
- **final class Customtabs** | [Details](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c) | [Code](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php) | [Settings](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json) | Super__fa8c1125_d370_4cb6_a7ff_eb32193c198c__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power\Repo](#vdm-joomla-componentbuilder-compiler-power-repo)
- **class Readme** | [Details](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5) | [Code](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/code.php) | [Settings](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/settings.json) | Super__efb1d0f8_2d14_4d2c_8b5f_4fcdd9df45a5__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power\Repos](#vdm-joomla-componentbuilder-compiler-power-repos)
- **class Readme** | [Details](src/0d08c583-04d5-454e-b756-48ca05e1651a) | [Code](src/0d08c583-04d5-454e-b756-48ca05e1651a/code.php) | [Settings](src/0d08c583-04d5-454e-b756-48ca05e1651a/settings.json) | Super__0d08c583_04d5_454e_b756_48ca05e1651a__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller](#vdm-joomla-componentbuilder-compiler-architecture-joomlafive-controller)
- **final class AllowAdd** | [Details](src/005fce79-1b62-4a93-8d5e-8c89fee1afc6) | [Code](src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.php) | [Settings](src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/settings.json) | Super__005fce79_1b62_4a93_8d5e_8c89fee1afc6__Power
- **final class AllowEdit** | [Details](src/e85175fd-e297-46df-a497-27f7a37190fd) | [Code](src/e85175fd-e297-46df-a497-27f7a37190fd/code.php) | [Settings](src/e85175fd-e297-46df-a497-27f7a37190fd/settings.json) | Super__e85175fd_e297_46df_a497_27f7a37190fd__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model](#vdm-joomla-componentbuilder-compiler-architecture-joomlafive-model)
- **final class CanDelete** | [Details](src/34df20ec-67db-4e7e-be61-fb94d360c408) | [Code](src/34df20ec-67db-4e7e-be61-fb94d360c408/code.php) | [Settings](src/34df20ec-67db-4e7e-be61-fb94d360c408/settings.json) | Super__34df20ec_67db_4e7e_be61_fb94d360c408__Power
- **final class CanEditState** | [Details](src/318a98a3-bb6f-42cb-a000-352d4c848b51) | [Code](src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.php) | [Settings](src/318a98a3-bb6f-42cb-a000-352d4c848b51/settings.json) | Super__318a98a3_bb6f_42cb_a000_352d4c848b51__Power
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller](#vdm-joomla-componentbuilder-compiler-architecture-joomlafour-controller)
- **final class AllowAdd** | [Details](src/425b1107-933d-4436-87ac-63540ec101c5) | [Code](src/425b1107-933d-4436-87ac-63540ec101c5/code.php) | [Settings](src/425b1107-933d-4436-87ac-63540ec101c5/settings.json) | Super__425b1107_933d_4436_87ac_63540ec101c5__Power

View File

@ -0,0 +1,52 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class AllowAdd (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller**
```uml
@startuml
class AllowAdd << (F,LightGreen) >> #RoyalBlue {
# String $component
# Permission $permission
# Dispenser $dispenser
+ __construct(Config $config, Permission $permission, ...)
+ get(string $nameSingleCode) : string
}
note right of AllowAdd::__construct
Constructor.
since: 3.2.0
arguments:
Config $config
Permission $permission
Dispenser $dispenser
end note
note right of AllowAdd::get
Get Allow Add Function Code
since: 3.2.0
return: string
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,129 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
/**
* Controller Allow Add Class for Joomla 5
*
* @since 3.2.0
*/
final class AllowAdd implements AllowAddInterface
{
/**
* The Component code name.
*
* @var String
* @since 3.2.0
*/
protected String $component;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* The Dispenser Class.
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Permission $permission The Permission Class.
* @param Dispenser $dispenser The Dispenser Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Permission $permission,
Dispenser $dispenser)
{
$this->component = $config->component_code_name;
$this->permission = $permission;
$this->dispenser = $dispenser;
}
/**
* Get Allow Add Function Code
*
* @param string $nameSingleCode The single code name of the view.
*
* @since 3.2.0
* @return string The allow add method code
*/
public function get(string $nameSingleCode): string
{
$allow = [];
// prepare custom permission script
$custom_allow = $this->dispenser->get(
'php_allowadd', $nameSingleCode, '', null, true
);
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get user object.";
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
// check if the item has permissions.
if ($this->permission->globalExist($nameSingleCode, 'core.access'))
{
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Access check.";
$allow[] = Indent::_(2) . "\$access = \$user->authorise('"
. $this->permission->getGlobal($nameSingleCode, 'core.access')
. "', 'com_" . $this->component . "');";
$allow[] = Indent::_(2) . "if (!\$access)";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "return false;";
$allow[] = Indent::_(2) . "}";
}
// load custom permission script
$allow[] = $custom_allow;
// check if the item has permissions.
if ($this->permission->globalExist($nameSingleCode, 'core.create'))
{
// setup the default script
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2) . "return \$user->authorise('"
. $this->permission->getGlobal($nameSingleCode, 'core.create')
. "', \$this->option);";
}
else
{
// setup the default script
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2) . "return parent::allowAdd(\$data);";
}
return implode(PHP_EOL, $allow);
}
}

View File

@ -0,0 +1,98 @@
/**
* The Component code name.
*
* @var String
* @since 3.2.0
*/
protected String $component;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* The Dispenser Class.
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Permission $permission The Permission Class.
* @param Dispenser $dispenser The Dispenser Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Permission $permission,
Dispenser $dispenser)
{
$this->component = $config->component_code_name;
$this->permission = $permission;
$this->dispenser = $dispenser;
}
/**
* Get Allow Add Function Code
*
* @param string $nameSingleCode The single code name of the view.
*
* @since 3.2.0
* @return string The allow add method code
*/
public function get(string $nameSingleCode): string
{
$allow = [];
// prepare custom permission script
$custom_allow = $this->dispenser->get(
'php_allowadd', $nameSingleCode, '', null, true
);
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get user object.";
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
// check if the item has permissions.
if ($this->permission->globalExist($nameSingleCode, 'core.access'))
{
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Access check.";
$allow[] = Indent::_(2) . "\$access = \$user->authorise('"
. $this->permission->getGlobal($nameSingleCode, 'core.access')
. "', 'com_" . $this->component . "');";
$allow[] = Indent::_(2) . "if (!\$access)";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "return false;";
$allow[] = Indent::_(2) . "}";
}
// load custom permission script
$allow[] = $custom_allow;
// check if the item has permissions.
if ($this->permission->globalExist($nameSingleCode, 'core.create'))
{
// setup the default script
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2) . "return \$user->authorise('"
. $this->permission->getGlobal($nameSingleCode, 'core.create')
. "', \$this->option);";
}
else
{
// setup the default script
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2) . "return parent::allowAdd(\$data);";
}
return implode(PHP_EOL, $allow);
}

View File

@ -0,0 +1,41 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "005fce79-1b62-4a93-8d5e-8c89fee1afc6",
"implements": [
"c9700450-4f44-4455-bc86-6a7660daadee"
],
"load_selection": null,
"name": "AllowAdd",
"power_version": "1.0.0",
"system_name": "JCB.Architecture.J5.Controller.AllowAdd",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection1": {
"use": "7f01622a-74c9-4e67-b111-3eb488035206",
"as": "default"
},
"use_selection2": {
"use": "f1dc6430-fb54-452e-aa53-ce32ae93db88",
"as": "default"
},
"use_selection3": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection4": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFive.Controller.AllowAdd",
"description": "Controller Allow Add Class for Joomla 5\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -15,13 +15,13 @@ class Infusion #Gold {
# Power $power
# Content $content
# Contents $contents
# Autoloader $autoloader
# Parser $parser
# RepoReadme $reporeadme
# ReposReadme $reposreadme
# Placeholder $placeholder
# Event $event
# array $linker
# array $done
+ __construct(Config $config, Power $power, ...)
+ set() : void
- parsePowers() : void
@ -45,7 +45,6 @@ note right of Infusion::__construct
Power $power
Content $content
Contents $contents
Autoloader $autoloader
Parser $parser
RepoReadme $reporeadme
ReposReadme $reposreadme

View File

@ -16,7 +16,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Power;
use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne as Content;
use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti as Contents;
use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader;
use VDM\Joomla\Componentbuilder\Compiler\Power\Parser;
use VDM\Joomla\Componentbuilder\Compiler\Power\Repo\Readme as RepoReadme;
use VDM\Joomla\Componentbuilder\Compiler\Power\Repos\Readme as ReposReadme;
@ -65,14 +64,6 @@ class Infusion
*/
protected Contents $contents;
/**
* The Autoloader Class.
*
* @var Autoloader
* @since 3.2.0
*/
protected Autoloader $autoloader;
/**
* The Parser Class.
*
@ -140,6 +131,30 @@ class Infusion
'unchanged_licensing_template' => 'licensing_template'
];
/**
* Power Infusion Tracker
*
* @var array
* @since 3.2.0
**/
protected array $done = [];
/**
* Power Content Infusion Tracker
*
* @var array
* @since 3.2.0
**/
protected array $content_done = [];
/**
* Path Infusion Tracker
*
* @var array
* @since 3.2.0
**/
protected array $path_done = [];
/**
* Constructor.
*
@ -147,7 +162,6 @@ class Infusion
* @param Power $power The Power Class.
* @param Content $content The ContentOne Class.
* @param Contents $contents The ContentMulti Class.
* @param Autoloader $autoloader The Autoloader Class.
* @param Parser $parser The Parser Class.
* @param RepoReadme $reporeadme The Readme Class.
* @param ReposReadme $reposreadme The Readme Class.
@ -157,8 +171,7 @@ class Infusion
* @since 3.2.0
*/
public function __construct(Config $config, Power $power, Content $content,
Contents $contents, Autoloader $autoloader,
Parser $parser, RepoReadme $reporeadme,
Contents $contents, Parser $parser, RepoReadme $reporeadme,
ReposReadme $reposreadme, Placeholder $placeholder,
Event $event)
{
@ -166,7 +179,6 @@ class Infusion
$this->power = $power;
$this->content = $content;
$this->contents = $contents;
$this->autoloader = $autoloader;
$this->parser = $parser;
$this->reporeadme = $reporeadme;
$this->reposreadme = $reposreadme;
@ -203,8 +215,13 @@ class Infusion
// we only do this if super powers are active
if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers))
{
foreach ($this->power->active as $n => &$power)
foreach ($this->power->active as $guid => &$power)
{
if (isset($this->done[$guid]))
{
continue;
}
if (ObjectHelper::check($power) && isset($power->main_class_code) &&
StringHelper::check($power->main_class_code))
{
@ -215,6 +232,9 @@ class Infusion
$power->parsed_class_code = $this->parser->code($power->main_class_code);
}
}
// do each power just once
$this->done[$guid] = true;
}
}
}
@ -232,6 +252,11 @@ class Infusion
{
foreach ($this->power->superpowers as $path => $powers)
{
if (isset($this->path_done[$path]))
{
continue;
}
$key = StringHelper::safe($path);
// Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails
@ -258,6 +283,9 @@ class Infusion
$this->event->trigger(
'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers]
);
// do each path just once
$this->path_done[$path] = true;
}
}
}
@ -301,8 +329,13 @@ class Infusion
// infuse powers data if set
if (ArrayHelper::check($this->power->active))
{
foreach ($this->power->active as $power)
foreach ($this->power->active as $guid => $power)
{
if (isset($this->content_done[$guid]))
{
continue;
}
if (ObjectHelper::check($power))
{
// Trigger Event: jcb_ce_onBeforeInfusePowerData
@ -327,10 +360,10 @@ class Infusion
'jcb_ce_onAfterInfusePowerData', [&$power]
);
}
}
// now set the power autoloader
$this->autoloader->set();
// do each power just once
$this->content_done[$guid] = true;
}
}
}

View File

@ -30,14 +30,6 @@
*/
protected Contents $contents;
/**
* The Autoloader Class.
*
* @var Autoloader
* @since 3.2.0
*/
protected Autoloader $autoloader;
/**
* The Parser Class.
*
@ -105,6 +97,30 @@
'unchanged_licensing_template' => 'licensing_template'
];
/**
* Power Infusion Tracker
*
* @var array
* @since 3.2.0
**/
protected array $done = [];
/**
* Power Content Infusion Tracker
*
* @var array
* @since 3.2.0
**/
protected array $content_done = [];
/**
* Path Infusion Tracker
*
* @var array
* @since 3.2.0
**/
protected array $path_done = [];
/**
* Constructor.
*
@ -112,7 +128,6 @@
* @param Power $power The Power Class.
* @param Content $content The ContentOne Class.
* @param Contents $contents The ContentMulti Class.
* @param Autoloader $autoloader The Autoloader Class.
* @param Parser $parser The Parser Class.
* @param RepoReadme $reporeadme The Readme Class.
* @param ReposReadme $reposreadme The Readme Class.
@ -122,8 +137,7 @@
* @since 3.2.0
*/
public function __construct(Config $config, Power $power, Content $content,
Contents $contents, Autoloader $autoloader,
Parser $parser, RepoReadme $reporeadme,
Contents $contents, Parser $parser, RepoReadme $reporeadme,
ReposReadme $reposreadme, Placeholder $placeholder,
Event $event)
{
@ -131,7 +145,6 @@
$this->power = $power;
$this->content = $content;
$this->contents = $contents;
$this->autoloader = $autoloader;
$this->parser = $parser;
$this->reporeadme = $reporeadme;
$this->reposreadme = $reposreadme;
@ -168,8 +181,13 @@
// we only do this if super powers are active
if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers))
{
foreach ($this->power->active as $n => &$power)
foreach ($this->power->active as $guid => &$power)
{
if (isset($this->done[$guid]))
{
continue;
}
if (ObjectHelper::check($power) && isset($power->main_class_code) &&
StringHelper::check($power->main_class_code))
{
@ -180,6 +198,9 @@
$power->parsed_class_code = $this->parser->code($power->main_class_code);
}
}
// do each power just once
$this->done[$guid] = true;
}
}
}
@ -197,6 +218,11 @@
{
foreach ($this->power->superpowers as $path => $powers)
{
if (isset($this->path_done[$path]))
{
continue;
}
$key = StringHelper::safe($path);
// Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails
@ -223,6 +249,9 @@
$this->event->trigger(
'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers]
);
// do each path just once
$this->path_done[$path] = true;
}
}
}
@ -266,8 +295,13 @@
// infuse powers data if set
if (ArrayHelper::check($this->power->active))
{
foreach ($this->power->active as $power)
foreach ($this->power->active as $guid => $power)
{
if (isset($this->content_done[$guid]))
{
continue;
}
if (ObjectHelper::check($power))
{
// Trigger Event: jcb_ce_onBeforeInfusePowerData
@ -292,10 +326,10 @@
'jcb_ce_onAfterInfusePowerData', [&$power]
);
}
}
// now set the power autoloader
$this->autoloader->set();
// do each power just once
$this->content_done[$guid] = true;
}
}
}

View File

@ -27,38 +27,34 @@
"as": "Contents"
},
"use_selection4": {
"use": "6e64917c-d687-4ef3-a655-811319f5a81e",
"as": "default"
},
"use_selection5": {
"use": "95d0e03f-24fd-4412-bc2e-f0899fcc3205",
"as": "default"
},
"use_selection6": {
"use_selection5": {
"use": "efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5",
"as": "RepoReadme"
},
"use_selection7": {
"use_selection6": {
"use": "0d08c583-04d5-454e-b756-48ca05e1651a",
"as": "ReposReadme"
},
"use_selection8": {
"use_selection7": {
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
"as": "default"
},
"use_selection9": {
"use_selection8": {
"use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d",
"as": "Event"
},
"use_selection10": {
"use_selection9": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection11": {
"use_selection10": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection12": {
"use_selection11": {
"use": "91004529-94a9-4590-b842-e7c6b624ecf5",
"as": "default"
}

View File

@ -441,6 +441,7 @@ final class FieldsetString implements Fieldsetinterface
$field_set[] = Indent::_(3) . 'description="' . $lang_view
. '_VERSION_DESC"';
$field_set[] = Indent::_(3) . 'size="6"';
$field_set[] = Indent::_(3) . 'default="1"';
$field_set[] = Indent::_(3) . 'readonly="true"';
$field_set[] = Indent::_(3) . 'filter="unset"';
$field_set[] = Indent::_(2) . "/>";

View File

@ -402,6 +402,7 @@
$field_set[] = Indent::_(3) . 'description="' . $lang_view
. '_VERSION_DESC"';
$field_set[] = Indent::_(3) . 'size="6"';
$field_set[] = Indent::_(3) . 'default="1"';
$field_set[] = Indent::_(3) . 'readonly="true"';
$field_set[] = Indent::_(3) . 'filter="unset"';
$field_set[] = Indent::_(2) . "/>";

View File

@ -11,46 +11,51 @@
```uml
@startuml
class Model #Gold {
# $targetVersion
+ register(Container $container) : void
+ getModelJoomlaplugins(Container $container) : Joomlaplugins
+ getModelJoomlamodules(Container $container) : Joomlamodules
+ getModelHistorycomponent(Container $container) : Historycomponent
+ getModelCustomadminviews(Container $container) : Customadminviews
+ getModelAjaxcustomview(Container $container) : Ajaxcustomview
+ getModelJavascriptcustomview(Container $container) : Javascriptcustomview
+ getModelCsscustomview(Container $container) : Csscustomview
+ getModelPhpcustomview(Container $container) : Phpcustomview
+ getModelDynamicget(Container $container) : Dynamicget
+ getModelLibraries(Container $container) : Libraries
+ getModelSiteviews(Container $container) : Siteviews
+ getModelPermissions(Container $container) : Permissions
+ getModelHistoryadminview(Container $container) : Historyadminview
+ getModelMysqlsettings(Container $container) : Mysqlsettings
+ getModelSql(Container $container) : Sql
+ getModelCustomalias(Container $container) : Customalias
+ getModelAjaxadmin(Container $container) : Ajaxadmin
+ getModelCustomimportscripts(Container $container) : Customimportscripts
+ getModelCustombuttons(Container $container) : Custombuttons
+ getModelLoader(Container $container) : Loader
+ getModelPhpadminview(Container $container) : Phpadminview
+ getModelCssadminview(Container $container) : Cssadminview
+ getModelJavascriptadminview(Container $container) : Javascriptadminview
+ getModelLinkedviews(Container $container) : Linkedviews
+ getModelRelations(Container $container) : Relations
+ getModelConditions(Container $container) : Conditions
+ getModelFields(Container $container) : Fields
+ getModelUpdatesql(Container $container) : Updatesql
+ getModelTabs(Container $container) : Tabs
+ getModelCustomtabs(Container $container) : Customtabs
+ getModelAdminviews(Container $container) : Adminviews
+ getModelSqltweaking(Container $container) : Sqltweaking
+ getModelSqldump(Container $container) : Sqldump
+ getModelWhmcs(Container $container) : Whmcs
+ getServerLoad(Container $container) : ServerLoad
+ getJoomlaplugins(Container $container) : Joomlaplugins
+ getJoomlamodules(Container $container) : Joomlamodules
+ getHistorycomponent(Container $container) : Historycomponent
+ getCustomadminviews(Container $container) : Customadminviews
+ getAjaxcustomview(Container $container) : Ajaxcustomview
+ getJavascriptcustomview(Container $container) : Javascriptcustomview
+ getCsscustomview(Container $container) : Csscustomview
+ getPhpcustomview(Container $container) : Phpcustomview
+ getDynamicget(Container $container) : Dynamicget
+ getLibraries(Container $container) : Libraries
+ getSiteviews(Container $container) : Siteviews
+ getPermissions(Container $container) : Permissions
+ getHistoryadminview(Container $container) : Historyadminview
+ getMysqlsettings(Container $container) : Mysqlsettings
+ getSql(Container $container) : Sql
+ getCustomalias(Container $container) : Customalias
+ getAjaxadmin(Container $container) : Ajaxadmin
+ getCustomimportscripts(Container $container) : Customimportscripts
+ getCustombuttons(Container $container) : Custombuttons
+ getLoader(Container $container) : Loader
+ getPhpadminview(Container $container) : Phpadminview
+ getCssadminview(Container $container) : Cssadminview
+ getJavascriptadminview(Container $container) : Javascriptadminview
+ getLinkedviews(Container $container) : Linkedviews
+ getRelations(Container $container) : Relations
+ getConditions(Container $container) : Conditions
+ getFields(Container $container) : Fields
+ getUpdatesql(Container $container) : Updatesql
+ getTabs(Container $container) : Tabs
+ getCustomtabs(Container $container) : Customtabs
+ getCustomtabsJ3(Container $container) : CustomtabsJ3
+ getCustomtabsJ4(Container $container) : CustomtabsJ4
+ getCustomtabsJ5(Container $container) : CustomtabsJ5
+ getAdminviews(Container $container) : Adminviews
+ getSqltweaking(Container $container) : Sqltweaking
+ getSqldump(Container $container) : Sqldump
+ getWhmcs(Container $container) : Whmcs
+ getFilesfolders(Container $container) : Filesfolders
+ getModifieddate(Container $container) : Modifieddate
+ getCreatedate(Container $container) : Createdate
+ getRouter(Container $container) : Router
+ getUpdateserver(Container $container) : Updateserver
+ getModelFilesfolders(Container $container) : Filesfolders
+ getServerLoad(Container $container) : ServerLoad
}
note right of Model::register
@ -60,277 +65,305 @@ note right of Model::register
return: void
end note
note left of Model::getModelJoomlaplugins
Get the Joomla plugins Model
note left of Model::getServerLoad
Get The Load Class.
since: 3.2.0
return: ServerLoad
end note
note right of Model::getJoomlaplugins
Get The Joomlaplugins Class.
since: 3.2.0
return: Joomlaplugins
end note
note right of Model::getModelJoomlamodules
Get the Joomla modules Model
note left of Model::getJoomlamodules
Get The Joomlamodules Class.
since: 3.2.0
return: Joomlamodules
end note
note left of Model::getModelHistorycomponent
Get the history component Model
note right of Model::getHistorycomponent
Get The Historycomponent Class.
since: 3.2.0
return: Historycomponent
end note
note right of Model::getModelCustomadminviews
Get the custom admin views Model
note left of Model::getCustomadminviews
Get The Customadminviews Class.
since: 3.2.0
return: Customadminviews
end note
note left of Model::getModelAjaxcustomview
Get the ajax custom view Model
note right of Model::getAjaxcustomview
Get The Ajaxcustomview Class.
since: 3.2.0
return: Ajaxcustomview
end note
note right of Model::getModelJavascriptcustomview
Get the javascript custom view Model
note left of Model::getJavascriptcustomview
Get The Javascriptcustomview Class.
since: 3.2.0
return: Javascriptcustomview
end note
note left of Model::getModelCsscustomview
Get the css custom view Model
note right of Model::getCsscustomview
Get The Csscustomview Class.
since: 3.2.0
return: Csscustomview
end note
note right of Model::getModelPhpcustomview
Get the php custom view Model
note left of Model::getPhpcustomview
Get The Phpcustomview Class.
since: 3.2.0
return: Phpcustomview
end note
note left of Model::getModelDynamicget
Get the dynamic get Model
note right of Model::getDynamicget
Get The Dynamicget Class.
since: 3.2.0
return: Dynamicget
end note
note right of Model::getModelLibraries
Get the libraries Model
note left of Model::getLibraries
Get The Libraries Class.
since: 3.2.0
return: Libraries
end note
note left of Model::getModelSiteviews
Get the site views Model
note right of Model::getSiteviews
Get The Siteviews Class.
since: 3.2.0
return: Siteviews
end note
note right of Model::getModelPermissions
Get the permissions Model
note left of Model::getPermissions
Get The Permissions Class.
since: 3.2.0
return: Permissions
end note
note left of Model::getModelHistoryadminview
Get the admin view history Model
note right of Model::getHistoryadminview
Get The Historyadminview Class.
since: 3.2.0
return: Historyadminview
end note
note right of Model::getModelMysqlsettings
Get the MySQL settings Model
note left of Model::getMysqlsettings
Get The Mysqlsettings Class.
since: 3.2.0
return: Mysqlsettings
end note
note left of Model::getModelSql
Get the Sql Model
note right of Model::getSql
Get The Sql Class.
since: 3.2.0
return: Sql
end note
note right of Model::getModelCustomalias
Get the custom alias Model
note left of Model::getCustomalias
Get The Customalias Class.
since: 3.2.0
return: Customalias
end note
note left of Model::getModelAjaxadmin
Get the Admin Ajax Model
note right of Model::getAjaxadmin
Get The Ajaxadmin Class.
since: 3.2.0
return: Ajaxadmin
end note
note right of Model::getModelCustomimportscripts
Get the custom import scripts Model
note left of Model::getCustomimportscripts
Get The Customimportscripts Class.
since: 3.2.0
return: Customimportscripts
end note
note left of Model::getModelCustombuttons
Get the custom import scripts Model
note right of Model::getCustombuttons
Get The Custombuttons Class.
since: 3.2.0
return: Custombuttons
end note
note right of Model::getModelLoader
Get The Model Loader Class.
note left of Model::getLoader
Get The Loader Class.
since: 3.2.0
return: Loader
end note
note left of Model::getModelPhpadminview
Get the php admin view Model
note right of Model::getPhpadminview
Get The Phpadminview Class.
since: 3.2.0
return: Phpadminview
end note
note right of Model::getModelCssadminview
Get the Css Adminview Model
note left of Model::getCssadminview
Get The Cssadminview Class.
since: 3.2.0
return: Cssadminview
end note
note left of Model::getModelJavascriptadminview
Get the Javascript Adminview Model
note right of Model::getJavascriptadminview
Get The Javascriptadminview Class.
since: 3.2.0
return: Javascriptadminview
end note
note right of Model::getModelLinkedviews
Get the linked views Model
note left of Model::getLinkedviews
Get The Linkedviews Class.
since: 3.2.0
return: Linkedviews
end note
note left of Model::getModelRelations
Get the relations Model
note right of Model::getRelations
Get The Relations Class.
since: 3.2.0
return: Relations
end note
note right of Model::getModelConditions
Get the conditions Model
note left of Model::getConditions
Get The Conditions Class.
since: 3.2.0
return: Conditions
end note
note left of Model::getModelFields
Get the fields Model
note right of Model::getFields
Get The Fields Class.
since: 3.2.0
return: Fields
end note
note right of Model::getModelUpdatesql
Get the update sql Model
note left of Model::getUpdatesql
Get The Updatesql Class.
since: 3.2.0
return: Updatesql
end note
note left of Model::getModelTabs
Get the tabs Model
note right of Model::getTabs
Get The Tabs Class.
since: 3.2.0
return: Tabs
end note
note right of Model::getModelCustomtabs
Get the custom tabs Model
note left of Model::getCustomtabs
Get The Customtabs Class.
since: 3.2.0
return: Customtabs
end note
note left of Model::getModelAdminviews
Get the admin views Model
note right of Model::getCustomtabsJ3
Get The CustomtabsJ3 Class.
since: 3.2.0
return: CustomtabsJ3
end note
note left of Model::getCustomtabsJ4
Get The CustomtabsJ4 Class.
since: 3.2.0
return: CustomtabsJ4
end note
note right of Model::getCustomtabsJ5
Get The CustomtabsJ5 Class.
since: 3.2.0
return: CustomtabsJ5
end note
note left of Model::getAdminviews
Get The Adminviews Class.
since: 3.2.0
return: Adminviews
end note
note right of Model::getModelSqltweaking
Get the SQL tweaking Model
note right of Model::getSqltweaking
Get The Sqltweaking Class.
since: 3.2.0
return: Sqltweaking
end note
note left of Model::getModelSqldump
Get the SQL dump Model
note left of Model::getSqldump
Get The Sqldump Class.
since: 3.2.0
return: Sqldump
end note
note right of Model::getModelWhmcs
Get the whmcs Model
note right of Model::getWhmcs
Get The Whmcs Class.
since: 3.2.0
return: Whmcs
end note
note left of Model::getModifieddate
Get the modified date Model
since: 3.2.0
return: Modifieddate
end note
note right of Model::getCreatedate
Get the create date Model
since: 3.2.0
return: Createdate
end note
note left of Model::getUpdateserver
Get the update server Model
since: 3.2.0
return: Updateserver
end note
note right of Model::getModelFilesfolders
Get the files folders Model
note left of Model::getFilesfolders
Get The Filesfolders Class.
since: 3.2.0
return: Filesfolders
end note
note left of Model::getServerLoad
Get the Server Model Server Loader class
note right of Model::getModifieddate
Get The Modifieddate Class.
since: 3.2.0
return: ServerLoad
return: Modifieddate
end note
note left of Model::getCreatedate
Get The Createdate Class.
since: 3.2.0
return: Createdate
end note
note right of Model::getRouter
Get The Router Class.
since: 3.2.0
return: Router
end note
note left of Model::getUpdateserver
Get The Updateserver Class.
since: 3.2.0
return: Updateserver
end note
@enduml

View File

@ -44,7 +44,10 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions;
use VDM\Joomla\Componentbuilder\Compiler\Model\Fields;
use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql;
use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs;
use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs;
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree\Customtabs as CustomtabsJ3;
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour\Customtabs as CustomtabsJ4;
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive\Customtabs as CustomtabsJ5;
use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking;
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump;
@ -52,6 +55,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs;
use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders;
use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate;
use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate;
use VDM\Joomla\Componentbuilder\Compiler\Model\Router;
use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver;
@ -62,6 +66,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver;
*/
class Model implements ServiceProviderInterface
{
/**
* Current Joomla Version Being Build
*
* @var int
* @since 3.2.0
**/
protected $targetVersion;
/**
* Registers the service provider with a DI container.
*
@ -72,107 +84,122 @@ class Model implements ServiceProviderInterface
*/
public function register(Container $container)
{
$container->alias(ServerLoad::class, 'Model.Server.Load')
->share('Model.Server.Load', [$this, 'getServerLoad'], true);
$container->alias(Joomlaplugins::class, 'Model.Joomlaplugins')
->share('Model.Joomlaplugins', [$this, 'getModelJoomlaplugins'], true);
->share('Model.Joomlaplugins', [$this, 'getJoomlaplugins'], true);
$container->alias(Joomlamodules::class, 'Model.Joomlamodules')
->share('Model.Joomlamodules', [$this, 'getModelJoomlamodules'], true);
->share('Model.Joomlamodules', [$this, 'getJoomlamodules'], true);
$container->alias(Historycomponent::class, 'Model.Historycomponent')
->share('Model.Historycomponent', [$this, 'getModelHistorycomponent'], true);
->share('Model.Historycomponent', [$this, 'getHistorycomponent'], true);
$container->alias(Customadminviews::class, 'Model.Customadminviews')
->share('Model.Customadminviews', [$this, 'getModelCustomadminviews'], true);
->share('Model.Customadminviews', [$this, 'getCustomadminviews'], true);
$container->alias(Ajaxcustomview::class, 'Model.Ajaxcustomview')
->share('Model.Ajaxcustomview', [$this, 'getModelAjaxcustomview'], true);
->share('Model.Ajaxcustomview', [$this, 'getAjaxcustomview'], true);
$container->alias(Javascriptcustomview::class, 'Model.Javascriptcustomview')
->share('Model.Javascriptcustomview', [$this, 'getModelJavascriptcustomview'], true);
->share('Model.Javascriptcustomview', [$this, 'getJavascriptcustomview'], true);
$container->alias(Csscustomview::class, 'Model.Csscustomview')
->share('Model.Csscustomview', [$this, 'getModelCsscustomview'], true);
->share('Model.Csscustomview', [$this, 'getCsscustomview'], true);
$container->alias(Phpcustomview::class, 'Model.Phpcustomview')
->share('Model.Phpcustomview', [$this, 'getModelPhpcustomview'], true);
->share('Model.Phpcustomview', [$this, 'getPhpcustomview'], true);
$container->alias(Dynamicget::class, 'Model.Dynamicget')
->share('Model.Dynamicget', [$this, 'getModelDynamicget'], true);
->share('Model.Dynamicget', [$this, 'getDynamicget'], true);
$container->alias(Libraries::class, 'Model.Libraries')
->share('Model.Libraries', [$this, 'getModelLibraries'], true);
->share('Model.Libraries', [$this, 'getLibraries'], true);
$container->alias(Siteviews::class, 'Model.Siteviews')
->share('Model.Siteviews', [$this, 'getModelSiteviews'], true);
->share('Model.Siteviews', [$this, 'getSiteviews'], true);
$container->alias(Permissions::class, 'Model.Permissions')
->share('Model.Permissions', [$this, 'getModelPermissions'], true);
->share('Model.Permissions', [$this, 'getPermissions'], true);
$container->alias(Historyadminview::class, 'Model.Historyadminview')
->share('Model.Historyadminview', [$this, 'getModelHistoryadminview'], true);
->share('Model.Historyadminview', [$this, 'getHistoryadminview'], true);
$container->alias(Mysqlsettings::class, 'Model.Mysqlsettings')
->share('Model.Mysqlsettings', [$this, 'getModelMysqlsettings'], true);
->share('Model.Mysqlsettings', [$this, 'getMysqlsettings'], true);
$container->alias(Sql::class, 'Model.Sql')
->share('Model.Sql', [$this, 'getModelSql'], true);
->share('Model.Sql', [$this, 'getSql'], true);
$container->alias(Customalias::class, 'Model.Customalias')
->share('Model.Customalias', [$this, 'getModelCustomalias'], true);
->share('Model.Customalias', [$this, 'getCustomalias'], true);
$container->alias(Ajaxadmin::class, 'Model.Ajaxadmin')
->share('Model.Ajaxadmin', [$this, 'getModelAjaxadmin'], true);
->share('Model.Ajaxadmin', [$this, 'getAjaxadmin'], true);
$container->alias(Customimportscripts::class, 'Model.Customimportscripts')
->share('Model.Customimportscripts', [$this, 'getModelCustomimportscripts'], true);
->share('Model.Customimportscripts', [$this, 'getCustomimportscripts'], true);
$container->alias(Custombuttons::class, 'Model.Custombuttons')
->share('Model.Custombuttons', [$this, 'getModelCustombuttons'], true);
->share('Model.Custombuttons', [$this, 'getCustombuttons'], true);
$container->alias(Loader::class, 'Model.Loader')
->share('Model.Loader', [$this, 'getModelLoader'], true);
->share('Model.Loader', [$this, 'getLoader'], true);
$container->alias(Phpadminview::class, 'Model.Phpadminview')
->share('Model.Phpadminview', [$this, 'getModelPhpadminview'], true);
->share('Model.Phpadminview', [$this, 'getPhpadminview'], true);
$container->alias(Cssadminview::class, 'Model.Cssadminview')
->share('Model.Cssadminview', [$this, 'getModelCssadminview'], true);
->share('Model.Cssadminview', [$this, 'getCssadminview'], true);
$container->alias(Javascriptadminview::class, 'Model.Javascriptadminview')
->share('Model.Javascriptadminview', [$this, 'getModelJavascriptadminview'], true);
->share('Model.Javascriptadminview', [$this, 'getJavascriptadminview'], true);
$container->alias(Linkedviews::class, 'Model.Linkedviews')
->share('Model.Linkedviews', [$this, 'getModelLinkedviews'], true);
->share('Model.Linkedviews', [$this, 'getLinkedviews'], true);
$container->alias(Relations::class, 'Model.Relations')
->share('Model.Relations', [$this, 'getModelRelations'], true);
->share('Model.Relations', [$this, 'getRelations'], true);
$container->alias(Conditions::class, 'Model.Conditions')
->share('Model.Conditions', [$this, 'getModelConditions'], true);
->share('Model.Conditions', [$this, 'getConditions'], true);
$container->alias(Fields::class, 'Model.Fields')
->share('Model.Fields', [$this, 'getModelFields'], true);
->share('Model.Fields', [$this, 'getFields'], true);
$container->alias(Updatesql::class, 'Model.Updatesql')
->share('Model.Updatesql', [$this, 'getModelUpdatesql'], true);
->share('Model.Updatesql', [$this, 'getUpdatesql'], true);
$container->alias(Tabs::class, 'Model.Tabs')
->share('Model.Tabs', [$this, 'getModelTabs'], true);
->share('Model.Tabs', [$this, 'getTabs'], true);
$container->alias(Customtabs::class, 'Model.Customtabs')
->share('Model.Customtabs', [$this, 'getModelCustomtabs'], true);
->share('Model.Customtabs', [$this, 'getCustomtabs'], true);
$container->alias(CustomtabsJ3::class, 'Model.J3.Customtabs')
->share('Model.J3.Customtabs', [$this, 'getCustomtabsJ3'], true);
$container->alias(CustomtabsJ4::class, 'Model.J4.Customtabs')
->share('Model.J4.Customtabs', [$this, 'getCustomtabsJ4'], true);
$container->alias(CustomtabsJ5::class, 'Model.J5.Customtabs')
->share('Model.J5.Customtabs', [$this, 'getCustomtabsJ5'], true);
$container->alias(Adminviews::class, 'Model.Adminviews')
->share('Model.Adminviews', [$this, 'getModelAdminviews'], true);
->share('Model.Adminviews', [$this, 'getAdminviews'], true);
$container->alias(Sqltweaking::class, 'Model.Sqltweaking')
->share('Model.Sqltweaking', [$this, 'getModelSqltweaking'], true);
->share('Model.Sqltweaking', [$this, 'getSqltweaking'], true);
$container->alias(Sqldump::class, 'Model.Sqldump')
->share('Model.Sqldump', [$this, 'getModelSqldump'], true);
->share('Model.Sqldump', [$this, 'getSqldump'], true);
$container->alias(Whmcs::class, 'Model.Whmcs')
->share('Model.Whmcs', [$this, 'getModelWhmcs'], true);
->share('Model.Whmcs', [$this, 'getWhmcs'], true);
$container->alias(Filesfolders::class, 'Model.Filesfolders')
->share('Model.Filesfolders', [$this, 'getFilesfolders'], true);
$container->alias(Modifieddate::class, 'Model.Modifieddate')
->share('Model.Modifieddate', [$this, 'getModifieddate'], true);
@ -180,25 +207,38 @@ class Model implements ServiceProviderInterface
$container->alias(Createdate::class, 'Model.Createdate')
->share('Model.Createdate', [$this, 'getCreatedate'], true);
$container->alias(Router::class, 'Model.Router')
->share('Model.Router', [$this, 'getRouter'], true);
$container->alias(Updateserver::class, 'Model.Updateserver')
->share('Model.Updateserver', [$this, 'getUpdateserver'], true);
$container->alias(Filesfolders::class, 'Model.Filesfolders')
->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true);
$container->alias(ServerLoad::class, 'Model.Server.Load')
->share('Model.Server.Load', [$this, 'getServerLoad'], true);
}
/**
* Get the Joomla plugins Model
* Get The Load Class.
*
* @param Container $container The DI container.
*
* @return ServerLoad
* @since 3.2.0
*/
public function getServerLoad(Container $container): ServerLoad
{
return new ServerLoad(
$container->get('Crypt'),
$container->get('Table')
);
}
/**
* Get The Joomlaplugins Class.
*
* @param Container $container The DI container.
*
* @return Joomlaplugins
* @since 3.2.0
*/
public function getModelJoomlaplugins(Container $container): Joomlaplugins
public function getJoomlaplugins(Container $container): Joomlaplugins
{
return new Joomlaplugins(
$container->get('Joomlaplugin.Data')
@ -206,14 +246,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the Joomla modules Model
* Get The Joomlamodules Class.
*
* @param Container $container The DI container.
*
* @return Joomlamodules
* @since 3.2.0
*/
public function getModelJoomlamodules(Container $container): Joomlamodules
public function getJoomlamodules(Container $container): Joomlamodules
{
return new Joomlamodules(
$container->get('Joomlamodule.Data')
@ -221,14 +261,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the history component Model
* Get The Historycomponent Class.
*
* @param Container $container The DI container.
*
* @return Historycomponent
* @since 3.2.0
*/
public function getModelHistorycomponent(Container $container): Historycomponent
public function getHistorycomponent(Container $container): Historycomponent
{
return new Historycomponent(
$container->get('Config'),
@ -238,14 +278,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the custom admin views Model
* Get The Customadminviews Class.
*
* @param Container $container The DI container.
*
* @return Customadminviews
* @since 3.2.0
*/
public function getModelCustomadminviews(Container $container): Customadminviews
public function getCustomadminviews(Container $container): Customadminviews
{
return new Customadminviews(
$container->get('Customview.Data'),
@ -254,14 +294,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the ajax custom view Model
* Get The Ajaxcustomview Class.
*
* @param Container $container The DI container.
*
* @return Ajaxcustomview
* @since 3.2.0
*/
public function getModelAjaxcustomview(Container $container): Ajaxcustomview
public function getAjaxcustomview(Container $container): Ajaxcustomview
{
return new Ajaxcustomview(
$container->get('Config'),
@ -270,14 +310,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the javascript custom view Model
* Get The Javascriptcustomview Class.
*
* @param Container $container The DI container.
*
* @return Javascriptcustomview
* @since 3.2.0
*/
public function getModelJavascriptcustomview(Container $container): Javascriptcustomview
public function getJavascriptcustomview(Container $container): Javascriptcustomview
{
return new Javascriptcustomview(
$container->get('Customcode'),
@ -286,14 +326,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the css custom view Model
* Get The Csscustomview Class.
*
* @param Container $container The DI container.
*
* @return Csscustomview
* @since 3.2.0
*/
public function getModelCsscustomview(Container $container): Csscustomview
public function getCsscustomview(Container $container): Csscustomview
{
return new Csscustomview(
$container->get('Customcode')
@ -301,14 +341,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the php custom view Model
* Get The Phpcustomview Class.
*
* @param Container $container The DI container.
*
* @return Phpcustomview
* @since 3.2.0
*/
public function getModelPhpcustomview(Container $container): Phpcustomview
public function getPhpcustomview(Container $container): Phpcustomview
{
return new Phpcustomview(
$container->get('Customcode'),
@ -319,14 +359,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the dynamic get Model
* Get The Dynamicget Class.
*
* @param Container $container The DI container.
*
* @return Dynamicget
* @since 3.2.0
*/
public function getModelDynamicget(Container $container): Dynamicget
public function getDynamicget(Container $container): Dynamicget
{
return new Dynamicget(
$container->get('Config'),
@ -340,14 +380,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the libraries Model
* Get The Libraries Class.
*
* @param Container $container The DI container.
*
* @return Libraries
* @since 3.2.0
*/
public function getModelLibraries(Container $container): Libraries
public function getLibraries(Container $container): Libraries
{
return new Libraries(
$container->get('Config'),
@ -357,14 +397,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the site views Model
* Get The Siteviews Class.
*
* @param Container $container The DI container.
*
* @return Siteviews
* @since 3.2.0
*/
public function getModelSiteviews(Container $container): Siteviews
public function getSiteviews(Container $container): Siteviews
{
return new Siteviews(
$container->get('Customview.Data'),
@ -373,27 +413,27 @@ class Model implements ServiceProviderInterface
}
/**
* Get the permissions Model
* Get The Permissions Class.
*
* @param Container $container The DI container.
*
* @return Permissions
* @since 3.2.0
*/
public function getModelPermissions(Container $container): Permissions
public function getPermissions(Container $container): Permissions
{
return new Permissions();
}
/**
* Get the admin view history Model
* Get The Historyadminview Class.
*
* @param Container $container The DI container.
*
* @return Historyadminview
* @since 3.2.0
*/
public function getModelHistoryadminview(Container $container): Historyadminview
public function getHistoryadminview(Container $container): Historyadminview
{
return new Historyadminview(
$container->get('Config'),
@ -403,14 +443,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the MySQL settings Model
* Get The Mysqlsettings Class.
*
* @param Container $container The DI container.
*
* @return Mysqlsettings
* @since 3.2.0
*/
public function getModelMysqlsettings(Container $container): Mysqlsettings
public function getMysqlsettings(Container $container): Mysqlsettings
{
return new Mysqlsettings(
$container->get('Config'),
@ -419,14 +459,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the Sql Model
* Get The Sql Class.
*
* @param Container $container The DI container.
*
* @return Sql
* @since 3.2.0
*/
public function getModelSql(Container $container): Sql
public function getSql(Container $container): Sql
{
return new Sql(
$container->get('Customcode.Dispenser'),
@ -435,14 +475,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the custom alias Model
* Get The Customalias Class.
*
* @param Container $container The DI container.
*
* @return Customalias
* @since 3.2.0
*/
public function getModelCustomalias(Container $container): Customalias
public function getCustomalias(Container $container): Customalias
{
return new Customalias(
$container->get('Compiler.Builder.Custom.Alias'),
@ -451,14 +491,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the Admin Ajax Model
* Get The Ajaxadmin Class.
*
* @param Container $container The DI container.
*
* @return Ajaxadmin
* @since 3.2.0
*/
public function getModelAjaxadmin(Container $container): Ajaxadmin
public function getAjaxadmin(Container $container): Ajaxadmin
{
return new Ajaxadmin(
$container->get('Config'),
@ -468,14 +508,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the custom import scripts Model
* Get The Customimportscripts Class.
*
* @param Container $container The DI container.
*
* @return Customimportscripts
* @since 3.2.0
*/
public function getModelCustomimportscripts(Container $container): Customimportscripts
public function getCustomimportscripts(Container $container): Customimportscripts
{
return new Customimportscripts(
$container->get('Customcode.Dispenser')
@ -483,14 +523,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the custom import scripts Model
* Get The Custombuttons Class.
*
* @param Container $container The DI container.
*
* @return Custombuttons
* @since 3.2.0
*/
public function getModelCustombuttons(Container $container): Custombuttons
public function getCustombuttons(Container $container): Custombuttons
{
return new Custombuttons(
$container->get('Customcode'),
@ -500,14 +540,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get The Model Loader Class.
* Get The Loader Class.
*
* @param Container $container The DI container.
*
* @return Loader
* @since 3.2.0
*/
public function getModelLoader(Container $container): Loader
public function getLoader(Container $container): Loader
{
return new Loader(
$container->get('Config'),
@ -519,14 +559,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the php admin view Model
* Get The Phpadminview Class.
*
* @param Container $container The DI container.
*
* @return Phpadminview
* @since 3.2.0
*/
public function getModelPhpadminview(Container $container): Phpadminview
public function getPhpadminview(Container $container): Phpadminview
{
return new Phpadminview(
$container->get('Customcode.Dispenser'),
@ -535,14 +575,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the Css Adminview Model
* Get The Cssadminview Class.
*
* @param Container $container The DI container.
*
* @return Cssadminview
* @since 3.2.0
*/
public function getModelCssadminview(Container $container): Cssadminview
public function getCssadminview(Container $container): Cssadminview
{
return new Cssadminview(
$container->get('Customcode.Dispenser')
@ -550,14 +590,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the Javascript Adminview Model
* Get The Javascriptadminview Class.
*
* @param Container $container The DI container.
*
* @return Javascriptadminview
* @since 3.2.0
*/
public function getModelJavascriptadminview(Container $container): Javascriptadminview
public function getJavascriptadminview(Container $container): Javascriptadminview
{
return new Javascriptadminview(
$container->get('Customcode.Dispenser')
@ -565,14 +605,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the linked views Model
* Get The Linkedviews Class.
*
* @param Container $container The DI container.
*
* @return Linkedviews
* @since 3.2.0
*/
public function getModelLinkedviews(Container $container): Linkedviews
public function getLinkedviews(Container $container): Linkedviews
{
return new Linkedviews(
$container->get('Registry')
@ -580,14 +620,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the relations Model
* Get The Relations Class.
*
* @param Container $container The DI container.
*
* @return Relations
* @since 3.2.0
*/
public function getModelRelations(Container $container): Relations
public function getRelations(Container $container): Relations
{
return new Relations(
$container->get('Config'),
@ -600,14 +640,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the conditions Model
* Get The Conditions Class.
*
* @param Container $container The DI container.
*
* @return Conditions
* @since 3.2.0
*/
public function getModelConditions(Container $container): Conditions
public function getConditions(Container $container): Conditions
{
return new Conditions(
$container->get('Field.Type.Name'),
@ -617,14 +657,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the fields Model
* Get The Fields Class.
*
* @param Container $container The DI container.
*
* @return Fields
* @since 3.2.0
*/
public function getModelFields(Container $container): Fields
public function getFields(Container $container): Fields
{
return new Fields(
$container->get('Config'),
@ -639,14 +679,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the update sql Model
* Get The Updatesql Class.
*
* @param Container $container The DI container.
*
* @return Updatesql
* @since 3.2.0
*/
public function getModelUpdatesql(Container $container): Updatesql
public function getUpdatesql(Container $container): Updatesql
{
return new Updatesql(
$container->get('Registry')
@ -654,29 +694,47 @@ class Model implements ServiceProviderInterface
}
/**
* Get the tabs Model
* Get The Tabs Class.
*
* @param Container $container The DI container.
*
* @return Updatesql
* @return Tabs
* @since 3.2.0
*/
public function getModelTabs(Container $container): Tabs
public function getTabs(Container $container): Tabs
{
return new Tabs();
}
/**
* Get the custom tabs Model
* Get The Customtabs Class.
*
* @param Container $container The DI container.
*
* @return Customtabs
* @since 3.2.0
*/
public function getModelCustomtabs(Container $container): Customtabs
public function getCustomtabs(Container $container): Customtabs
{
return new Customtabs(
if (empty($this->targetVersion))
{
$this->targetVersion = $container->get('Config')->joomla_version;
}
return $container->get('Model.J' . $this->targetVersion . '.Customtabs');
}
/**
* Get The CustomtabsJ3 Class.
*
* @param Container $container The DI container.
*
* @return CustomtabsJ3
* @since 3.2.0
*/
public function getCustomtabsJ3(Container $container): CustomtabsJ3
{
return new CustomtabsJ3(
$container->get('Config'),
$container->get('Compiler.Builder.Custom.Tabs'),
$container->get('Language'),
@ -686,14 +744,52 @@ class Model implements ServiceProviderInterface
}
/**
* Get the admin views Model
* Get The CustomtabsJ4 Class.
*
* @param Container $container The DI container.
*
* @return CustomtabsJ4
* @since 3.2.0
*/
public function getCustomtabsJ4(Container $container): CustomtabsJ4
{
return new CustomtabsJ4(
$container->get('Config'),
$container->get('Compiler.Builder.Custom.Tabs'),
$container->get('Language'),
$container->get('Placeholder'),
$container->get('Customcode')
);
}
/**
* Get The CustomtabsJ5 Class.
*
* @param Container $container The DI container.
*
* @return CustomtabsJ5
* @since 3.2.0
*/
public function getCustomtabsJ5(Container $container): CustomtabsJ5
{
return new CustomtabsJ5(
$container->get('Config'),
$container->get('Compiler.Builder.Custom.Tabs'),
$container->get('Language'),
$container->get('Placeholder'),
$container->get('Customcode')
);
}
/**
* Get The Adminviews Class.
*
* @param Container $container The DI container.
*
* @return Adminviews
* @since 3.2.0
*/
public function getModelAdminviews(Container $container): Adminviews
public function getAdminviews(Container $container): Adminviews
{
return new Adminviews(
$container->get('Config'),
@ -704,14 +800,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the SQL tweaking Model
* Get The Sqltweaking Class.
*
* @param Container $container The DI container.
*
* @return Sqltweaking
* @since 3.2.0
*/
public function getModelSqltweaking(Container $container): Sqltweaking
public function getSqltweaking(Container $container): Sqltweaking
{
return new Sqltweaking(
$container->get('Registry')
@ -719,14 +815,14 @@ class Model implements ServiceProviderInterface
}
/**
* Get the SQL dump Model
* Get The Sqldump Class.
*
* @param Container $container The DI container.
*
* @return Sqldump
* @since 3.2.0
*/
public function getModelSqldump(Container $container): Sqldump
public function getSqldump(Container $container): Sqldump
{
return new Sqldump(
$container->get('Registry')
@ -734,20 +830,33 @@ class Model implements ServiceProviderInterface
}
/**
* Get the whmcs Model
* Get The Whmcs Class.
*
* @param Container $container The DI container.
*
* @return Whmcs
* @since 3.2.0
*/
public function getModelWhmcs(Container $container): Whmcs
public function getWhmcs(Container $container): Whmcs
{
return new Whmcs();
}
/**
* Get the modified date Model
* Get The Filesfolders Class.
*
* @param Container $container The DI container.
*
* @return Filesfolders
* @since 3.2.0
*/
public function getFilesfolders(Container $container): Filesfolders
{
return new Filesfolders();
}
/**
* Get The Modifieddate Class.
*
* @param Container $container The DI container.
*
@ -760,7 +869,7 @@ class Model implements ServiceProviderInterface
}
/**
* Get the create date Model
* Get The Createdate Class.
*
* @param Container $container The DI container.
*
@ -773,7 +882,24 @@ class Model implements ServiceProviderInterface
}
/**
* Get the update server Model
* Get The Router Class.
*
* @param Container $container The DI container.
*
* @return Router
* @since 3.2.0
*/
public function getRouter(Container $container): Router
{
return new Router(
$container->get('Config'),
$container->get('Customcode.Dispenser'),
$container->get('Compiler.Builder.Router')
);
}
/**
* Get The Updateserver Class.
*
* @param Container $container The DI container.
*
@ -783,35 +909,6 @@ class Model implements ServiceProviderInterface
public function getUpdateserver(Container $container): Updateserver
{
return new Updateserver();
}
/**
* Get the files folders Model
*
* @param Container $container The DI container.
*
* @return Filesfolders
* @since 3.2.0
*/
public function getModelFilesfolders(Container $container): Filesfolders
{
return new Filesfolders();
}
/**
* Get the Server Model Server Loader class
*
* @param Container $container The DI container.
*
* @return ServerLoad
* @since 3.2.0
*/
public function getServerLoad(Container $container): ServerLoad
{
return new ServerLoad(
$container->get('Crypt'),
$container->get('Table')
);
}
}

View File

@ -1,3 +1,11 @@
/**
* Current Joomla Version Being Build
*
* @var int
* @since 3.2.0
**/
protected $targetVersion;
/**
* Registers the service provider with a DI container.
*
@ -8,107 +16,122 @@
*/
public function register(Container $container)
{
$container->alias(ServerLoad::class, 'Model.Server.Load')
->share('Model.Server.Load', [$this, 'getServerLoad'], true);
$container->alias(Joomlaplugins::class, 'Model.Joomlaplugins')
->share('Model.Joomlaplugins', [$this, 'getModelJoomlaplugins'], true);
->share('Model.Joomlaplugins', [$this, 'getJoomlaplugins'], true);
$container->alias(Joomlamodules::class, 'Model.Joomlamodules')
->share('Model.Joomlamodules', [$this, 'getModelJoomlamodules'], true);
->share('Model.Joomlamodules', [$this, 'getJoomlamodules'], true);
$container->alias(Historycomponent::class, 'Model.Historycomponent')
->share('Model.Historycomponent', [$this, 'getModelHistorycomponent'], true);
->share('Model.Historycomponent', [$this, 'getHistorycomponent'], true);
$container->alias(Customadminviews::class, 'Model.Customadminviews')
->share('Model.Customadminviews', [$this, 'getModelCustomadminviews'], true);
->share('Model.Customadminviews', [$this, 'getCustomadminviews'], true);
$container->alias(Ajaxcustomview::class, 'Model.Ajaxcustomview')
->share('Model.Ajaxcustomview', [$this, 'getModelAjaxcustomview'], true);
->share('Model.Ajaxcustomview', [$this, 'getAjaxcustomview'], true);
$container->alias(Javascriptcustomview::class, 'Model.Javascriptcustomview')
->share('Model.Javascriptcustomview', [$this, 'getModelJavascriptcustomview'], true);
->share('Model.Javascriptcustomview', [$this, 'getJavascriptcustomview'], true);
$container->alias(Csscustomview::class, 'Model.Csscustomview')
->share('Model.Csscustomview', [$this, 'getModelCsscustomview'], true);
->share('Model.Csscustomview', [$this, 'getCsscustomview'], true);
$container->alias(Phpcustomview::class, 'Model.Phpcustomview')
->share('Model.Phpcustomview', [$this, 'getModelPhpcustomview'], true);
->share('Model.Phpcustomview', [$this, 'getPhpcustomview'], true);
$container->alias(Dynamicget::class, 'Model.Dynamicget')
->share('Model.Dynamicget', [$this, 'getModelDynamicget'], true);
->share('Model.Dynamicget', [$this, 'getDynamicget'], true);
$container->alias(Libraries::class, 'Model.Libraries')
->share('Model.Libraries', [$this, 'getModelLibraries'], true);
->share('Model.Libraries', [$this, 'getLibraries'], true);
$container->alias(Siteviews::class, 'Model.Siteviews')
->share('Model.Siteviews', [$this, 'getModelSiteviews'], true);
->share('Model.Siteviews', [$this, 'getSiteviews'], true);
$container->alias(Permissions::class, 'Model.Permissions')
->share('Model.Permissions', [$this, 'getModelPermissions'], true);
->share('Model.Permissions', [$this, 'getPermissions'], true);
$container->alias(Historyadminview::class, 'Model.Historyadminview')
->share('Model.Historyadminview', [$this, 'getModelHistoryadminview'], true);
->share('Model.Historyadminview', [$this, 'getHistoryadminview'], true);
$container->alias(Mysqlsettings::class, 'Model.Mysqlsettings')
->share('Model.Mysqlsettings', [$this, 'getModelMysqlsettings'], true);
->share('Model.Mysqlsettings', [$this, 'getMysqlsettings'], true);
$container->alias(Sql::class, 'Model.Sql')
->share('Model.Sql', [$this, 'getModelSql'], true);
->share('Model.Sql', [$this, 'getSql'], true);
$container->alias(Customalias::class, 'Model.Customalias')
->share('Model.Customalias', [$this, 'getModelCustomalias'], true);
->share('Model.Customalias', [$this, 'getCustomalias'], true);
$container->alias(Ajaxadmin::class, 'Model.Ajaxadmin')
->share('Model.Ajaxadmin', [$this, 'getModelAjaxadmin'], true);
->share('Model.Ajaxadmin', [$this, 'getAjaxadmin'], true);
$container->alias(Customimportscripts::class, 'Model.Customimportscripts')
->share('Model.Customimportscripts', [$this, 'getModelCustomimportscripts'], true);
->share('Model.Customimportscripts', [$this, 'getCustomimportscripts'], true);
$container->alias(Custombuttons::class, 'Model.Custombuttons')
->share('Model.Custombuttons', [$this, 'getModelCustombuttons'], true);
->share('Model.Custombuttons', [$this, 'getCustombuttons'], true);
$container->alias(Loader::class, 'Model.Loader')
->share('Model.Loader', [$this, 'getModelLoader'], true);
->share('Model.Loader', [$this, 'getLoader'], true);
$container->alias(Phpadminview::class, 'Model.Phpadminview')
->share('Model.Phpadminview', [$this, 'getModelPhpadminview'], true);
->share('Model.Phpadminview', [$this, 'getPhpadminview'], true);
$container->alias(Cssadminview::class, 'Model.Cssadminview')
->share('Model.Cssadminview', [$this, 'getModelCssadminview'], true);
->share('Model.Cssadminview', [$this, 'getCssadminview'], true);
$container->alias(Javascriptadminview::class, 'Model.Javascriptadminview')
->share('Model.Javascriptadminview', [$this, 'getModelJavascriptadminview'], true);
->share('Model.Javascriptadminview', [$this, 'getJavascriptadminview'], true);
$container->alias(Linkedviews::class, 'Model.Linkedviews')
->share('Model.Linkedviews', [$this, 'getModelLinkedviews'], true);
->share('Model.Linkedviews', [$this, 'getLinkedviews'], true);
$container->alias(Relations::class, 'Model.Relations')
->share('Model.Relations', [$this, 'getModelRelations'], true);
->share('Model.Relations', [$this, 'getRelations'], true);
$container->alias(Conditions::class, 'Model.Conditions')
->share('Model.Conditions', [$this, 'getModelConditions'], true);
->share('Model.Conditions', [$this, 'getConditions'], true);
$container->alias(Fields::class, 'Model.Fields')
->share('Model.Fields', [$this, 'getModelFields'], true);
->share('Model.Fields', [$this, 'getFields'], true);
$container->alias(Updatesql::class, 'Model.Updatesql')
->share('Model.Updatesql', [$this, 'getModelUpdatesql'], true);
->share('Model.Updatesql', [$this, 'getUpdatesql'], true);
$container->alias(Tabs::class, 'Model.Tabs')
->share('Model.Tabs', [$this, 'getModelTabs'], true);
->share('Model.Tabs', [$this, 'getTabs'], true);
$container->alias(Customtabs::class, 'Model.Customtabs')
->share('Model.Customtabs', [$this, 'getModelCustomtabs'], true);
->share('Model.Customtabs', [$this, 'getCustomtabs'], true);
$container->alias(CustomtabsJ3::class, 'Model.J3.Customtabs')
->share('Model.J3.Customtabs', [$this, 'getCustomtabsJ3'], true);
$container->alias(CustomtabsJ4::class, 'Model.J4.Customtabs')
->share('Model.J4.Customtabs', [$this, 'getCustomtabsJ4'], true);
$container->alias(CustomtabsJ5::class, 'Model.J5.Customtabs')
->share('Model.J5.Customtabs', [$this, 'getCustomtabsJ5'], true);
$container->alias(Adminviews::class, 'Model.Adminviews')
->share('Model.Adminviews', [$this, 'getModelAdminviews'], true);
->share('Model.Adminviews', [$this, 'getAdminviews'], true);
$container->alias(Sqltweaking::class, 'Model.Sqltweaking')
->share('Model.Sqltweaking', [$this, 'getModelSqltweaking'], true);
->share('Model.Sqltweaking', [$this, 'getSqltweaking'], true);
$container->alias(Sqldump::class, 'Model.Sqldump')
->share('Model.Sqldump', [$this, 'getModelSqldump'], true);
->share('Model.Sqldump', [$this, 'getSqldump'], true);
$container->alias(Whmcs::class, 'Model.Whmcs')
->share('Model.Whmcs', [$this, 'getModelWhmcs'], true);
->share('Model.Whmcs', [$this, 'getWhmcs'], true);
$container->alias(Filesfolders::class, 'Model.Filesfolders')
->share('Model.Filesfolders', [$this, 'getFilesfolders'], true);
$container->alias(Modifieddate::class, 'Model.Modifieddate')
->share('Model.Modifieddate', [$this, 'getModifieddate'], true);
@ -116,25 +139,38 @@
$container->alias(Createdate::class, 'Model.Createdate')
->share('Model.Createdate', [$this, 'getCreatedate'], true);
$container->alias(Router::class, 'Model.Router')
->share('Model.Router', [$this, 'getRouter'], true);
$container->alias(Updateserver::class, 'Model.Updateserver')
->share('Model.Updateserver', [$this, 'getUpdateserver'], true);
$container->alias(Filesfolders::class, 'Model.Filesfolders')
->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true);
$container->alias(ServerLoad::class, 'Model.Server.Load')
->share('Model.Server.Load', [$this, 'getServerLoad'], true);
}
/**
* Get the Joomla plugins Model
* Get The Load Class.
*
* @param Container $container The DI container.
*
* @return ServerLoad
* @since 3.2.0
*/
public function getServerLoad(Container $container): ServerLoad
{
return new ServerLoad(
$container->get('Crypt'),
$container->get('Table')
);
}
/**
* Get The Joomlaplugins Class.
*
* @param Container $container The DI container.
*
* @return Joomlaplugins
* @since 3.2.0
*/
public function getModelJoomlaplugins(Container $container): Joomlaplugins
public function getJoomlaplugins(Container $container): Joomlaplugins
{
return new Joomlaplugins(
$container->get('Joomlaplugin.Data')
@ -142,14 +178,14 @@
}
/**
* Get the Joomla modules Model
* Get The Joomlamodules Class.
*
* @param Container $container The DI container.
*
* @return Joomlamodules
* @since 3.2.0
*/
public function getModelJoomlamodules(Container $container): Joomlamodules
public function getJoomlamodules(Container $container): Joomlamodules
{
return new Joomlamodules(
$container->get('Joomlamodule.Data')
@ -157,14 +193,14 @@
}
/**
* Get the history component Model
* Get The Historycomponent Class.
*
* @param Container $container The DI container.
*
* @return Historycomponent
* @since 3.2.0
*/
public function getModelHistorycomponent(Container $container): Historycomponent
public function getHistorycomponent(Container $container): Historycomponent
{
return new Historycomponent(
$container->get('Config'),
@ -174,14 +210,14 @@
}
/**
* Get the custom admin views Model
* Get The Customadminviews Class.
*
* @param Container $container The DI container.
*
* @return Customadminviews
* @since 3.2.0
*/
public function getModelCustomadminviews(Container $container): Customadminviews
public function getCustomadminviews(Container $container): Customadminviews
{
return new Customadminviews(
$container->get('Customview.Data'),
@ -190,14 +226,14 @@
}
/**
* Get the ajax custom view Model
* Get The Ajaxcustomview Class.
*
* @param Container $container The DI container.
*
* @return Ajaxcustomview
* @since 3.2.0
*/
public function getModelAjaxcustomview(Container $container): Ajaxcustomview
public function getAjaxcustomview(Container $container): Ajaxcustomview
{
return new Ajaxcustomview(
$container->get('Config'),
@ -206,14 +242,14 @@
}
/**
* Get the javascript custom view Model
* Get The Javascriptcustomview Class.
*
* @param Container $container The DI container.
*
* @return Javascriptcustomview
* @since 3.2.0
*/
public function getModelJavascriptcustomview(Container $container): Javascriptcustomview
public function getJavascriptcustomview(Container $container): Javascriptcustomview
{
return new Javascriptcustomview(
$container->get('Customcode'),
@ -222,14 +258,14 @@
}
/**
* Get the css custom view Model
* Get The Csscustomview Class.
*
* @param Container $container The DI container.
*
* @return Csscustomview
* @since 3.2.0
*/
public function getModelCsscustomview(Container $container): Csscustomview
public function getCsscustomview(Container $container): Csscustomview
{
return new Csscustomview(
$container->get('Customcode')
@ -237,14 +273,14 @@
}
/**
* Get the php custom view Model
* Get The Phpcustomview Class.
*
* @param Container $container The DI container.
*
* @return Phpcustomview
* @since 3.2.0
*/
public function getModelPhpcustomview(Container $container): Phpcustomview
public function getPhpcustomview(Container $container): Phpcustomview
{
return new Phpcustomview(
$container->get('Customcode'),
@ -255,14 +291,14 @@
}
/**
* Get the dynamic get Model
* Get The Dynamicget Class.
*
* @param Container $container The DI container.
*
* @return Dynamicget
* @since 3.2.0
*/
public function getModelDynamicget(Container $container): Dynamicget
public function getDynamicget(Container $container): Dynamicget
{
return new Dynamicget(
$container->get('Config'),
@ -276,14 +312,14 @@
}
/**
* Get the libraries Model
* Get The Libraries Class.
*
* @param Container $container The DI container.
*
* @return Libraries
* @since 3.2.0
*/
public function getModelLibraries(Container $container): Libraries
public function getLibraries(Container $container): Libraries
{
return new Libraries(
$container->get('Config'),
@ -293,14 +329,14 @@
}
/**
* Get the site views Model
* Get The Siteviews Class.
*
* @param Container $container The DI container.
*
* @return Siteviews
* @since 3.2.0
*/
public function getModelSiteviews(Container $container): Siteviews
public function getSiteviews(Container $container): Siteviews
{
return new Siteviews(
$container->get('Customview.Data'),
@ -309,27 +345,27 @@
}
/**
* Get the permissions Model
* Get The Permissions Class.
*
* @param Container $container The DI container.
*
* @return Permissions
* @since 3.2.0
*/
public function getModelPermissions(Container $container): Permissions
public function getPermissions(Container $container): Permissions
{
return new Permissions();
}
/**
* Get the admin view history Model
* Get The Historyadminview Class.
*
* @param Container $container The DI container.
*
* @return Historyadminview
* @since 3.2.0
*/
public function getModelHistoryadminview(Container $container): Historyadminview
public function getHistoryadminview(Container $container): Historyadminview
{
return new Historyadminview(
$container->get('Config'),
@ -339,14 +375,14 @@
}
/**
* Get the MySQL settings Model
* Get The Mysqlsettings Class.
*
* @param Container $container The DI container.
*
* @return Mysqlsettings
* @since 3.2.0
*/
public function getModelMysqlsettings(Container $container): Mysqlsettings
public function getMysqlsettings(Container $container): Mysqlsettings
{
return new Mysqlsettings(
$container->get('Config'),
@ -355,14 +391,14 @@
}
/**
* Get the Sql Model
* Get The Sql Class.
*
* @param Container $container The DI container.
*
* @return Sql
* @since 3.2.0
*/
public function getModelSql(Container $container): Sql
public function getSql(Container $container): Sql
{
return new Sql(
$container->get('Customcode.Dispenser'),
@ -371,14 +407,14 @@
}
/**
* Get the custom alias Model
* Get The Customalias Class.
*
* @param Container $container The DI container.
*
* @return Customalias
* @since 3.2.0
*/
public function getModelCustomalias(Container $container): Customalias
public function getCustomalias(Container $container): Customalias
{
return new Customalias(
$container->get('Compiler.Builder.Custom.Alias'),
@ -387,14 +423,14 @@
}
/**
* Get the Admin Ajax Model
* Get The Ajaxadmin Class.
*
* @param Container $container The DI container.
*
* @return Ajaxadmin
* @since 3.2.0
*/
public function getModelAjaxadmin(Container $container): Ajaxadmin
public function getAjaxadmin(Container $container): Ajaxadmin
{
return new Ajaxadmin(
$container->get('Config'),
@ -404,14 +440,14 @@
}
/**
* Get the custom import scripts Model
* Get The Customimportscripts Class.
*
* @param Container $container The DI container.
*
* @return Customimportscripts
* @since 3.2.0
*/
public function getModelCustomimportscripts(Container $container): Customimportscripts
public function getCustomimportscripts(Container $container): Customimportscripts
{
return new Customimportscripts(
$container->get('Customcode.Dispenser')
@ -419,14 +455,14 @@
}
/**
* Get the custom import scripts Model
* Get The Custombuttons Class.
*
* @param Container $container The DI container.
*
* @return Custombuttons
* @since 3.2.0
*/
public function getModelCustombuttons(Container $container): Custombuttons
public function getCustombuttons(Container $container): Custombuttons
{
return new Custombuttons(
$container->get('Customcode'),
@ -436,14 +472,14 @@
}
/**
* Get The Model Loader Class.
* Get The Loader Class.
*
* @param Container $container The DI container.
*
* @return Loader
* @since 3.2.0
*/
public function getModelLoader(Container $container): Loader
public function getLoader(Container $container): Loader
{
return new Loader(
$container->get('Config'),
@ -455,14 +491,14 @@
}
/**
* Get the php admin view Model
* Get The Phpadminview Class.
*
* @param Container $container The DI container.
*
* @return Phpadminview
* @since 3.2.0
*/
public function getModelPhpadminview(Container $container): Phpadminview
public function getPhpadminview(Container $container): Phpadminview
{
return new Phpadminview(
$container->get('Customcode.Dispenser'),
@ -471,14 +507,14 @@
}
/**
* Get the Css Adminview Model
* Get The Cssadminview Class.
*
* @param Container $container The DI container.
*
* @return Cssadminview
* @since 3.2.0
*/
public function getModelCssadminview(Container $container): Cssadminview
public function getCssadminview(Container $container): Cssadminview
{
return new Cssadminview(
$container->get('Customcode.Dispenser')
@ -486,14 +522,14 @@
}
/**
* Get the Javascript Adminview Model
* Get The Javascriptadminview Class.
*
* @param Container $container The DI container.
*
* @return Javascriptadminview
* @since 3.2.0
*/
public function getModelJavascriptadminview(Container $container): Javascriptadminview
public function getJavascriptadminview(Container $container): Javascriptadminview
{
return new Javascriptadminview(
$container->get('Customcode.Dispenser')
@ -501,14 +537,14 @@
}
/**
* Get the linked views Model
* Get The Linkedviews Class.
*
* @param Container $container The DI container.
*
* @return Linkedviews
* @since 3.2.0
*/
public function getModelLinkedviews(Container $container): Linkedviews
public function getLinkedviews(Container $container): Linkedviews
{
return new Linkedviews(
$container->get('Registry')
@ -516,14 +552,14 @@
}
/**
* Get the relations Model
* Get The Relations Class.
*
* @param Container $container The DI container.
*
* @return Relations
* @since 3.2.0
*/
public function getModelRelations(Container $container): Relations
public function getRelations(Container $container): Relations
{
return new Relations(
$container->get('Config'),
@ -536,14 +572,14 @@
}
/**
* Get the conditions Model
* Get The Conditions Class.
*
* @param Container $container The DI container.
*
* @return Conditions
* @since 3.2.0
*/
public function getModelConditions(Container $container): Conditions
public function getConditions(Container $container): Conditions
{
return new Conditions(
$container->get('Field.Type.Name'),
@ -553,14 +589,14 @@
}
/**
* Get the fields Model
* Get The Fields Class.
*
* @param Container $container The DI container.
*
* @return Fields
* @since 3.2.0
*/
public function getModelFields(Container $container): Fields
public function getFields(Container $container): Fields
{
return new Fields(
$container->get('Config'),
@ -575,14 +611,14 @@
}
/**
* Get the update sql Model
* Get The Updatesql Class.
*
* @param Container $container The DI container.
*
* @return Updatesql
* @since 3.2.0
*/
public function getModelUpdatesql(Container $container): Updatesql
public function getUpdatesql(Container $container): Updatesql
{
return new Updatesql(
$container->get('Registry')
@ -590,29 +626,47 @@
}
/**
* Get the tabs Model
* Get The Tabs Class.
*
* @param Container $container The DI container.
*
* @return Updatesql
* @return Tabs
* @since 3.2.0
*/
public function getModelTabs(Container $container): Tabs
public function getTabs(Container $container): Tabs
{
return new Tabs();
}
/**
* Get the custom tabs Model
* Get The Customtabs Class.
*
* @param Container $container The DI container.
*
* @return Customtabs
* @since 3.2.0
*/
public function getModelCustomtabs(Container $container): Customtabs
public function getCustomtabs(Container $container): Customtabs
{
return new Customtabs(
if (empty($this->targetVersion))
{
$this->targetVersion = $container->get('Config')->joomla_version;
}
return $container->get('Model.J' . $this->targetVersion . '.Customtabs');
}
/**
* Get The CustomtabsJ3 Class.
*
* @param Container $container The DI container.
*
* @return CustomtabsJ3
* @since 3.2.0
*/
public function getCustomtabsJ3(Container $container): CustomtabsJ3
{
return new CustomtabsJ3(
$container->get('Config'),
$container->get('Compiler.Builder.Custom.Tabs'),
$container->get('Language'),
@ -622,14 +676,52 @@
}
/**
* Get the admin views Model
* Get The CustomtabsJ4 Class.
*
* @param Container $container The DI container.
*
* @return CustomtabsJ4
* @since 3.2.0
*/
public function getCustomtabsJ4(Container $container): CustomtabsJ4
{
return new CustomtabsJ4(
$container->get('Config'),
$container->get('Compiler.Builder.Custom.Tabs'),
$container->get('Language'),
$container->get('Placeholder'),
$container->get('Customcode')
);
}
/**
* Get The CustomtabsJ5 Class.
*
* @param Container $container The DI container.
*
* @return CustomtabsJ5
* @since 3.2.0
*/
public function getCustomtabsJ5(Container $container): CustomtabsJ5
{
return new CustomtabsJ5(
$container->get('Config'),
$container->get('Compiler.Builder.Custom.Tabs'),
$container->get('Language'),
$container->get('Placeholder'),
$container->get('Customcode')
);
}
/**
* Get The Adminviews Class.
*
* @param Container $container The DI container.
*
* @return Adminviews
* @since 3.2.0
*/
public function getModelAdminviews(Container $container): Adminviews
public function getAdminviews(Container $container): Adminviews
{
return new Adminviews(
$container->get('Config'),
@ -640,14 +732,14 @@
}
/**
* Get the SQL tweaking Model
* Get The Sqltweaking Class.
*
* @param Container $container The DI container.
*
* @return Sqltweaking
* @since 3.2.0
*/
public function getModelSqltweaking(Container $container): Sqltweaking
public function getSqltweaking(Container $container): Sqltweaking
{
return new Sqltweaking(
$container->get('Registry')
@ -655,14 +747,14 @@
}
/**
* Get the SQL dump Model
* Get The Sqldump Class.
*
* @param Container $container The DI container.
*
* @return Sqldump
* @since 3.2.0
*/
public function getModelSqldump(Container $container): Sqldump
public function getSqldump(Container $container): Sqldump
{
return new Sqldump(
$container->get('Registry')
@ -670,20 +762,33 @@
}
/**
* Get the whmcs Model
* Get The Whmcs Class.
*
* @param Container $container The DI container.
*
* @return Whmcs
* @since 3.2.0
*/
public function getModelWhmcs(Container $container): Whmcs
public function getWhmcs(Container $container): Whmcs
{
return new Whmcs();
}
/**
* Get the modified date Model
* Get The Filesfolders Class.
*
* @param Container $container The DI container.
*
* @return Filesfolders
* @since 3.2.0
*/
public function getFilesfolders(Container $container): Filesfolders
{
return new Filesfolders();
}
/**
* Get The Modifieddate Class.
*
* @param Container $container The DI container.
*
@ -696,7 +801,7 @@
}
/**
* Get the create date Model
* Get The Createdate Class.
*
* @param Container $container The DI container.
*
@ -709,7 +814,24 @@
}
/**
* Get the update server Model
* Get The Router Class.
*
* @param Container $container The DI container.
*
* @return Router
* @since 3.2.0
*/
public function getRouter(Container $container): Router
{
return new Router(
$container->get('Config'),
$container->get('Customcode.Dispenser'),
$container->get('Compiler.Builder.Router')
);
}
/**
* Get The Updateserver Class.
*
* @param Container $container The DI container.
*
@ -719,33 +841,4 @@
public function getUpdateserver(Container $container): Updateserver
{
return new Updateserver();
}
/**
* Get the files folders Model
*
* @param Container $container The DI container.
*
* @return Filesfolders
* @since 3.2.0
*/
public function getModelFilesfolders(Container $container): Filesfolders
{
return new Filesfolders();
}
/**
* Get the Server Model Server Loader class
*
* @param Container $container The DI container.
*
* @return ServerLoad
* @since 3.2.0
*/
public function getServerLoad(Container $container): ServerLoad
{
return new ServerLoad(
$container->get('Crypt'),
$container->get('Table')
);
}

View File

@ -133,38 +133,54 @@
"as": "default"
},
"use_selection30": {
"use": "fa8c1125-d370-4cb6-a7ff-eb32193c198c",
"as": "default"
"use": "fcf42c53-0967-4c87-9699-a4d86adfdadf",
"as": "Customtabs"
},
"use_selection31": {
"use": "fa8c1125-d370-4cb6-a7ff-eb32193c198c",
"as": "CustomtabsJ3"
},
"use_selection32": {
"use": "42648fb4-dfdc-4986-a180-69e5726a25c4",
"as": "CustomtabsJ4"
},
"use_selection42": {
"use": "92cc3144-1d3d-45b2-b49f-c7d356950033",
"as": "CustomtabsJ5"
},
"use_selection33": {
"use": "cebdcccb-24c5-46db-92de-63453852dcb8",
"as": "default"
},
"use_selection32": {
"use_selection34": {
"use": "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26",
"as": "default"
},
"use_selection33": {
"use_selection35": {
"use": "a6e1227c-1efe-407d-84ef-03c6989a6a88",
"as": "default"
},
"use_selection34": {
"use_selection36": {
"use": "af5beb21-214a-44f6-9090-7ea24c22e649",
"as": "default"
},
"use_selection35": {
"use_selection37": {
"use": "f4578c04-a81e-4218-b80d-b0612196eaf0",
"as": "default"
},
"use_selection36": {
"use_selection38": {
"use": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3",
"as": "default"
},
"use_selection37": {
"use_selection39": {
"use": "53cf9828-7ad4-4856-aac1-7c4c67bd3121",
"as": "default"
},
"use_selection38": {
"use_selection40": {
"use": "402239e6-ceec-4ee0-af62-22d462417bf6",
"as": "default"
},
"use_selection41": {
"use": "1d0fd857-12ec-4f47-ab1c-124d85748e24",
"as": "default"
}

View File

@ -0,0 +1,92 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class Router (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator**
```uml
@startuml
class Router << (F,LightGreen) >> #RoyalBlue {
# Dispenser $dispenser
# Request $request
# Builder $builder
# DefaultConstructor $defaultconstructor
# ManualConstructor $manualconstructor
# DefaultMethods $defaultmethods
# ManualMethods $manualmethods
+ __construct(Dispenser $dispenser, Request $request, ...)
+ getConstructor() : string
+ getConstructorAfterParent() : string
+ getMethods() : string
- init() : void
- updateKeys() : void
}
note right of Router::__construct
Constructor.
since: 3.2.0
arguments:
Dispenser $dispenser
Request $request
Builder $builder
DefaultConstructor $defaultconstructor
ManualConstructor $manualconstructor
DefaultMethods $defaultmethods
ManualMethods $manualmethods
end note
note right of Router::getConstructor
Get Constructor Before Parent Call
since: 3.2.0
return: string
end note
note right of Router::getConstructorAfterParent
Get Constructor After Parent Call
since: 3.2.0
return: string
end note
note right of Router::getMethods
Get Methods
since: 3.2.0
return: string
end note
note right of Router::init
Get Constructor Before Parent Call
since: 3.2.0
return: void
end note
note right of Router::updateKeys
Update the keys
since: 3.2.0
return: void
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,263 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Creator;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Request;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Router as Builder;
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorDefault as DefaultConstructor;
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorManual as ManualConstructor;
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsDefault as DefaultMethods;
use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsManual as ManualMethods;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Router Creator Class
*
* @since 3.2.0
*/
final class Router
{
/**
* The Dispenser Class.
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* The Request Class.
*
* @var Request
* @since 3.2.0
*/
protected Request $request;
/**
* The Router Class.
*
* @var Builder
* @since 3.2.0
*/
protected Builder $builder;
/**
* The RouterConstructorDefault Class.
*
* @var DefaultConstructor
* @since 3.2.0
*/
protected DefaultConstructor $defaultconstructor;
/**
* The RouterConstructorManual Class.
*
* @var ManualConstructor
* @since 3.2.0
*/
protected ManualConstructor $manualconstructor;
/**
* The RouterMethodsDefault Class.
*
* @var DefaultMethods
* @since 3.2.0
*/
protected DefaultMethods $defaultmethods;
/**
* The RouterMethodsManual Class.
*
* @var ManualMethods
* @since 3.2.0
*/
protected ManualMethods $manualmethods;
/**
* The Router Build Mode Before Parent Construct.
*
* @var int|null
* @since 3.2.0
*/
protected ?int $mode_before = null;
/**
* The Router Build Mode Methods.
*
* @var int|null
* @since 3.2.0
*/
protected ?int $mode_method = null;
/**
* Constructor.
*
* @param Dispenser $dispenser The Dispenser Class.
* @param Request $request The Request Class.
* @param Builder $builder The Router Class.
* @param DefaultConstructor $defaultconstructor The RouterConstructorDefault Class.
* @param ManualConstructor $manualconstructor The RouterConstructorManual Class.
* @param DefaultMethods $defaultmethods The RouterMethodsDefault Class.
* @param ManualMethods $manualmethods The RouterMethodsManual Class.
*
* @since 3.2.0
*/
public function __construct(Dispenser $dispenser, Request $request,
Builder $builder, DefaultConstructor $defaultconstructor,
ManualConstructor $manualconstructor,
DefaultMethods $defaultmethods,
ManualMethods $manualmethods)
{
$this->dispenser = $dispenser;
$this->request = $request;
$this->builder = $builder;
$this->defaultconstructor = $defaultconstructor;
$this->manualconstructor = $manualconstructor;
$this->defaultmethods = $defaultmethods;
$this->manualmethods = $manualmethods;
}
/**
* Get Constructor Before Parent Call
*
* @return string
* @since 3.2.0
*/
public function getConstructor(): string
{
$this->init();
if ($this->mode_before == 3)
{
return $this->dispenser->get(
'_site_router_', 'constructor_before_parent',
PHP_EOL . PHP_EOL, null, true
);
}
if ($this->mode_before == 2)
{
return $this->manualconstructor->get();
}
return $this->defaultconstructor->get();
}
/**
* Get Constructor After Parent Call
*
* @return string
* @since 3.2.0
*/
public function getConstructorAfterParent(): string
{
return $this->dispenser->get(
'_site_router_', 'constructor_after_parent',
PHP_EOL . PHP_EOL, null, true
);
}
/**
* Get Methods
*
* @return string
* @since 3.2.0
*/
public function getMethods(): string
{
$this->init();
if ($this->mode_method == 0)
{
return '';
}
if ($this->mode_method == 3)
{
return $this->dispenser->get(
'_site_router_', 'methods',
PHP_EOL . PHP_EOL, null, true
);
}
if ($this->mode_before == 2 && $this->mode_method == 1)
{
return $this->manualmethods->get();
}
if ($this->mode_method == 1)
{
return $this->defaultmethods->get();
}
return '';
}
/**
* Get Constructor Before Parent Call
*
* @return void
* @since 3.2.0
*/
private function init(): void
{
if ($this->mode_before === null)
{
$this->mode_before = (int) $this->builder->get('mode_before', 0);
$this->mode_method = (int) $this->builder->get('mode_method', 0);
$this->updateKeys();
}
}
/**
* Update the keys
*
* @return void
* @since 3.2.0
*/
private function updateKeys(): void
{
if (($requests = $this->request->allActive()) === [] ||
($views = $this->builder->get('views')) === null)
{
return;
}
foreach ($views as &$router)
{
// if the key is null, and not 'id'
// then we must not update it
// since this is a list view and
// should not add an ID as key value
if ($router->key === 'id')
{
foreach ($requests as $key => $request)
{
if (isset($request[$router->view]))
{
$router->key = $key;
}
}
}
}
unset($router);
$this->request->set('views', $views);
}
}

View File

@ -0,0 +1,229 @@
/**
* The Dispenser Class.
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* The Request Class.
*
* @var Request
* @since 3.2.0
*/
protected Request $request;
/**
* The Router Class.
*
* @var Builder
* @since 3.2.0
*/
protected Builder $builder;
/**
* The RouterConstructorDefault Class.
*
* @var DefaultConstructor
* @since 3.2.0
*/
protected DefaultConstructor $defaultconstructor;
/**
* The RouterConstructorManual Class.
*
* @var ManualConstructor
* @since 3.2.0
*/
protected ManualConstructor $manualconstructor;
/**
* The RouterMethodsDefault Class.
*
* @var DefaultMethods
* @since 3.2.0
*/
protected DefaultMethods $defaultmethods;
/**
* The RouterMethodsManual Class.
*
* @var ManualMethods
* @since 3.2.0
*/
protected ManualMethods $manualmethods;
/**
* The Router Build Mode Before Parent Construct.
*
* @var int|null
* @since 3.2.0
*/
protected ?int $mode_before = null;
/**
* The Router Build Mode Methods.
*
* @var int|null
* @since 3.2.0
*/
protected ?int $mode_method = null;
/**
* Constructor.
*
* @param Dispenser $dispenser The Dispenser Class.
* @param Request $request The Request Class.
* @param Builder $builder The Router Class.
* @param DefaultConstructor $defaultconstructor The RouterConstructorDefault Class.
* @param ManualConstructor $manualconstructor The RouterConstructorManual Class.
* @param DefaultMethods $defaultmethods The RouterMethodsDefault Class.
* @param ManualMethods $manualmethods The RouterMethodsManual Class.
*
* @since 3.2.0
*/
public function __construct(Dispenser $dispenser, Request $request,
Builder $builder, DefaultConstructor $defaultconstructor,
ManualConstructor $manualconstructor,
DefaultMethods $defaultmethods,
ManualMethods $manualmethods)
{
$this->dispenser = $dispenser;
$this->request = $request;
$this->builder = $builder;
$this->defaultconstructor = $defaultconstructor;
$this->manualconstructor = $manualconstructor;
$this->defaultmethods = $defaultmethods;
$this->manualmethods = $manualmethods;
}
/**
* Get Constructor Before Parent Call
*
* @return string
* @since 3.2.0
*/
public function getConstructor(): string
{
$this->init();
if ($this->mode_before == 3)
{
return $this->dispenser->get(
'_site_router_', 'constructor_before_parent',
PHP_EOL . PHP_EOL, null, true
);
}
if ($this->mode_before == 2)
{
return $this->manualconstructor->get();
}
return $this->defaultconstructor->get();
}
/**
* Get Constructor After Parent Call
*
* @return string
* @since 3.2.0
*/
public function getConstructorAfterParent(): string
{
return $this->dispenser->get(
'_site_router_', 'constructor_after_parent',
PHP_EOL . PHP_EOL, null, true
);
}
/**
* Get Methods
*
* @return string
* @since 3.2.0
*/
public function getMethods(): string
{
$this->init();
if ($this->mode_method == 0)
{
return '';
}
if ($this->mode_method == 3)
{
return $this->dispenser->get(
'_site_router_', 'methods',
PHP_EOL . PHP_EOL, null, true
);
}
if ($this->mode_before == 2 && $this->mode_method == 1)
{
return $this->manualmethods->get();
}
if ($this->mode_method == 1)
{
return $this->defaultmethods->get();
}
return '';
}
/**
* Get Constructor Before Parent Call
*
* @return void
* @since 3.2.0
*/
private function init(): void
{
if ($this->mode_before === null)
{
$this->mode_before = (int) $this->builder->get('mode_before', 0);
$this->mode_method = (int) $this->builder->get('mode_method', 0);
$this->updateKeys();
}
}
/**
* Update the keys
*
* @return void
* @since 3.2.0
*/
private function updateKeys(): void
{
if (($requests = $this->request->allActive()) === [] ||
($views = $this->builder->get('views')) === null)
{
return;
}
foreach ($views as &$router)
{
// if the key is null, and not 'id'
// then we must not update it
// since this is a list view and
// should not add an ID as key value
if ($router->key === 'id')
{
foreach ($requests as $key => $request)
{
if (isset($request[$router->view]))
{
$router->key = $key;
}
}
}
}
unset($router);
$this->request->set('views', $views);
}

View File

@ -0,0 +1,55 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "1294a7c7-46fb-4527-a69d-f8db830fd39a",
"implements": null,
"load_selection": null,
"name": "Router",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Creator.Router",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "f1dc6430-fb54-452e-aa53-ce32ae93db88",
"as": "default"
},
"use_selection1": {
"use": "98419ff3-6628-4539-8365-37f88378bced",
"as": "default"
},
"use_selection2": {
"use": "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5",
"as": "Builder"
},
"use_selection3": {
"use": "e5278bf3-6dfb-42a0-b699-148b5ab8e45f",
"as": "DefaultConstructor"
},
"use_selection4": {
"use": "ec7bdbf9-8377-446e-9f40-64e23ae96b59",
"as": "ManualConstructor"
},
"use_selection5": {
"use": "17c590ed-8a44-485c-9be8-9a144a6b7429",
"as": "DefaultMethods"
},
"use_selection6": {
"use": "6034587d-82a3-4b19-ac58-40507f79122a",
"as": "ManualMethods"
},
"use_selection7": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection8": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.Router",
"description": "Router Creator Class\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -0,0 +1,52 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class InputButton (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive**
```uml
@startuml
class InputButton << (F,LightGreen) >> #RoyalBlue {
# Config $config
# Placeholder $placeholder
# Permission $permission
+ __construct(Config $config, Placeholder $placeholder, ...)
+ get(array $fieldData) : string
}
note right of InputButton::__construct
Constructor.
since: 3.2.0
arguments:
Config $config
Placeholder $placeholder
Permission $permission
end note
note right of InputButton::get
get Add Button To List Field Input (getInput tweak)
since: 3.2.0
return: string
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,345 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface;
/**
* Compiler Field Input Button
*
* @since 3.2.0
*/
final class InputButton implements InputButtonInterface
{
/**
* The Config Class.
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The Placeholder Class.
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Placeholder $placeholder The Placeholder Class.
* @param Permission $permission The Permission Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Placeholder $placeholder,
Permission $permission)
{
$this->config = $config;
$this->placeholder = $placeholder;
$this->permission = $permission;
}
/**
* get Add Button To List Field Input (getInput tweak)
*
* @param array $fieldData The field custom data
*
* @return string of getInput class on success empty string otherwise
* @since 3.2.0
*/
public function get(array $fieldData): string
{
// make sure hte view values are set
if (isset($fieldData['add_button'])
&& ($fieldData['add_button'] === 'true'
|| 1 == $fieldData['add_button'])
&& isset($fieldData['view'])
&& isset($fieldData['views'])
&& StringHelper::check($fieldData['view'])
&& StringHelper::check($fieldData['views']))
{
// set local component
$local_component = "com_" . $this->config->component_code_name;
// check that the component value is set
if (!isset($fieldData['component'])
|| !StringHelper::check(
$fieldData['component']
))
{
$fieldData['component'] = $local_component;
}
// check that the component has the com_ value in it
if (strpos((string) $fieldData['component'], 'com_') === false
|| strpos((string) $fieldData['component'], '=') !== false)
{
$fieldData['component'] = "com_" . $fieldData['component'];
}
// make sure the component is update if # # # or [ [ [ component placeholder is used
if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false
|| strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but
{
$fieldData['component'] = $this->placeholder->update_(
$fieldData['component']
);
}
// get core permissions
$coreLoad = false;
// add ref tags
$refLoad = true;
// fall back on the field component
$component = $fieldData['component'];
// check if we should add ref tags (since it only works well on local views)
if ($local_component !== $component)
{
// do not add ref tags
$refLoad = false;
}
// start building the add buttons/s
$addButton = array();
$addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
$addButton[] = Indent::_(1) . " * Override to add new button";
$addButton[] = Indent::_(1) . " *";
$addButton[] = Indent::_(1)
. " * @return string The field input markup.";
$addButton[] = Indent::_(1) . " *";
$addButton[] = Indent::_(1) . " * @since 3.2";
$addButton[] = Indent::_(1) . " */";
$addButton[] = Indent::_(1) . "protected function getInput()";
$addButton[] = Indent::_(1) . "{";
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " see if we should add buttons";
$addButton[] = Indent::_(2)
. "\$set_button = \$this->getAttribute('button');";
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " get html";
$addButton[] = Indent::_(2) . "\$html = parent::getInput();";
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " if true set button";
$addButton[] = Indent::_(2) . "if (\$set_button === 'true')";
$addButton[] = Indent::_(2) . "{";
$addButton[] = Indent::_(3) . "\$button = array();";
$addButton[] = Indent::_(3) . "\$script = array();";
$addButton[] = Indent::_(3)
. "\$button_code_name = \$this->getAttribute('name');";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the input from url";
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the view name & id";
$addButton[] = Indent::_(3)
. "\$values = \$jinput->getArray(array(";
$addButton[] = Indent::_(4) . "'id' => 'int',";
$addButton[] = Indent::_(4) . "'view' => 'word'";
$addButton[] = Indent::_(3) . "));";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if new item";
$addButton[] = Indent::_(3) . "\$ref = '';";
$addButton[] = Indent::_(3) . "\$refJ = '';";
if ($refLoad)
{
$addButton[] = Indent::_(3)
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " only load referral if not new item.";
$addButton[] = Indent::_(4)
. "\$ref = '&amp;ref=' . \$values['view'] . '&amp;refid=' . \$values['id'];";
$addButton[] = Indent::_(4)
. "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load return value.";
$addButton[] = Indent::_(4)
. "\$ref .= '&amp;return=' . \$_return;";
$addButton[] = Indent::_(4)
. "\$refJ .= '&return=' . \$_return;";
$addButton[] = Indent::_(3) . "}";
}
else
{
$addButton[] = Indent::_(3)
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " only load field details if not new item.";
$addButton[] = Indent::_(4)
. "\$ref = '&amp;field=' . \$values['view'] . '&amp;field_id=' . \$values['id'];";
$addButton[] = Indent::_(4)
. "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load return value.";
$addButton[] = Indent::_(4)
. "\$ref = '&amp;return=' . \$_return;";
$addButton[] = Indent::_(4)
. "\$refJ = '&return=' . \$_return;";
$addButton[] = Indent::_(3) . "}";
}
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get button label";
$addButton[] = Indent::_(3)
. "\$button_label = trim(\$button_code_name);";
$addButton[] = Indent::_(3)
. "\$button_label = preg_replace('/_+/', ' ', \$button_label);";
$addButton[] = Indent::_(3)
. "\$button_label = preg_replace('/\s+/', ' ', \$button_label);";
$addButton[] = Indent::_(3)
. "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);";
$addButton[] = Indent::_(3)
. "\$button_label = ucfirst(strtolower(\$button_label));";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get user object";
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to create " . $fieldData['view'];
// check if the item has permissions.
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
. $this->permission->getGlobal($fieldData['view'], 'core.create')
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build Create button";
$addButton[] = Indent::_(4)
. "\$button[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
. ":sprintf('" . $this->config->lang_prefix
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\"";
$addButton[] = Indent::_(5) . "href=\"index.php?option="
. $fieldData['component'] . "&amp;view=" . $fieldData['view']
. "&amp;layout=edit'.\$ref.'\" >";
$addButton[] = Indent::_(5)
. "<span class=\"icon-new icon-white\"></span></a>';";
$addButton[] = Indent::_(3) . "}";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to edit " . $fieldData['view'];
// check if the item has permissions.
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build edit button";
$addButton[] = Indent::_(4)
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
. ":sprintf('" . $this->config->lang_prefix
. "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >";
$addButton[] = Indent::_(5)
. "<span class=\"icon-edit\"></span></a>';";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build script";
$addButton[] = Indent::_(4) . "\$script[] = \"";
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
$addButton[] = Indent::_(6)
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
$addButton[] = Indent::_(7) . "e.preventDefault();";
$addButton[] = Indent::_(7)
. "let \".\$button_code_name.\"Value = this.value;";
$addButton[] = Indent::_(7)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(6) . "});";
$addButton[] = Indent::_(6)
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
$addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(5) . "});";
$addButton[] = Indent::_(5)
. "function \".\$button_code_name.\"Button(value) {";
$addButton[] = Indent::_(6)
. "var createButton = document.getElementById('\".\$button_code_name.\"Create');";
$addButton[] = Indent::_(6)
. "var editButton = document.getElementById('\".\$button_code_name.\"Edit');";
$addButton[] = Indent::_(6)
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
$addButton[] = Indent::_(7) . "// hide the create button";
$addButton[] = Indent::_(7)
. "createButton.style.display = 'none';";
$addButton[] = Indent::_(7) . "// show edit button";
$addButton[] = Indent::_(7)
. "editButton.style.display = 'block';";
$addButton[] = Indent::_(7) . "let url = 'index.php?option="
. $fieldData['component'] . "&view=" . $fieldData['views']
. "&task=" . $fieldData['view']
. ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
$addButton[] = Indent::_(7)
. "editButton.setAttribute('href', url);";
$addButton[] = Indent::_(6) . "} else {";
$addButton[] = Indent::_(7) . "// show the create button";
$addButton[] = Indent::_(7)
. "createButton.style.display = 'block';";
$addButton[] = Indent::_(7) . "// hide edit button";
$addButton[] = Indent::_(7)
. "editButton.style.display = 'none';";
$addButton[] = Indent::_(6) . "}";
$addButton[] = Indent::_(5) . "}\";";
$addButton[] = Indent::_(3) . "}";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if button was created for " . $fieldData['view']
. " field.";
$addButton[] = Indent::_(3)
. "if (is_array(\$button) && count(\$button) > 0)";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load the needed script.";
$addButton[] = Indent::_(4)
. "\$document = Factory::getApplication()->getDocument();";
$addButton[] = Indent::_(4)
. "\$document->addScriptDeclaration(implode(' ',\$script));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " return the button attached to input field.";
$addButton[] = Indent::_(4)
. "return '<div class=\"input-group\">' .\$html . implode('',\$button).'</div>';";
$addButton[] = Indent::_(3) . "}";
$addButton[] = Indent::_(2) . "}";
$addButton[] = Indent::_(2) . "return \$html;";
$addButton[] = Indent::_(1) . "}";
return implode(PHP_EOL, $addButton);
}
return '';
}
}

View File

@ -0,0 +1,312 @@
/**
* The Config Class.
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The Placeholder Class.
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Placeholder $placeholder The Placeholder Class.
* @param Permission $permission The Permission Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Placeholder $placeholder,
Permission $permission)
{
$this->config = $config;
$this->placeholder = $placeholder;
$this->permission = $permission;
}
/**
* get Add Button To List Field Input (getInput tweak)
*
* @param array $fieldData The field custom data
*
* @return string of getInput class on success empty string otherwise
* @since 3.2.0
*/
public function get(array $fieldData): string
{
// make sure hte view values are set
if (isset($fieldData['add_button'])
&& ($fieldData['add_button'] === 'true'
|| 1 == $fieldData['add_button'])
&& isset($fieldData['view'])
&& isset($fieldData['views'])
&& StringHelper::check($fieldData['view'])
&& StringHelper::check($fieldData['views']))
{
// set local component
$local_component = "com_" . $this->config->component_code_name;
// check that the component value is set
if (!isset($fieldData['component'])
|| !StringHelper::check(
$fieldData['component']
))
{
$fieldData['component'] = $local_component;
}
// check that the component has the com_ value in it
if (strpos((string) $fieldData['component'], 'com_') === false
|| strpos((string) $fieldData['component'], '=') !== false)
{
$fieldData['component'] = "com_" . $fieldData['component'];
}
// make sure the component is update if # # # or [ [ [ component placeholder is used
if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false
|| strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but
{
$fieldData['component'] = $this->placeholder->update_(
$fieldData['component']
);
}
// get core permissions
$coreLoad = false;
// add ref tags
$refLoad = true;
// fall back on the field component
$component = $fieldData['component'];
// check if we should add ref tags (since it only works well on local views)
if ($local_component !== $component)
{
// do not add ref tags
$refLoad = false;
}
// start building the add buttons/s
$addButton = array();
$addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
$addButton[] = Indent::_(1) . " * Override to add new button";
$addButton[] = Indent::_(1) . " *";
$addButton[] = Indent::_(1)
. " * @return string The field input markup.";
$addButton[] = Indent::_(1) . " *";
$addButton[] = Indent::_(1) . " * @since 3.2";
$addButton[] = Indent::_(1) . " */";
$addButton[] = Indent::_(1) . "protected function getInput()";
$addButton[] = Indent::_(1) . "{";
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " see if we should add buttons";
$addButton[] = Indent::_(2)
. "\$set_button = \$this->getAttribute('button');";
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " get html";
$addButton[] = Indent::_(2) . "\$html = parent::getInput();";
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " if true set button";
$addButton[] = Indent::_(2) . "if (\$set_button === 'true')";
$addButton[] = Indent::_(2) . "{";
$addButton[] = Indent::_(3) . "\$button = array();";
$addButton[] = Indent::_(3) . "\$script = array();";
$addButton[] = Indent::_(3)
. "\$button_code_name = \$this->getAttribute('name');";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the input from url";
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the view name & id";
$addButton[] = Indent::_(3)
. "\$values = \$jinput->getArray(array(";
$addButton[] = Indent::_(4) . "'id' => 'int',";
$addButton[] = Indent::_(4) . "'view' => 'word'";
$addButton[] = Indent::_(3) . "));";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if new item";
$addButton[] = Indent::_(3) . "\$ref = '';";
$addButton[] = Indent::_(3) . "\$refJ = '';";
if ($refLoad)
{
$addButton[] = Indent::_(3)
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " only load referral if not new item.";
$addButton[] = Indent::_(4)
. "\$ref = '&amp;ref=' . \$values['view'] . '&amp;refid=' . \$values['id'];";
$addButton[] = Indent::_(4)
. "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load return value.";
$addButton[] = Indent::_(4)
. "\$ref .= '&amp;return=' . \$_return;";
$addButton[] = Indent::_(4)
. "\$refJ .= '&return=' . \$_return;";
$addButton[] = Indent::_(3) . "}";
}
else
{
$addButton[] = Indent::_(3)
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " only load field details if not new item.";
$addButton[] = Indent::_(4)
. "\$ref = '&amp;field=' . \$values['view'] . '&amp;field_id=' . \$values['id'];";
$addButton[] = Indent::_(4)
. "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load return value.";
$addButton[] = Indent::_(4)
. "\$ref = '&amp;return=' . \$_return;";
$addButton[] = Indent::_(4)
. "\$refJ = '&return=' . \$_return;";
$addButton[] = Indent::_(3) . "}";
}
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get button label";
$addButton[] = Indent::_(3)
. "\$button_label = trim(\$button_code_name);";
$addButton[] = Indent::_(3)
. "\$button_label = preg_replace('/_+/', ' ', \$button_label);";
$addButton[] = Indent::_(3)
. "\$button_label = preg_replace('/\s+/', ' ', \$button_label);";
$addButton[] = Indent::_(3)
. "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);";
$addButton[] = Indent::_(3)
. "\$button_label = ucfirst(strtolower(\$button_label));";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get user object";
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to create " . $fieldData['view'];
// check if the item has permissions.
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
. $this->permission->getGlobal($fieldData['view'], 'core.create')
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build Create button";
$addButton[] = Indent::_(4)
. "\$button[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
. ":sprintf('" . $this->config->lang_prefix
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\"";
$addButton[] = Indent::_(5) . "href=\"index.php?option="
. $fieldData['component'] . "&amp;view=" . $fieldData['view']
. "&amp;layout=edit'.\$ref.'\" >";
$addButton[] = Indent::_(5)
. "<span class=\"icon-new icon-white\"></span></a>';";
$addButton[] = Indent::_(3) . "}";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to edit " . $fieldData['view'];
// check if the item has permissions.
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build edit button";
$addButton[] = Indent::_(4)
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
. ":sprintf('" . $this->config->lang_prefix
. "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >";
$addButton[] = Indent::_(5)
. "<span class=\"icon-edit\"></span></a>';";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build script";
$addButton[] = Indent::_(4) . "\$script[] = \"";
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
$addButton[] = Indent::_(6)
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
$addButton[] = Indent::_(7) . "e.preventDefault();";
$addButton[] = Indent::_(7)
. "let \".\$button_code_name.\"Value = this.value;";
$addButton[] = Indent::_(7)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(6) . "});";
$addButton[] = Indent::_(6)
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
$addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(5) . "});";
$addButton[] = Indent::_(5)
. "function \".\$button_code_name.\"Button(value) {";
$addButton[] = Indent::_(6)
. "var createButton = document.getElementById('\".\$button_code_name.\"Create');";
$addButton[] = Indent::_(6)
. "var editButton = document.getElementById('\".\$button_code_name.\"Edit');";
$addButton[] = Indent::_(6)
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
$addButton[] = Indent::_(7) . "// hide the create button";
$addButton[] = Indent::_(7)
. "createButton.style.display = 'none';";
$addButton[] = Indent::_(7) . "// show edit button";
$addButton[] = Indent::_(7)
. "editButton.style.display = 'block';";
$addButton[] = Indent::_(7) . "let url = 'index.php?option="
. $fieldData['component'] . "&view=" . $fieldData['views']
. "&task=" . $fieldData['view']
. ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
$addButton[] = Indent::_(7)
. "editButton.setAttribute('href', url);";
$addButton[] = Indent::_(6) . "} else {";
$addButton[] = Indent::_(7) . "// show the create button";
$addButton[] = Indent::_(7)
. "createButton.style.display = 'block';";
$addButton[] = Indent::_(7) . "// hide edit button";
$addButton[] = Indent::_(7)
. "editButton.style.display = 'none';";
$addButton[] = Indent::_(6) . "}";
$addButton[] = Indent::_(5) . "}\";";
$addButton[] = Indent::_(3) . "}";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if button was created for " . $fieldData['view']
. " field.";
$addButton[] = Indent::_(3)
. "if (is_array(\$button) && count(\$button) > 0)";
$addButton[] = Indent::_(3) . "{";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load the needed script.";
$addButton[] = Indent::_(4)
. "\$document = Factory::getApplication()->getDocument();";
$addButton[] = Indent::_(4)
. "\$document->addScriptDeclaration(implode(' ',\$script));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " return the button attached to input field.";
$addButton[] = Indent::_(4)
. "return '<div class=\"input-group\">' .\$html . implode('',\$button).'</div>';";
$addButton[] = Indent::_(3) . "}";
$addButton[] = Indent::_(2) . "}";
$addButton[] = Indent::_(2) . "return \$html;";
$addButton[] = Indent::_(1) . "}";
return implode(PHP_EOL, $addButton);
}
return '';
}

View File

@ -0,0 +1,49 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "163fa7ca-21bd-4e7f-a618-26fe10b870fe",
"implements": [
"c600f58c-3fe2-4d2d-b711-2660eab6effe"
],
"load_selection": null,
"name": "InputButton",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Field.J5.InputButton",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection1": {
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
"as": "default"
},
"use_selection2": {
"use": "7f01622a-74c9-4e67-b111-3eb488035206",
"as": "default"
},
"use_selection3": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection4": {
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
"as": "default"
},
"use_selection5": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection6": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaFive.InputButton",
"description": "Compiler Field Input Button\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -142,7 +142,7 @@ class Historycomponent
if ($old_component && ObjectHelper::check($old_component))
{
$old_component_version = preg_replace(
'/[^0-9.]+/', '', (string) $old_component->component_version
'/^v/i', '', (string) $old_component->component_version
);
if ($old_component_version != $this->config->component_version)
{

View File

@ -112,7 +112,7 @@
if ($old_component && ObjectHelper::check($old_component))
{
$old_component_version = preg_replace(
'/[^0-9.]+/', '', (string) $old_component->component_version
'/^v/i', '', (string) $old_component->component_version
);
if ($old_component_version != $this->config->component_version)
{

View File

@ -0,0 +1,45 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class RouterMethodsDefault (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator**
```uml
@startuml
class RouterMethodsDefault << (F,LightGreen) >> #RoyalBlue {
# Router $router
+ __construct(Router $router)
+ get() : string
}
note right of RouterMethodsDefault::__construct
Constructor.
since: 3.2.0
end note
note right of RouterMethodsDefault::get
Get Methods Code
since: 3.2.0
return: string
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,137 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Creator;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Router;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
* Router Methods Default Creator Class
*
* @since 3.2.0
*/
final class RouterMethodsDefault
{
/**
* The Router Class.
*
* @var Router
* @since 3.2.0
*/
protected Router $router;
/**
* Constructor.
*
* @param Router $router The Router Class.
*
* @since 3.2.0
*/
public function __construct(Router $router)
{
$this->router = $router;
}
/**
* Get Methods Code
*
* @return string
* @since 3.2.0
*/
public function get(): string
{
$views = $this->router->get('views');
if ($views !== null)
{
$code = [];
foreach ($views as $view)
{
// we only add these if we can get an ID (int) value
// else you will need to use the manual or customcode options
if (empty($view->key) || empty($view->alias))
{
continue;
}
$code[] = '';
$code[] = Indent::_(1) . "/**";
$code[] = Indent::_(1) . " * Method to get the segment(s) for {$view->view}";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @param string \$segment Segment of the article to retrieve the ID for";
$code[] = Indent::_(1) . " * @param array \$query The request that is parsed right now";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @return mixed The {$view->key} of this item or false";
$code[] = Indent::_(1) . " * @since 4.4.0";
$code[] = Indent::_(1) . " */";
$code[] = Indent::_(1) . "public function get{$view->View}Id(\$segment, \$query)";
$code[] = Indent::_(1) . "{";
$code[] = Indent::_(2) . "if (\$this->noIDs)";
$code[] = Indent::_(2) . "{";
$code[] = Indent::_(3) . "\$dbquery = \$this->db->getQuery(true);";
$code[] = Indent::_(3) . "\$dbquery->select(\$this->db->quoteName('{$view->key}'))";
$code[] = Indent::_(4) . "->from(\$this->db->quoteName('{$view->table}'))";
$code[] = Indent::_(4) . "->where(";
$code[] = Indent::_(5) . "[";
$code[] = Indent::_(6) . "\$this->db->quoteName('{$view->alias}') . ' = :alias'";
$code[] = Indent::_(5) . "]";
$code[] = Indent::_(4) . ")";
$code[] = Indent::_(4) . "->bind(':alias', \$segment);";
$code[] = Indent::_(3) . "\$this->db->setQuery(\$dbquery);";
$code[] = '';
$code[] = Indent::_(3) . "return (int) \$this->db->loadResult();";
$code[] = Indent::_(2) . "}";
$code[] = '';
$code[] = Indent::_(2) . "return (int) \$segment;";
$code[] = Indent::_(1) . "}";
$code[] = '';
$code[] = Indent::_(1) . "/**";
$code[] = Indent::_(1) . " * Method to get the segment(s) for {$view->view}";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @param string \$id ID of the contact to retrieve the segments for";
$code[] = Indent::_(1) . " * @param array \$query The request that is built right now";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @return array|string The segments of this item";
$code[] = Indent::_(1) . " * @since 4.4.0";
$code[] = Indent::_(1) . " */";
$code[] = Indent::_(1) . "public function get{$view->View}Segment(\$id, \$query)";
$code[] = Indent::_(1) . "{";
$code[] = Indent::_(2) . "if (strpos(\$id, ':') === false)";
$code[] = Indent::_(2) . "{";
$code[] = Indent::_(3) . "\$id = (int) \$id;";
$code[] = Indent::_(3) . "\$dbquery = \$this->db->getQuery(true);";
$code[] = Indent::_(3) . "\$dbquery->select(\$this->db->quoteName('{$view->alias}'))";
$code[] = Indent::_(4) . "->from(\$this->db->quoteName('{$view->table}'))";
$code[] = Indent::_(4) . "->where(\$this->db->quoteName('{$view->key}') . ' = :id')";
$code[] = Indent::_(4) . "->bind(':id', \$id, ParameterType::INTEGER);";
$code[] = Indent::_(3) . "\$this->db->setQuery(\$dbquery);";
$code[] = '';
$code[] = Indent::_(3) . "\$id .= ':' . \$this->db->loadResult();";
$code[] = Indent::_(2) . "}";
$code[] = '';
$code[] = Indent::_(2) . "if (\$this->noIDs)";
$code[] = Indent::_(2) . "{";
$code[] = Indent::_(3) . "list(\$void, \$segment) = explode(':', \$id, 2);";
$code[] = '';
$code[] = Indent::_(3) . "return [\$void => \$segment];";
$code[] = Indent::_(2) . "}";
$code[] = '';
$code[] = Indent::_(2) . "return [(int) \$id => \$id];";
$code[] = Indent::_(1) . "}";
}
return PHP_EOL . implode(PHP_EOL, $code);
}
return '';
}
}

View File

@ -0,0 +1,109 @@
/**
* The Router Class.
*
* @var Router
* @since 3.2.0
*/
protected Router $router;
/**
* Constructor.
*
* @param Router $router The Router Class.
*
* @since 3.2.0
*/
public function __construct(Router $router)
{
$this->router = $router;
}
/**
* Get Methods Code
*
* @return string
* @since 3.2.0
*/
public function get(): string
{
$views = $this->router->get('views');
if ($views !== null)
{
$code = [];
foreach ($views as $view)
{
// we only add these if we can get an ID (int) value
// else you will need to use the manual or customcode options
if (empty($view->key) || empty($view->alias))
{
continue;
}
$code[] = '';
$code[] = Indent::_(1) . "/**";
$code[] = Indent::_(1) . " * Method to get the segment(s) for {$view->view}";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @param string \$segment Segment of the article to retrieve the ID for";
$code[] = Indent::_(1) . " * @param array \$query The request that is parsed right now";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @return mixed The {$view->key} of this item or false";
$code[] = Indent::_(1) . " * @since 4.4.0";
$code[] = Indent::_(1) . " */";
$code[] = Indent::_(1) . "public function get{$view->View}Id(\$segment, \$query)";
$code[] = Indent::_(1) . "{";
$code[] = Indent::_(2) . "if (\$this->noIDs)";
$code[] = Indent::_(2) . "{";
$code[] = Indent::_(3) . "\$dbquery = \$this->db->getQuery(true);";
$code[] = Indent::_(3) . "\$dbquery->select(\$this->db->quoteName('{$view->key}'))";
$code[] = Indent::_(4) . "->from(\$this->db->quoteName('{$view->table}'))";
$code[] = Indent::_(4) . "->where(";
$code[] = Indent::_(5) . "[";
$code[] = Indent::_(6) . "\$this->db->quoteName('{$view->alias}') . ' = :alias'";
$code[] = Indent::_(5) . "]";
$code[] = Indent::_(4) . ")";
$code[] = Indent::_(4) . "->bind(':alias', \$segment);";
$code[] = Indent::_(3) . "\$this->db->setQuery(\$dbquery);";
$code[] = '';
$code[] = Indent::_(3) . "return (int) \$this->db->loadResult();";
$code[] = Indent::_(2) . "}";
$code[] = '';
$code[] = Indent::_(2) . "return (int) \$segment;";
$code[] = Indent::_(1) . "}";
$code[] = '';
$code[] = Indent::_(1) . "/**";
$code[] = Indent::_(1) . " * Method to get the segment(s) for {$view->view}";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @param string \$id ID of the contact to retrieve the segments for";
$code[] = Indent::_(1) . " * @param array \$query The request that is built right now";
$code[] = Indent::_(1) . " *";
$code[] = Indent::_(1) . " * @return array|string The segments of this item";
$code[] = Indent::_(1) . " * @since 4.4.0";
$code[] = Indent::_(1) . " */";
$code[] = Indent::_(1) . "public function get{$view->View}Segment(\$id, \$query)";
$code[] = Indent::_(1) . "{";
$code[] = Indent::_(2) . "if (strpos(\$id, ':') === false)";
$code[] = Indent::_(2) . "{";
$code[] = Indent::_(3) . "\$id = (int) \$id;";
$code[] = Indent::_(3) . "\$dbquery = \$this->db->getQuery(true);";
$code[] = Indent::_(3) . "\$dbquery->select(\$this->db->quoteName('{$view->alias}'))";
$code[] = Indent::_(4) . "->from(\$this->db->quoteName('{$view->table}'))";
$code[] = Indent::_(4) . "->where(\$this->db->quoteName('{$view->key}') . ' = :id')";
$code[] = Indent::_(4) . "->bind(':id', \$id, ParameterType::INTEGER);";
$code[] = Indent::_(3) . "\$this->db->setQuery(\$dbquery);";
$code[] = '';
$code[] = Indent::_(3) . "\$id .= ':' . \$this->db->loadResult();";
$code[] = Indent::_(2) . "}";
$code[] = '';
$code[] = Indent::_(2) . "if (\$this->noIDs)";
$code[] = Indent::_(2) . "{";
$code[] = Indent::_(3) . "list(\$void, \$segment) = explode(':', \$id, 2);";
$code[] = '';
$code[] = Indent::_(3) . "return [\$void => \$segment];";
$code[] = Indent::_(2) . "}";
$code[] = '';
$code[] = Indent::_(2) . "return [(int) \$id => \$id];";
$code[] = Indent::_(1) . "}";
}
return PHP_EOL . implode(PHP_EOL, $code);
}
return '';
}

View File

@ -0,0 +1,31 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "17c590ed-8a44-485c-9be8-9a144a6b7429",
"implements": null,
"load_selection": null,
"name": "RouterMethodsDefault",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Creator.RouterMethodsDefault",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5",
"as": "default"
},
"use_selection1": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection2": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.RouterMethodsDefault",
"description": "Router Methods Default Creator Class\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -6,11 +6,11 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class InstallScript (Details)
# final class InstallScript (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree**
```uml
@startuml
class InstallScript #Gold {
class InstallScript << (F,LightGreen) >> #RoyalBlue {
# object $extension
# array $methods
# array $types
@ -21,6 +21,7 @@ class InstallScript #Gold {
# bool $preflightActive
# bool $postflightActive
+ get(object $extension) : string
# rest() : void
# build() : string
# head() : string
# construct() : string
@ -35,6 +36,13 @@ note right of InstallScript::get
return: string
end note
note right of InstallScript::rest
Reset all bucket at the start of each build
since: 3.2.0
return: void
end note
note right of InstallScript::build
build the install class

View File

@ -25,7 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
*
* @since 3.2.0
*/
class InstallScript implements GetScriptInterface
final class InstallScript implements GetScriptInterface
{
/**
* The extension
@ -125,6 +125,9 @@ class InstallScript implements GetScriptInterface
*/
public function get(object $extension): string
{
// purge the object
$this->rest();
// loop over methods and types
foreach ($this->methods as $method)
{
@ -160,6 +163,24 @@ class InstallScript implements GetScriptInterface
return $this->build();
}
/**
* Reset all bucket at the start of each build
*
* @return void
* @since 3.2.0
*/
protected function rest(): void
{
$this->construct = [];
$this->install = [];
$this->update = [];
$this->uninstall = [];
$this->preflightActive = false;
$this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
$this->postflightActive = false;
$this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
}
/**
* build the install class
*

View File

@ -96,6 +96,9 @@
*/
public function get(object $extension): string
{
// purge the object
$this->rest();
// loop over methods and types
foreach ($this->methods as $method)
{
@ -131,6 +134,24 @@
return $this->build();
}
/**
* Reset all bucket at the start of each build
*
* @return void
* @since 3.2.0
*/
protected function rest(): void
{
$this->construct = [];
$this->install = [];
$this->update = [];
$this->uninstall = [];
$this->preflightActive = false;
$this->preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
$this->postflightActive = false;
$this->postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
}
/**
* build the install class
*

View File

@ -9,8 +9,8 @@
"load_selection": null,
"name": "InstallScript",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Extension.JoomlaThree.InstallScript",
"type": "class",
"system_name": "JCB.Compiler.Extension.J3.InstallScript",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "1aefb8f5-486f-4f00-adf9-696340b3254e",

View File

@ -24,12 +24,11 @@ class Header << (F,LightGreen) >> #RoyalBlue {
# array $headers
# string $NamespacePrefix
# string $ComponentName
# string $ComponentNameSpace
# string $ComponentNamespace
+ __construct(Config $config, Event $event, ...)
+ get(string $context, string $codeName) : string
# getHeaders(string $context) : array
# setHelperClassHeader(array $headers, string $target_client) : void
# setChosenMultiSelectionHeaders(array $headers, string $nameListCode) : void
}
note right of Header::__construct
@ -70,13 +69,6 @@ note right of Header::setHelperClassHeader
since: 3.2.0
return: void
end note
note right of Header::setChosenMultiSelectionHeaders
Build chosen multi selection headers for the view
since: 3.2.0
return: void
end note
@enduml
```

View File

@ -22,7 +22,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
@ -145,7 +144,7 @@ final class Header implements HeaderInterface
* @var string
* @since 3.2.0
*/
protected string $ComponentNameSpace;
protected string $ComponentNamespace;
/**
* Constructor.
@ -181,9 +180,9 @@ final class Header implements HeaderInterface
$this->tags = $tags;
// set some global values
$this->NamespacePrefix = $this->config->get('namespace_prefix');
$this->NamespacePrefix = $this->placeholder->get('NamespacePrefix');
$this->ComponentName = $this->placeholder->get('Component');
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
$this->ComponentNamespace = $this->placeholder->get('ComponentNamespace');
}
/**
@ -200,6 +199,32 @@ final class Header implements HeaderInterface
// get static headers
$headers = $this->getHeaders($context);
// add to all except the helper classes
if ('admin.helper' !== $context && 'site.helper' !== $context)
{
$target = 'Administrator';
if ($this->config->get('build_target', 'admin') === 'site')
{
$target = 'Site';
}
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
// we will add more as needed
switch ($context)
{
case 'site.view.model':
case 'site.views.model':
case 'site.view.html':
case 'site.views.html':
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\RouteHelper;";
break;
default:
break;
}
}
// get dynamic headers
switch ($context)
{
@ -222,8 +247,15 @@ final class Header implements HeaderInterface
}
break;
case 'admin.views':
$this->setChosenMultiSelectionHeaders($headers, $codeName);
case 'admin.view':
case 'custom.admin.view':
case 'custom.admin.views':
case 'site.admin.view':
$headers[] = '';
$headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */';
$headers[] = '$wa = $this->getDocument()->getWebAssetManager();';
$headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');';
$headers[] = 'Html::_(\'bootstrap.tooltip\');';
break;
case 'admin.view.model':
@ -239,18 +271,6 @@ final class Header implements HeaderInterface
break;
}
// add to all except the helper classes
if ('admin.helper' !== $context && 'site.helper' !== $context)
{
$target = 'Administrator';
if ($this->config->get('build_target', 'admin') === 'site')
{
$target = 'Site';
}
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
}
// Trigger Event: jcb_ce_setClassHeader
$this->event->trigger(
'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers]
@ -322,11 +342,6 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = '';
$headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */';
$headers[] = '$wa = $this->getDocument()->getWebAssetManager();';
$headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');';
$headers[] = 'Html::_(\'bootstrap.tooltip\');';
break;
case 'admin.view.controller':
@ -371,7 +386,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;";
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\HeaderCheck;";
break;
case 'custom.admin.view.html':
@ -388,7 +403,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;";
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\HeaderCheck;";
break;
case 'admin.view.model':
@ -425,13 +440,29 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Session\Session;';
break;
case 'ajax.admin.model':
case 'ajax.site.model':
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
$headers[] = 'use Joomla\CMS\MVC\Model\ListModel;';
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\User\User;';
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
$headers[] = 'use Joomla\Input\Input;';
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = 'use Joomla\CMS\Session\Session;';
$headers[] = 'use Joomla\CMS\Uri\Uri;';
$headers[] = 'use Joomla\Registry\Registry;';
break;
case 'dashboard.model':
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\Session\Session;';
$headers[] = 'use Joomla\CMS\Uri\Uri;';
case 'admin.views.model':
case 'ajax.admin.model':
case 'ajax.site.model':
case 'custom.admin.views.model':
case 'site.views.model':
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
@ -439,6 +470,7 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\MVC\Model\ListModel;';
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = 'use Joomla\CMS\User\User;';
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
$headers[] = 'use Joomla\Input\Input;';
@ -491,14 +523,26 @@ final class Header implements HeaderInterface
$headers[] = 'use Joomla\CMS\Document\Document;';
break;
case 'site.component':
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
case 'site.router':
$headers[] = 'use Joomla\CMS\Application\SiteApplication;';
$headers[] = 'use Joomla\CMS\Categories\CategoryFactoryInterface;';
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
$headers[] = 'use Joomla\CMS\Component\Router\RouterView;';
$headers[] = 'use Joomla\CMS\Component\Router\RouterViewConfiguration;';
$headers[] = 'use Joomla\CMS\Component\Router\Rules\MenuRules;';
$headers[] = 'use Joomla\CMS\Component\Router\Rules\NomenuRules;';
$headers[] = 'use Joomla\CMS\Component\Router\Rules\StandardRules;';
$headers[] = 'use Joomla\CMS\Menu\AbstractMenu;';
$headers[] = 'use Joomla\Database\DatabaseInterface;';
$headers[] = 'use Joomla\Database\ParameterType;';
$headers[] = 'use Joomla\Registry\Registry;';
break;
case 'site.view':
case 'site.views':
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
break;
case 'form.custom.field':
@ -534,110 +578,6 @@ final class Header implements HeaderInterface
$headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;';
$headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;';
}
}
/**
* Build chosen multi selection headers for the view
*
* @param array $headers The headers array
* @param string $nameListCode The list view name
*
* @return void
* @since 3.2.0
*/
protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode)
{
// check that the filter type is the new filter option (2 = topbar)
if ($this->adminfiltertype->get($nameListCode, 1) == 2)
{
// add category switch
$add_category = false;
if ($this->category->exists("{$nameListCode}.extension")
&& $this->category->get("{$nameListCode}.filter", 0) >= 1)
{
// is found so add it
$add_category = true;
}
// add accessLevels switch
$add_access_levels = false;
if ($this->accessswitchlist->exists($nameListCode))
{
// is found so add it
$add_access_levels = true;
}
// check if this view have filters
if ($this->filter->exists($nameListCode))
{
foreach ($this->filter->get($nameListCode) as $filter)
{
// we need this only for filters that are multi
if (isset($filter['multi']) && $filter['multi'] == 2)
{
// if this is a category we should make sure it must be added
if (!$add_category && $filter['type'] === 'category')
{
continue;
}
elseif ($add_category && $filter['type'] === 'category')
{
// already added here so no need to add again
$add_category = false;
}
// check if this was an access field
elseif ($filter['type'] === 'accesslevel')
{
// already added here so no need to add again
$add_access_levels = false;
}
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multiple'
. $filter['class']
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $filter['lang_select'] . '\') . \' -\']);';
}
elseif ($add_category && $filter['type'] === 'category')
{
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multipleCategories'
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $filter['lang_select'] . '\') . \' -\']);';
// already added here so no need to add again
$add_category = false;
}
}
}
// add category if not already added
if ($add_category)
{
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multipleCategories'
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $this->category->exists("{$nameListCode}.name", 'error')
. '\') . \' -\']);';
}
// add accessLevels if not already added
if ($add_access_levels)
{
// set the language strings for selection
$filter_name_select = 'Select Access';
$filter_name_select_lang = $this->config->lang_prefix . '_FILTER_'
. StringHelper::safe(
$filter_name_select, 'U'
);
// and to translation
$this->language->set(
$this->config->lang_target, $filter_name_select_lang, $filter_name_select
);
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multipleAccessLevels'
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $filter_name_select_lang . '\') . \' -\']);';
}
}
}
}

View File

@ -108,7 +108,7 @@
* @var string
* @since 3.2.0
*/
protected string $ComponentNameSpace;
protected string $ComponentNamespace;
/**
* Constructor.
@ -144,9 +144,9 @@
$this->tags = $tags;
// set some global values
$this->NamespacePrefix = $this->config->get('namespace_prefix');
$this->NamespacePrefix = $this->placeholder->get('NamespacePrefix');
$this->ComponentName = $this->placeholder->get('Component');
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
$this->ComponentNamespace = $this->placeholder->get('ComponentNamespace');
}
/**
@ -163,6 +163,32 @@
// get static headers
$headers = $this->getHeaders($context);
// add to all except the helper classes
if ('admin.helper' !== $context && 'site.helper' !== $context)
{
$target = 'Administrator';
if ($this->config->get('build_target', 'admin') === 'site')
{
$target = 'Site';
}
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
// we will add more as needed
switch ($context)
{
case 'site.view.model':
case 'site.views.model':
case 'site.view.html':
case 'site.views.html':
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\RouteHelper;";
break;
default:
break;
}
}
// get dynamic headers
switch ($context)
{
@ -185,8 +211,15 @@
}
break;
case 'admin.views':
$this->setChosenMultiSelectionHeaders($headers, $codeName);
case 'admin.view':
case 'custom.admin.view':
case 'custom.admin.views':
case 'site.admin.view':
$headers[] = '';
$headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */';
$headers[] = '$wa = $this->getDocument()->getWebAssetManager();';
$headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');';
$headers[] = 'Html::_(\'bootstrap.tooltip\');';
break;
case 'admin.view.model':
@ -202,18 +235,6 @@
break;
}
// add to all except the helper classes
if ('admin.helper' !== $context && 'site.helper' !== $context)
{
$target = 'Administrator';
if ($this->config->get('build_target', 'admin') === 'site')
{
$target = 'Site';
}
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
}
// Trigger Event: jcb_ce_setClassHeader
$this->event->trigger(
'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers]
@ -285,11 +306,6 @@
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = '';
$headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */';
$headers[] = '$wa = $this->getDocument()->getWebAssetManager();';
$headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');';
$headers[] = 'Html::_(\'bootstrap.tooltip\');';
break;
case 'admin.view.controller':
@ -334,7 +350,7 @@
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;";
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\Site\\Helper\\HeaderCheck;";
break;
case 'custom.admin.view.html':
@ -351,7 +367,7 @@
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
$headers[] = 'use Joomla\CMS\Document\Document;';
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;";
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNamespace}\\{$target}\\Helper\\HeaderCheck;";
break;
case 'admin.view.model':
@ -388,13 +404,29 @@
$headers[] = 'use Joomla\CMS\Session\Session;';
break;
case 'ajax.admin.model':
case 'ajax.site.model':
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
$headers[] = 'use Joomla\CMS\MVC\Model\ListModel;';
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\User\User;';
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
$headers[] = 'use Joomla\Input\Input;';
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = 'use Joomla\CMS\Session\Session;';
$headers[] = 'use Joomla\CMS\Uri\Uri;';
$headers[] = 'use Joomla\Registry\Registry;';
break;
case 'dashboard.model':
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\Session\Session;';
$headers[] = 'use Joomla\CMS\Uri\Uri;';
case 'admin.views.model':
case 'ajax.admin.model':
case 'ajax.site.model':
case 'custom.admin.views.model':
case 'site.views.model':
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
@ -402,6 +434,7 @@
$headers[] = 'use Joomla\CMS\MVC\Model\ListModel;';
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = 'use Joomla\CMS\User\User;';
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
$headers[] = 'use Joomla\Input\Input;';
@ -454,14 +487,26 @@
$headers[] = 'use Joomla\CMS\Document\Document;';
break;
case 'site.component':
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
case 'site.router':
$headers[] = 'use Joomla\CMS\Application\SiteApplication;';
$headers[] = 'use Joomla\CMS\Categories\CategoryFactoryInterface;';
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
$headers[] = 'use Joomla\CMS\Component\Router\RouterView;';
$headers[] = 'use Joomla\CMS\Component\Router\RouterViewConfiguration;';
$headers[] = 'use Joomla\CMS\Component\Router\Rules\MenuRules;';
$headers[] = 'use Joomla\CMS\Component\Router\Rules\NomenuRules;';
$headers[] = 'use Joomla\CMS\Component\Router\Rules\StandardRules;';
$headers[] = 'use Joomla\CMS\Menu\AbstractMenu;';
$headers[] = 'use Joomla\Database\DatabaseInterface;';
$headers[] = 'use Joomla\Database\ParameterType;';
$headers[] = 'use Joomla\Registry\Registry;';
break;
case 'site.view':
case 'site.views':
$headers[] = 'use Joomla\CMS\Router\Route;';
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
break;
case 'form.custom.field':
@ -497,108 +542,4 @@
$headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;';
$headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;';
}
}
/**
* Build chosen multi selection headers for the view
*
* @param array $headers The headers array
* @param string $nameListCode The list view name
*
* @return void
* @since 3.2.0
*/
protected function setChosenMultiSelectionHeaders(&$headers, $nameListCode)
{
// check that the filter type is the new filter option (2 = topbar)
if ($this->adminfiltertype->get($nameListCode, 1) == 2)
{
// add category switch
$add_category = false;
if ($this->category->exists("{$nameListCode}.extension")
&& $this->category->get("{$nameListCode}.filter", 0) >= 1)
{
// is found so add it
$add_category = true;
}
// add accessLevels switch
$add_access_levels = false;
if ($this->accessswitchlist->exists($nameListCode))
{
// is found so add it
$add_access_levels = true;
}
// check if this view have filters
if ($this->filter->exists($nameListCode))
{
foreach ($this->filter->get($nameListCode) as $filter)
{
// we need this only for filters that are multi
if (isset($filter['multi']) && $filter['multi'] == 2)
{
// if this is a category we should make sure it must be added
if (!$add_category && $filter['type'] === 'category')
{
continue;
}
elseif ($add_category && $filter['type'] === 'category')
{
// already added here so no need to add again
$add_category = false;
}
// check if this was an access field
elseif ($filter['type'] === 'accesslevel')
{
// already added here so no need to add again
$add_access_levels = false;
}
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multiple'
. $filter['class']
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $filter['lang_select'] . '\') . \' -\']);';
}
elseif ($add_category && $filter['type'] === 'category')
{
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multipleCategories'
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $filter['lang_select'] . '\') . \' -\']);';
// already added here so no need to add again
$add_category = false;
}
}
}
// add category if not already added
if ($add_category)
{
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multipleCategories'
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $this->category->exists("{$nameListCode}.name", 'error')
. '\') . \' -\']);';
}
// add accessLevels if not already added
if ($add_access_levels)
{
// set the language strings for selection
$filter_name_select = 'Select Access';
$filter_name_select_lang = $this->config->lang_prefix . '_FILTER_'
. StringHelper::safe(
$filter_name_select, 'U'
);
// and to translation
$this->language->set(
$this->config->lang_target, $filter_name_select_lang, $filter_name_select
);
// add the header
$headers[]
= 'Html::_(\'formbehavior.chosen\', \'.multipleAccessLevels'
. '\', null, [\'placeholder_text_multiple\' => \'- \' . Text::_(\''
. $filter_name_select_lang . '\') . \' -\']);';
}
}
}

View File

@ -9,7 +9,7 @@
"load_selection": null,
"name": "Header",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.JoomlaFour.Header",
"system_name": "JCB.Compiler.J4.Header",
"type": "final class",
"use_selection": {
"use_selection0": {
@ -52,10 +52,6 @@
"use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903",
"as": "default"
},
"use_selection10": {
"use": "ce8cf834-6bac-44fb-941c-861f7e046cc0",
"as": "default"
},
"use_selection11": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"

View File

@ -73,7 +73,7 @@ final class Load
{
return $this->model->value(
$this->load->value(
["a.${field}" => $field],
["a.{$field}" => $field],
['a' => 'power'],
$this->prefix($keys)
),

View File

@ -48,7 +48,7 @@
{
return $this->model->value(
$this->load->value(
["a.${field}" => $field],
["a.{$field}" => $field],
['a' => 'power'],
$this->prefix($keys)
),

View File

@ -6,11 +6,11 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class CoreRule (Details)
# final class CoreRule (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree**
```uml
@startuml
class CoreRule #Gold {
class CoreRule << (F,LightGreen) >> #RoyalBlue {
# array $rules
# string $path
+ __construct()

View File

@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
*
* @since 3.2.0
*/
class CoreRule implements CoreRuleInterface
final class CoreRule implements CoreRuleInterface
{
/**
* Local Core Joomla Rules

View File

@ -10,7 +10,7 @@
"name": "CoreRule",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Field.J3.CoreRule",
"type": "class",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",

View File

@ -6,11 +6,11 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class History (Details)
# final class History (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour**
```uml
@startuml
class History #Gold {
class History << (F,LightGreen) >> #RoyalBlue {
# ?object $tmp
# Config $config
# $db

View File

@ -25,7 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
*
* @since 3.2.0
*/
class History implements HistoryInterface
final class History implements HistoryInterface
{
/**
* History Item Object
@ -80,18 +80,9 @@ class History implements HistoryInterface
$query = $this->db->getQuery(true);
$query->select('h.*');
$query->from('#__ucm_history AS h');
$query->from('#__history AS h');
$query->where(
$this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id
);
// Join over the content type for the type id
$query->join(
'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'
);
$query->where(
'ct.type_alias = ' . $this->db->quote(
'com_componentbuilder.' . $type
)
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
);
$query->order('h.save_date DESC');
$this->db->setQuery($query, 0, 1);
@ -108,9 +99,9 @@ class History implements HistoryInterface
$query = $this->db->getQuery(true);
$query->select('h.*');
$query->from('#__ucm_history AS h');
$query->from('#__history AS h');
$query->where(
$this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
);
$query->where('h.keep_forever = 1');
$query->where('h.version_note LIKE ' . $this->db->quote('%component%'));
@ -119,15 +110,6 @@ class History implements HistoryInterface
{
$query->where('h.version_id != ' . (int) $newActive->version_id);
}
// Join over the content type for the type id
$query->join(
'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'
);
$query->where(
'ct.type_alias = ' . $this->db->quote(
'com_componentbuilder.' . $type
)
);
$query->order('h.save_date DESC');
$this->db->setQuery($query);
$this->db->execute();
@ -223,8 +205,7 @@ class History implements HistoryInterface
}
// run the update
return $this->db->updateObject('#__ucm_history', $object, 'version_id');
}
return $this->db->updateObject('#__history', $object, 'version_id');
}
}

View File

@ -51,18 +51,9 @@
$query = $this->db->getQuery(true);
$query->select('h.*');
$query->from('#__ucm_history AS h');
$query->from('#__history AS h');
$query->where(
$this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id
);
// Join over the content type for the type id
$query->join(
'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'
);
$query->where(
'ct.type_alias = ' . $this->db->quote(
'com_componentbuilder.' . $type
)
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
);
$query->order('h.save_date DESC');
$this->db->setQuery($query, 0, 1);
@ -79,9 +70,9 @@
$query = $this->db->getQuery(true);
$query->select('h.*');
$query->from('#__ucm_history AS h');
$query->from('#__history AS h');
$query->where(
$this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
);
$query->where('h.keep_forever = 1');
$query->where('h.version_note LIKE ' . $this->db->quote('%component%'));
@ -90,15 +81,6 @@
{
$query->where('h.version_id != ' . (int) $newActive->version_id);
}
// Join over the content type for the type id
$query->join(
'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'
);
$query->where(
'ct.type_alias = ' . $this->db->quote(
'com_componentbuilder.' . $type
)
);
$query->order('h.save_date DESC');
$this->db->setQuery($query);
$this->db->execute();
@ -194,5 +176,5 @@
}
// run the update
return $this->db->updateObject('#__ucm_history', $object, 'version_id');
}
return $this->db->updateObject('#__history', $object, 'version_id');
}

View File

@ -9,8 +9,8 @@
"load_selection": null,
"name": "History",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.JoomlaFour.History",
"type": "class",
"system_name": "JCB.Compiler.J4.History",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",

View File

@ -69,7 +69,7 @@ final class CanDelete implements CanDeleteInterface
$allow = [];
// setup the default script
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->state != -2))";
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "return false;";
$allow[] = Indent::_(2) . "}" . PHP_EOL;

View File

@ -41,7 +41,7 @@
$allow = [];
// setup the default script
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->state != -2))";
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "return false;";
$allow[] = Indent::_(2) . "}" . PHP_EOL;

View File

@ -6,60 +6,12 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class Builder (Details)
# class BuilderLZ (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service**
```uml
@startuml
class Builder #Gold {
class BuilderLZ #Gold {
+ register(Container $container) : void
+ getAccessSwitch(Container $container) : AccessSwitch
+ getAccessSwitchList(Container $container) : AccessSwitchList
+ getAssetsRules(Container $container) : AssetsRules
+ getAdminFilterType(Container $container) : AdminFilterType
+ getAlias(Container $container) : Alias
+ getBaseSixFour(Container $container) : BaseSixFour
+ getCategory(Container $container) : Category
+ getCategoryCode(Container $container) : CategoryCode
+ getCategoryOtherName(Container $container) : CategoryOtherName
+ getCheckBox(Container $container) : CheckBox
+ getComponentFields(Container $container) : ComponentFields
+ getConfigFieldsets(Container $container) : ConfigFieldsets
+ getConfigFieldsetsCustomfield(Container $container) : ConfigFieldsetsCustomfield
+ getContentMulti(Container $container) : ContentMulti
+ getContentOne(Container $container) : ContentOne
+ getContributors(Container $container) : Contributors
+ getCustomAlias(Container $container) : CustomAlias
+ getCustomField(Container $container) : CustomField
+ getCustomFieldLinks(Container $container) : CustomFieldLinks
+ getCustomList(Container $container) : CustomList
+ getCustomTabs(Container $container) : CustomTabs
+ getDatabaseKeys(Container $container) : DatabaseKeys
+ getDatabaseTables(Container $container) : DatabaseTables
+ getDatabaseUniqueGuid(Container $container) : DatabaseUniqueGuid
+ getDatabaseUniqueKeys(Container $container) : DatabaseUniqueKeys
+ getDoNotEscape(Container $container) : DoNotEscape
+ getDynamicFields(Container $container) : DynamicFields
+ getExtensionCustomFields(Container $container) : ExtensionCustomFields
+ getExtensionsParams(Container $container) : ExtensionsParams
+ getFieldGroupControl(Container $container) : FieldGroupControl
+ getFieldNames(Container $container) : FieldNames
+ getFieldRelations(Container $container) : FieldRelations
+ getFilter(Container $container) : Filter
+ getFootableScripts(Container $container) : FootableScripts
+ getFrontendParams(Container $container) : FrontendParams
+ getGetAsLookup(Container $container) : GetAsLookup
+ getGetModule(Container $container) : GetModule
+ getGoogleChart(Container $container) : GoogleChart
+ getHasMenuGlobal(Container $container) : HasMenuGlobal
+ getHasPermissions(Container $container) : HasPermissions
+ getHiddenFields(Container $container) : HiddenFields
+ getHistory(Container $container) : History
+ getIntegerFields(Container $container) : IntegerFields
+ getItemsMethodEximportString(Container $container) : ItemsMethodEximportString
+ getItemsMethodListString(Container $container) : ItemsMethodListString
+ getJsonItem(Container $container) : JsonItem
+ getJsonItemArray(Container $container) : JsonItemArray
+ getJsonString(Container $container) : JsonString
+ getLanguageMessages(Container $container) : LanguageMessages
+ getLayout(Container $container) : Layout
+ getLayoutData(Container $container) : LayoutData
@ -93,6 +45,7 @@ class Builder #Gold {
+ getPermissionGlobalAction(Container $container) : PermissionGlobalAction
+ getPermissionViews(Container $container) : PermissionViews
+ getRequest(Container $container) : Request
+ getRouter(Container $container) : Router
+ getScriptMediaSwitch(Container $container) : ScriptMediaSwitch
+ getScriptUserSwitch(Container $container) : ScriptUserSwitch
+ getSearch(Container $container) : Search
@ -114,707 +67,378 @@ class Builder #Gold {
+ getViewsDefaultOrdering(Container $container) : ViewsDefaultOrdering
}
note right of Builder::register
note right of BuilderLZ::register
Registers the service provider with a DI container.
since: 3.2.0
return: void
end note
note left of Builder::getAccessSwitch
Get The AccessSwitch Class.
since: 3.2.0
return: AccessSwitch
end note
note right of Builder::getAccessSwitchList
Get The AccessSwitchList Class.
since: 3.2.0
return: AccessSwitchList
end note
note left of Builder::getAssetsRules
Get The AssetsRules Class.
since: 3.2.0
return: AssetsRules
end note
note right of Builder::getAdminFilterType
Get The AdminFilterType Class.
since: 3.2.0
return: AdminFilterType
end note
note left of Builder::getAlias
Get The Alias Class.
since: 3.2.0
return: Alias
end note
note right of Builder::getBaseSixFour
Get The BaseSixFour Class.
since: 3.2.0
return: BaseSixFour
end note
note left of Builder::getCategory
Get The Category Class.
since: 3.2.0
return: Category
end note
note right of Builder::getCategoryCode
Get The CategoryCode Class.
since: 3.2.0
return: CategoryCode
end note
note left of Builder::getCategoryOtherName
Get The CategoryOtherName Class.
since: 3.2.0
return: CategoryOtherName
end note
note right of Builder::getCheckBox
Get The CheckBox Class.
since: 3.2.0
return: CheckBox
end note
note left of Builder::getComponentFields
Get The ComponentFields Class.
since: 3.2.0
return: ComponentFields
end note
note right of Builder::getConfigFieldsets
Get The ConfigFieldsets Class.
since: 3.2.0
return: ConfigFieldsets
end note
note left of Builder::getConfigFieldsetsCustomfield
Get The ConfigFieldsetsCustomfield Class.
since: 3.2.0
return: ConfigFieldsetsCustomfield
end note
note right of Builder::getContentMulti
Get The ContentMulti Class.
since: 3.2.0
return: ContentMulti
end note
note left of Builder::getContentOne
Get The ContentOne Class.
since: 3.2.0
return: ContentOne
end note
note right of Builder::getContributors
Get The Contributors Class.
since: 3.2.0
return: Contributors
end note
note left of Builder::getCustomAlias
Get The CustomAlias Class.
since: 3.2.0
return: CustomAlias
end note
note right of Builder::getCustomField
Get The CustomField Class.
since: 3.2.0
return: CustomField
end note
note left of Builder::getCustomFieldLinks
Get The CustomFieldLinks Class.
since: 3.2.0
return: CustomFieldLinks
end note
note right of Builder::getCustomList
Get The CustomList Class.
since: 3.2.0
return: CustomList
end note
note left of Builder::getCustomTabs
Get The CustomTabs Class.
since: 3.2.0
return: CustomTabs
end note
note right of Builder::getDatabaseKeys
Get The DatabaseKeys Class.
since: 3.2.0
return: DatabaseKeys
end note
note left of Builder::getDatabaseTables
Get The DatabaseTables Class.
since: 3.2.0
return: DatabaseTables
end note
note right of Builder::getDatabaseUniqueGuid
Get The DatabaseUniqueGuid Class.
since: 3.2.0
return: DatabaseUniqueGuid
end note
note left of Builder::getDatabaseUniqueKeys
Get The DatabaseUniqueKeys Class.
since: 3.2.0
return: DatabaseUniqueKeys
end note
note right of Builder::getDoNotEscape
Get The DoNotEscape Class.
since: 3.2.0
return: DoNotEscape
end note
note left of Builder::getDynamicFields
Get The DynamicFields Class.
since: 3.2.0
return: DynamicFields
end note
note right of Builder::getExtensionCustomFields
Get The ExtensionCustomFields Class.
since: 3.2.0
return: ExtensionCustomFields
end note
note left of Builder::getExtensionsParams
Get The ExtensionsParams Class.
since: 3.2.0
return: ExtensionsParams
end note
note right of Builder::getFieldGroupControl
Get The FieldGroupControl Class.
since: 3.2.0
return: FieldGroupControl
end note
note left of Builder::getFieldNames
Get The FieldNames Class.
since: 3.2.0
return: FieldNames
end note
note right of Builder::getFieldRelations
Get The FieldRelations Class.
since: 3.2.0
return: FieldRelations
end note
note left of Builder::getFilter
Get The Filter Class.
since: 3.2.0
return: Filter
end note
note right of Builder::getFootableScripts
Get The FootableScripts Class.
since: 3.2.0
return: FootableScripts
end note
note left of Builder::getFrontendParams
Get The FrontendParams Class.
since: 3.2.0
return: FrontendParams
end note
note right of Builder::getGetAsLookup
Get The GetAsLookup Class.
since: 3.2.0
return: GetAsLookup
end note
note left of Builder::getGetModule
Get The GetModule Class.
since: 3.2.0
return: GetModule
end note
note right of Builder::getGoogleChart
Get The GoogleChart Class.
since: 3.2.0
return: GoogleChart
end note
note left of Builder::getHasMenuGlobal
Get The HasMenuGlobal Class.
since: 3.2.0
return: HasMenuGlobal
end note
note right of Builder::getHasPermissions
Get The HasPermissions Class.
since: 3.2.0
return: HasPermissions
end note
note left of Builder::getHiddenFields
Get The HiddenFields Class.
since: 3.2.0
return: HiddenFields
end note
note right of Builder::getHistory
Get The History Class.
since: 3.2.0
return: History
end note
note left of Builder::getIntegerFields
Get The IntegerFields Class.
since: 3.2.0
return: IntegerFields
end note
note right of Builder::getItemsMethodEximportString
Get The ItemsMethodEximportString Class.
since: 3.2.0
return: ItemsMethodEximportString
end note
note left of Builder::getItemsMethodListString
Get The ItemsMethodListString Class.
since: 3.2.0
return: ItemsMethodListString
end note
note right of Builder::getJsonItem
Get The JsonItem Class.
since: 3.2.0
return: JsonItem
end note
note left of Builder::getJsonItemArray
Get The JsonItemArray Class.
since: 3.2.0
return: JsonItemArray
end note
note right of Builder::getJsonString
Get The JsonString Class.
since: 3.2.0
return: JsonString
end note
note left of Builder::getLanguageMessages
note left of BuilderLZ::getLanguageMessages
Get The LanguageMessages Class.
since: 3.2.0
return: LanguageMessages
end note
note right of Builder::getLayout
note right of BuilderLZ::getLayout
Get The Layout Class.
since: 3.2.0
return: Layout
end note
note left of Builder::getLayoutData
note left of BuilderLZ::getLayoutData
Get The LayoutData Class.
since: 3.2.0
return: LayoutData
end note
note right of Builder::getLibraryManager
note right of BuilderLZ::getLibraryManager
Get The LibraryManager Class.
since: 3.2.0
return: LibraryManager
end note
note left of Builder::getListFieldClass
note left of BuilderLZ::getListFieldClass
Get The ListFieldClass Class.
since: 3.2.0
return: ListFieldClass
end note
note right of Builder::getListHeadOverride
note right of BuilderLZ::getListHeadOverride
Get The ListHeadOverride Class.
since: 3.2.0
return: ListHeadOverride
end note
note left of Builder::getListJoin
note left of BuilderLZ::getListJoin
Get The ListJoin Class.
since: 3.2.0
return: ListJoin
end note
note right of Builder::getLists
note right of BuilderLZ::getLists
Get The Lists Class.
since: 3.2.0
return: Lists
end note
note left of Builder::getMainTextField
note left of BuilderLZ::getMainTextField
Get The MainTextField Class.
since: 3.2.0
return: MainTextField
end note
note right of Builder::getMetaData
note right of BuilderLZ::getMetaData
Get The MetaData Class.
since: 3.2.0
return: MetaData
end note
note left of Builder::getModelBasicField
note left of BuilderLZ::getModelBasicField
Get The ModelBasicField Class.
since: 3.2.0
return: ModelBasicField
end note
note right of Builder::getModelExpertField
note right of BuilderLZ::getModelExpertField
Get The ModelExpertField Class.
since: 3.2.0
return: ModelExpertField
end note
note left of Builder::getModelExpertFieldInitiator
note left of BuilderLZ::getModelExpertFieldInitiator
Get The ModelExpertFieldInitiator Class.
since: 3.2.0
return: ModelExpertFieldInitiator
end note
note right of Builder::getModelMediumField
note right of BuilderLZ::getModelMediumField
Get The ModelMediumField Class.
since: 3.2.0
return: ModelMediumField
end note
note left of Builder::getModelWhmcsField
note left of BuilderLZ::getModelWhmcsField
Get The ModelWhmcsField Class.
since: 3.2.0
return: ModelWhmcsField
end note
note right of Builder::getMovedPublishingFields
note right of BuilderLZ::getMovedPublishingFields
Get The MovedPublishingFields Class.
since: 3.2.0
return: MovedPublishingFields
end note
note left of Builder::getMysqlTableSetting
note left of BuilderLZ::getMysqlTableSetting
Get The MysqlTableSetting Class.
since: 3.2.0
return: MysqlTableSetting
end note
note right of Builder::getNewPublishingFields
note right of BuilderLZ::getNewPublishingFields
Get The NewPublishingFields Class.
since: 3.2.0
return: NewPublishingFields
end note
note left of Builder::getOrderZero
note left of BuilderLZ::getOrderZero
Get The OrderZero Class.
since: 3.2.0
return: OrderZero
end note
note right of Builder::getOtherFilter
note right of BuilderLZ::getOtherFilter
Get The OtherFilter Class.
since: 3.2.0
return: OtherFilter
end note
note left of Builder::getOtherGroup
note left of BuilderLZ::getOtherGroup
Get The OtherGroup Class.
since: 3.2.0
return: OtherGroup
end note
note right of Builder::getOtherJoin
note right of BuilderLZ::getOtherJoin
Get The OtherJoin Class.
since: 3.2.0
return: OtherJoin
end note
note left of Builder::getOtherOrder
note left of BuilderLZ::getOtherOrder
Get The OtherOrder Class.
since: 3.2.0
return: OtherOrder
end note
note right of Builder::getOtherQuery
note right of BuilderLZ::getOtherQuery
Get The OtherQuery Class.
since: 3.2.0
return: OtherQuery
end note
note left of Builder::getOtherWhere
note left of BuilderLZ::getOtherWhere
Get The OtherWhere Class.
since: 3.2.0
return: OtherWhere
end note
note right of Builder::getPermissionAction
note right of BuilderLZ::getPermissionAction
Get The PermissionAction Class.
since: 3.2.0
return: PermissionAction
end note
note left of Builder::getPermissionComponent
note left of BuilderLZ::getPermissionComponent
Get The PermissionComponent Class.
since: 3.2.0
return: PermissionComponent
end note
note right of Builder::getPermissionCore
note right of BuilderLZ::getPermissionCore
Get The PermissionCore Class.
since: 3.2.0
return: PermissionCore
end note
note left of Builder::getPermissionDashboard
note left of BuilderLZ::getPermissionDashboard
Get The PermissionDashboard Class.
since: 3.2.0
return: PermissionDashboard
end note
note right of Builder::getPermissionFields
note right of BuilderLZ::getPermissionFields
Get The PermissionFields Class.
since: 3.2.0
return: PermissionFields
end note
note left of Builder::getPermissionGlobalAction
note left of BuilderLZ::getPermissionGlobalAction
Get The PermissionGlobalAction Class.
since: 3.2.0
return: PermissionGlobalAction
end note
note right of Builder::getPermissionViews
note right of BuilderLZ::getPermissionViews
Get The PermissionViews Class.
since: 3.2.0
return: PermissionViews
end note
note left of Builder::getRequest
note left of BuilderLZ::getRequest
Get The Request Class.
since: 3.2.0
return: Request
end note
note right of Builder::getScriptMediaSwitch
note right of BuilderLZ::getRouter
Get The Router Class.
since: 3.2.0
return: Router
end note
note left of BuilderLZ::getScriptMediaSwitch
Get The ScriptMediaSwitch Class.
since: 3.2.0
return: ScriptMediaSwitch
end note
note left of Builder::getScriptUserSwitch
note right of BuilderLZ::getScriptUserSwitch
Get The ScriptUserSwitch Class.
since: 3.2.0
return: ScriptUserSwitch
end note
note right of Builder::getSearch
note left of BuilderLZ::getSearch
Get The Search Class.
since: 3.2.0
return: Search
end note
note left of Builder::getSelectionTranslation
note right of BuilderLZ::getSelectionTranslation
Get The SelectionTranslation Class.
since: 3.2.0
return: SelectionTranslation
end note
note right of Builder::getSiteDecrypt
note left of BuilderLZ::getSiteDecrypt
Get The SiteDecrypt Class.
since: 3.2.0
return: SiteDecrypt
end note
note left of Builder::getSiteDynamicGet
note right of BuilderLZ::getSiteDynamicGet
Get The SiteDynamicGet Class.
since: 3.2.0
return: SiteDynamicGet
end note
note right of Builder::getSiteEditView
note left of BuilderLZ::getSiteEditView
Get The SiteEditView Class.
since: 3.2.0
return: SiteEditView
end note
note left of Builder::getSiteFieldData
note right of BuilderLZ::getSiteFieldData
Get The SiteFieldData Class.
since: 3.2.0
return: SiteFieldData
end note
note right of Builder::getSiteFieldDecodeFilter
note left of BuilderLZ::getSiteFieldDecodeFilter
Get The SiteFieldDecodeFilter Class.
since: 3.2.0
return: SiteFieldDecodeFilter
end note
note left of Builder::getSiteFields
note right of BuilderLZ::getSiteFields
Get The SiteFields Class.
since: 3.2.0
return: SiteFields
end note
note right of Builder::getSiteMainGet
note left of BuilderLZ::getSiteMainGet
Get The SiteMainGet Class.
since: 3.2.0
return: SiteMainGet
end note
note left of Builder::getSort
note right of BuilderLZ::getSort
Get The Sort Class.
since: 3.2.0
return: Sort
end note
note right of Builder::getTabCounter
note left of BuilderLZ::getTabCounter
Get The TabCounter Class.
since: 3.2.0
return: TabCounter
end note
note left of Builder::getTags
note right of BuilderLZ::getTags
Get The Tags Class.
since: 3.2.0
return: Tags
end note
note right of Builder::getTemplateData
note left of BuilderLZ::getTemplateData
Get The TemplateData Class.
since: 3.2.0
return: TemplateData
end note
note left of Builder::getTitle
note right of BuilderLZ::getTitle
Get The Title Class.
since: 3.2.0
return: Title
end note
note right of Builder::getUikitComp
note left of BuilderLZ::getUikitComp
Get The UikitComp Class.
since: 3.2.0
return: UikitComp
end note
note left of Builder::getUpdateMysql
note right of BuilderLZ::getUpdateMysql
Get The UpdateMysql Class.
since: 3.2.0
return: UpdateMysql
end note
note right of Builder::getViewsDefaultOrdering
note left of BuilderLZ::getViewsDefaultOrdering
Get The ViewsDefaultOrdering Class.
since: 3.2.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,414 +7,226 @@
"-1"
],
"load_selection": null,
"name": "Builder",
"name": "BuilderLZ",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Service.Builder",
"system_name": "JCB.Compiler.Service.BuilderLZ",
"type": "class",
"use_selection": {
"use_selection0": {
"use": "e38a5276-6664-4bc6-8002-0562fcc248f8",
"as": "default"
},
"use_selection1": {
"use": "81212121-ad5c-43c5-b046-f2650864f690",
"as": "default"
},
"use_selection2": {
"use": "9b5872d6-c1d8-4602-b443-5844d2c950ee",
"as": "default"
},
"use_selection3": {
"use": "9481caa2-6d04-4598-8320-543a93927243",
"as": "default"
},
"use_selection4": {
"use": "fe87df7f-b65f-4778-8875-6122ab6b025f",
"as": "default"
},
"use_selection5": {
"use": "b8b474d4-30e3-4b5a-9988-3adb3450998c",
"as": "default"
},
"use_selection6": {
"use": "007177eb-d39d-4093-8840-07a38811c502",
"as": "default"
},
"use_selection7": {
"use": "b24f5184-7e7c-448d-9475-ff3f998f70c3",
"as": "default"
},
"use_selection8": {
"use": "a1e551a9-8369-48c9-a076-4e5beb65e0df",
"as": "default"
},
"use_selection9": {
"use": "8561f1f6-96c7-4e54-8869-0132116d57ce",
"as": "default"
},
"use_selection10": {
"use": "3230dd65-6590-4043-9bb8-bebd6d8224b2",
"as": "default"
},
"use_selection11": {
"use": "0a524af3-f647-4f62-a422-d7d36ebe749b",
"as": "default"
},
"use_selection12": {
"use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b",
"as": "default"
},
"use_selection13": {
"use": "5f57ff1a-c196-45b1-a2ac-33766b44fb95",
"as": "default"
},
"use_selection14": {
"use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75",
"as": "default"
},
"use_selection99": {
"use": "274a78d1-24c2-4486-b560-b86e9ae72872",
"as": "default"
},
"use_selection15": {
"use": "9d74d613-5ef7-4cf1-9f12-64f0a8e19806",
"as": "default"
},
"use_selection16": {
"use": "87d1da23-08d6-4fbf-bd0d-b746da240b8a",
"as": "default"
},
"use_selection17": {
"use": "a4857c60-680c-4e0c-ae8f-9250a7b5e317",
"as": "default"
},
"use_selection18": {
"use": "202f748a-516b-4782-962e-ac9725c3cac4",
"as": "default"
},
"use_selection19": {
"use": "9551b683-67b6-4367-bb14-4b016def37e3",
"as": "default"
},
"use_selection20": {
"use": "0d8db719-39a6-48b4-85a6-2f97e784e588",
"as": "default"
},
"use_selection21": {
"use": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996",
"as": "default"
},
"use_selection22": {
"use": "58b7f907-4195-4ca3-886c-17877be59887",
"as": "default"
},
"use_selection23": {
"use": "ce0899a9-6271-4fc4-800a-697c122bb112",
"as": "default"
},
"use_selection24": {
"use": "0d9d3294-0bed-4c44-b1a1-e172f62cafb2",
"as": "default"
},
"use_selection25": {
"use": "1ae9a8e8-59f7-4844-a08d-9a4dce4be076",
"as": "default"
},
"use_selection26": {
"use": "e9b6b06b-f600-4f9d-984d-79c70ae7ae92",
"as": "default"
},
"use_selection27": {
"use": "bcf1e767-1566-440d-9f67-5c1bada934fa",
"as": "default"
},
"use_selection28": {
"use": "d5530adf-c809-45a9-87fc-7cecd3d972d8",
"as": "default"
},
"use_selection29": {
"use": "961a2a2e-9f95-4b5f-b1c0-62ee783f9c66",
"as": "default"
},
"use_selection30": {
"use": "a090a472-eb3d-4086-a6d5-4215e1b1851f",
"as": "default"
},
"use_selection31": {
"use": "e4e65c5b-00ec-439c-96bf-3153c3a73398",
"as": "default"
},
"use_selection32": {
"use": "dba0776e-e582-4f73-af3e-e7ed17bc34b3",
"as": "default"
},
"use_selection33": {
"use": "207b5ef3-b3bb-45bf-af14-4572e296d761",
"as": "default"
},
"use_selection34": {
"use": "8f46f85d-7921-44e9-a40e-dc4f01c5d43a",
"as": "default"
},
"use_selection35": {
"use": "c7b6f0d5-ec47-4166-915c-e78d49b4fb63",
"as": "default"
},
"use_selection36": {
"use": "507ab90f-7d64-4697-9815-d96f5d1d1185",
"as": "default"
},
"use_selection37": {
"use": "6992384f-4f29-489f-a52e-286e03f4593b",
"as": "default"
},
"use_selection38": {
"use": "e54965e7-34fd-481e-b40c-4da089afec5a",
"as": "default"
},
"use_selection39": {
"use": "0b45357f-b077-4337-92f3-65c1e19d36cd",
"as": "default"
},
"use_selection40": {
"use": "2cb33994-052e-42dd-adbc-3ea9f932816f",
"as": "default"
},
"use_selection41": {
"use": "952423ba-015a-4104-89a4-030695aa4d15",
"as": "default"
},
"use_selection42": {
"use": "1f086665-c007-4085-b363-3a118659ff1b",
"as": "default"
},
"use_selection43": {
"use": "972c4de9-6f6f-463b-8eea-cc7cbdb96aba",
"as": "default"
},
"use_selection44": {
"use": "45652787-9085-4c67-914f-0da25ae62646",
"as": "default"
},
"use_selection45": {
"use": "6b386f2e-3eb1-4f60-81af-a90c8da1ffeb",
"as": "default"
},
"use_selection46": {
"use": "bb26cf63-69a5-4c43-b2df-43284c9d907d",
"as": "default"
},
"use_selection47": {
"use": "44efa649-736d-4656-a0ec-e4f1653a6742",
"as": "default"
},
"use_selection48": {
"use_selection1": {
"use": "a90a2495-9c26-446c-867e-9ee8f42fb6af",
"as": "default"
},
"use_selection49": {
"use_selection2": {
"use": "7415fdb4-5719-40b7-b01f-05588e968b47",
"as": "default"
},
"use_selection50": {
"use_selection3": {
"use": "e696927b-e8f4-4cfc-9d25-215db4e3c7a8",
"as": "default"
},
"use_selection51": {
"use_selection4": {
"use": "c8c5d364-d2bf-41c0-8c64-6b6fed1a28b6",
"as": "default"
},
"use_selection52": {
"use_selection5": {
"use": "7506a35c-fa32-44ab-bd41-363439b20b82",
"as": "default"
},
"use_selection53": {
"use_selection6": {
"use": "597663e1-1c02-43e8-aea5-f2161e38ac7f",
"as": "default"
},
"use_selection54": {
"use_selection7": {
"use": "4a857023-2d96-4649-9ed5-910d0329854d",
"as": "default"
},
"use_selection55": {
"use_selection8": {
"use": "c6de9da0-1a73-4c73-b355-7fe02efe4c9d",
"as": "default"
},
"use_selection56": {
"use_selection9": {
"use": "f052eeef-5112-4efe-98c8-8c7db69dc2d1",
"as": "default"
},
"use_selection57": {
"use_selection10": {
"use": "a5189bfe-6d15-4452-9fa5-e3e57f7fa791",
"as": "default"
},
"use_selection58": {
"use_selection11": {
"use": "b8a92303-8543-4d88-a83c-ece300eaba6d",
"as": "default"
},
"use_selection59": {
"use_selection12": {
"use": "3468b447-a929-4c28-84a1-f2c3a27e3127",
"as": "default"
},
"use_selection60": {
"use_selection13": {
"use": "b0b26749-5e2c-4b56-8982-48172f2531fa",
"as": "default"
},
"use_selection61": {
"use_selection14": {
"use": "28cac2bb-df04-454f-b4d6-923b573eb94e",
"as": "default"
},
"use_selection62": {
"use_selection15": {
"use": "9cdff2af-bd1b-452f-810e-d034b9720d2a",
"as": "default"
},
"use_selection63": {
"use_selection16": {
"use": "9ff6d6cd-afea-4f15-a67b-fd132d386989",
"as": "default"
},
"use_selection64": {
"use_selection17": {
"use": "0f141480-afe6-41fb-996c-2a4e566a2f0d",
"as": "default"
},
"use_selection65": {
"use_selection18": {
"use": "66b7b5f8-60d6-427a-9f8c-84c11a3d6780",
"as": "default"
},
"use_selection66": {
"use_selection19": {
"use": "9d1eec29-f304-4b08-a3e7-8b2d6b1f4a1f",
"as": "default"
},
"use_selection67": {
"use_selection20": {
"use": "bf92e1c1-3d5e-4e9d-a585-c79e1468df33",
"as": "default"
},
"use_selection68": {
"use_selection21": {
"use": "46b02edb-427e-4c26-a5cb-279828eb4433",
"as": "default"
},
"use_selection69": {
"use_selection22": {
"use": "3f83fe11-1ef6-4020-bd73-f3bb58cefe3a",
"as": "default"
},
"use_selection70": {
"use_selection23": {
"use": "74595661-236d-4aa1-99f3-358d093000be",
"as": "default"
},
"use_selection71": {
"use_selection24": {
"use": "fd885c23-88dd-440a-9b05-d02a2b2962f9",
"as": "default"
},
"use_selection72": {
"use_selection25": {
"use": "2528f2bb-6ebc-4d55-9a9d-23ef58534c1a",
"as": "default"
},
"use_selection73": {
"use_selection26": {
"use": "94f4939f-82cc-4196-802b-1346ce5c7f99",
"as": "default"
},
"use_selection74": {
"use_selection27": {
"use": "5e3d856d-8174-4131-b4e9-9328066438e1",
"as": "default"
},
"use_selection75": {
"use_selection28": {
"use": "e046b530-47fe-406f-b45a-b5eec8cbb238",
"as": "default"
},
"use_selection76": {
"use_selection29": {
"use": "5133a033-1351-43ec-9692-2907d7b9aacd",
"as": "default"
},
"use_selection77": {
"use_selection30": {
"use": "a601888d-12b6-427f-94ae-95004206e24e",
"as": "default"
},
"use_selection78": {
"use_selection31": {
"use": "480d11b9-783b-45d5-bce1-b0c2fcaad08a",
"as": "default"
},
"use_selection79": {
"use_selection32": {
"use": "98419ff3-6628-4539-8365-37f88378bced",
"as": "default"
},
"use_selection80": {
"use_selection33": {
"use": "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5",
"as": "default"
},
"use_selection34": {
"use": "17bf80af-3609-4f36-a520-be1a339c278b",
"as": "default"
},
"use_selection81": {
"use_selection35": {
"use": "9042fac6-5ca5-4ebe-94fe-cf9b0718ed36",
"as": "default"
},
"use_selection82": {
"use_selection36": {
"use": "2e764839-8ec6-4726-af50-b5678e0714a4",
"as": "default"
},
"use_selection83": {
"use_selection37": {
"use": "d8e46d2c-d63e-4b92-80a2-d17638a7ae9e",
"as": "default"
},
"use_selection84": {
"use_selection38": {
"use": "c0e46033-5ade-4829-88b7-ca160d36a4d1",
"as": "default"
},
"use_selection85": {
"use_selection39": {
"use": "ec0682ee-9166-48f8-951b-9b763792c1d1",
"as": "default"
},
"use_selection86": {
"use_selection40": {
"use": "abdb7d20-a15e-42d8-bd91-7b09514df7f2",
"as": "default"
},
"use_selection87": {
"use_selection41": {
"use": "33f5131e-4a5b-414b-95dd-d22227c2666d",
"as": "default"
},
"use_selection88": {
"use_selection42": {
"use": "d393c946-4481-43fa-b737-449119dd0a63",
"as": "default"
},
"use_selection89": {
"use_selection43": {
"use": "52de0ac8-bb9d-4a45-bd2a-a44c48c17ffe",
"as": "default"
},
"use_selection90": {
"use_selection44": {
"use": "17fa7789-a7d1-465e-b733-8c8d53f5ca1b",
"as": "default"
},
"use_selection91": {
"use_selection45": {
"use": "94e0beae-7daa-43b2-81b9-0bde390a76d8",
"as": "default"
},
"use_selection92": {
"use_selection46": {
"use": "d645881c-ae8c-4828-a217-6bad98cd3b44",
"as": "default"
},
"use_selection93": {
"use_selection47": {
"use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903",
"as": "default"
},
"use_selection94": {
"use_selection48": {
"use": "8591f6db-dd3c-4a63-9b3f-574c0ec74ade",
"as": "default"
},
"use_selection95": {
"use_selection49": {
"use": "6a1dddb3-a955-425e-b713-8ef81f256035",
"as": "default"
},
"use_selection96": {
"use_selection50": {
"use": "54ec57f6-2fc3-42e5-975e-1fabeacb845d",
"as": "default"
},
"use_selection97": {
"use_selection51": {
"use": "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9",
"as": "default"
},
"use_selection98": {
"use_selection52": {
"use": "f34442df-c84c-44c3-9991-bbf72bffa635",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Builder",
"description": "Builder Service Provider\r\n\r\n@since 3.2.0",
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.BuilderLZ",
"description": "Builder L-Z Service Provider\r\n\r\n@since 3.2.0",
"implements_custom": "ServiceProviderInterface",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;",

View File

@ -13,9 +13,6 @@ namespace VDM\Joomla\Componentbuilder\Compiler;
use Joomla\CMS\Factory;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
@ -23,6 +20,9 @@ use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor;
use VDM\Joomla\Componentbuilder\Compiler\Power\Extractor as Power;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\External;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\CustomcodeInterface;

View File

@ -12,18 +12,6 @@
"system_name": "JCB.Compiler.Customcode",
"type": "class",
"use_selection": {
"use_selection0": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection1": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection2": {
"use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
"as": "default"
},
"use_selection3": {
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",
"as": "Compiler"
@ -51,6 +39,18 @@
"use_selection9": {
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
"as": "default"
},
"use_selection1": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection0": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection2": {
"use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode",

View File

@ -0,0 +1,46 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class CanEditState (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model**
```uml
@startuml
class CanEditState << (F,LightGreen) >> #RoyalBlue {
# String $component
# Permission $permission
+ __construct(Config $config, Permission $permission)
+ get(string $nameSingleCode) : string
}
note right of CanEditState::__construct
Constructor.
since: 3.2.0
end note
note right of CanEditState::get
Get Can Edit State Function Code
since: 3.2.0
return: string
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,108 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
/**
* Model Can Edit State Class for Joomla 5
*
* @since 3.2.0
*/
final class CanEditState implements CanEditStateInterface
{
/**
* The Component code name.
*
* @var String
* @since 3.2.0
*/
protected String $component;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Permission $permission The Permission Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Permission $permission)
{
$this->component = $config->component_code_name;
$this->permission = $permission;
}
/**
* Get Can Edit State Function Code
*
* @param string $nameSingleCode The single code name of the view.
*
* @since 3.2.0
* @return string The can edit state method code
*/
public function get(string $nameSingleCode): string
{
$allow = [];
// setup the default script
$allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();";
$allow[] = Indent::_(2)
. "\$recordId = \$record->id ?? 0;";
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " The record has been set. Check the record permissions.";
// check if the item has permissions.
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
. $this->permission->getAction($nameSingleCode, 'core.edit.state')
. "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);";
$allow[] = Indent::_(3)
. "if (!\$permission && !is_null(\$permission))";
$allow[] = Indent::_(3) . "{";
$allow[] = Indent::_(4) . "return false;";
$allow[] = Indent::_(3) . "}";
$allow[] = Indent::_(2) . "}";
if ($this->permission->globalExist($nameSingleCode, 'core.edit.state'))
{
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2) . "return \$user->authorise('"
. $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component
. "');";
}
else
{
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2)
. "return parent::canEditState(\$record);";
}
return implode(PHP_EOL, $allow);
}
}

View File

@ -0,0 +1,78 @@
/**
* The Component code name.
*
* @var String
* @since 3.2.0
*/
protected String $component;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Permission $permission The Permission Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Permission $permission)
{
$this->component = $config->component_code_name;
$this->permission = $permission;
}
/**
* Get Can Edit State Function Code
*
* @param string $nameSingleCode The single code name of the view.
*
* @since 3.2.0
* @return string The can edit state method code
*/
public function get(string $nameSingleCode): string
{
$allow = [];
// setup the default script
$allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();";
$allow[] = Indent::_(2)
. "\$recordId = \$record->id ?? 0;";
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " The record has been set. Check the record permissions.";
// check if the item has permissions.
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
. $this->permission->getAction($nameSingleCode, 'core.edit.state')
. "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);";
$allow[] = Indent::_(3)
. "if (!\$permission && !is_null(\$permission))";
$allow[] = Indent::_(3) . "{";
$allow[] = Indent::_(4) . "return false;";
$allow[] = Indent::_(3) . "}";
$allow[] = Indent::_(2) . "}";
if ($this->permission->globalExist($nameSingleCode, 'core.edit.state'))
{
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2) . "return \$user->authorise('"
. $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component
. "');";
}
else
{
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " In the absence of better information, revert to the component permissions.";
$allow[] = Indent::_(2)
. "return parent::canEditState(\$record);";
}
return implode(PHP_EOL, $allow);
}

View File

@ -0,0 +1,37 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "318a98a3-bb6f-42cb-a000-352d4c848b51",
"implements": [
"600515b1-493f-4448-96fe-018e54e087c8"
],
"load_selection": null,
"name": "CanEditState",
"power_version": "1.0.0",
"system_name": "JCB.Architecture.J5.Model.CanEditState",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection1": {
"use": "7f01622a-74c9-4e67-b111-3eb488035206",
"as": "default"
},
"use_selection2": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection3": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFive.Model.CanEditState",
"description": "Model Can Edit State Class for Joomla 5\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -12,6 +12,7 @@
@startuml
class Structure #Gold {
# array $htaccess
# array $done
# Power $power
# Config $config
# Registry $registry

View File

@ -48,6 +48,22 @@ class Structure
**/
protected array $htaccess = [];
/**
* Power Build Tracker
*
* @var array
* @since 3.2.0
**/
protected array $done = [];
/**
* Path Build Tracker
*
* @var array
* @since 3.2.0
**/
protected array $path_done = [];
/**
* Power Objects
*
@ -172,22 +188,21 @@ class Structure
{
if (ArrayHelper::check($this->power->active))
{
// for plugin event TODO change event api signatures
$powers = $this->power->active;
$component_context = $this->config->component_context;
// Trigger Event: jcb_ce_onBeforeSetModules
$this->event->trigger(
'jcb_ce_onBeforeBuildPowers',
array(&$component_context, &$powers)
'jcb_ce_onBeforeBuildPowers'
);
// for plugin event TODO change event api signatures
$this->power->active = $powers;
// set super power details
$this->setSuperPowerDetails();
foreach ($this->power->active as $power)
foreach ($this->power->active as $guid => $power)
{
if (isset($this->done[$guid]))
{
continue;
}
if (ObjectHelper::check($power)
&& isset($power->path)
&& StringHelper::check(
@ -232,6 +247,9 @@ class Structure
// set htaccess once per path
$this->setHtaccess($power);
// do each power just once
$this->done[$guid] = true;
}
}
}
@ -384,6 +402,11 @@ class Structure
{
foreach ($this->power->superpowers as $path => $powers)
{
if (isset($this->path_done[$path]))
{
continue;
}
// get existing files
$this->loadExistingSuperPower($path);
@ -399,6 +422,9 @@ class Structure
// set the super power index file
$this->createFile(Placefix::_h('POWERINDEX'), $path,
'super-powers.json', $key);
// do each path just once
$this->path_done[$path] = true;
}
}
}
@ -450,7 +476,7 @@ class Structure
*/
private function loadExistingSuperPower(string $repository)
{
if (($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null &&
if (!isset($this->power->old_superpowers[$repository]) && ($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null &&
JsonHelper::check($content))
{
$this->power->old_superpowers[$repository] = json_decode($content, true);

View File

@ -6,6 +6,22 @@
**/
protected array $htaccess = [];
/**
* Power Build Tracker
*
* @var array
* @since 3.2.0
**/
protected array $done = [];
/**
* Path Build Tracker
*
* @var array
* @since 3.2.0
**/
protected array $path_done = [];
/**
* Power Objects
*
@ -130,22 +146,21 @@
{
if (ArrayHelper::check($this->power->active))
{
// for plugin event TODO change event api signatures
$powers = $this->power->active;
$component_context = $this->config->component_context;
// Trigger Event: jcb_ce_onBeforeSetModules
$this->event->trigger(
'jcb_ce_onBeforeBuildPowers',
array(&$component_context, &$powers)
'jcb_ce_onBeforeBuildPowers'
);
// for plugin event TODO change event api signatures
$this->power->active = $powers;
// set super power details
$this->setSuperPowerDetails();
foreach ($this->power->active as $power)
foreach ($this->power->active as $guid => $power)
{
if (isset($this->done[$guid]))
{
continue;
}
if (ObjectHelper::check($power)
&& isset($power->path)
&& StringHelper::check(
@ -190,6 +205,9 @@
// set htaccess once per path
$this->setHtaccess($power);
// do each power just once
$this->done[$guid] = true;
}
}
}
@ -342,6 +360,11 @@
{
foreach ($this->power->superpowers as $path => $powers)
{
if (isset($this->path_done[$path]))
{
continue;
}
// get existing files
$this->loadExistingSuperPower($path);
@ -357,6 +380,9 @@
// set the super power index file
$this->createFile(Placefix::_h('POWERINDEX'), $path,
'super-powers.json', $key);
// do each path just once
$this->path_done[$path] = true;
}
}
}
@ -408,7 +434,7 @@
*/
private function loadExistingSuperPower(string $repository)
{
if (($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null &&
if (!isset($this->power->old_superpowers[$repository]) && ($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null &&
JsonHelper::check($content))
{
$this->power->old_superpowers[$repository] = json_decode($content, true);

View File

@ -0,0 +1,46 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class CanDelete (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model**
```uml
@startuml
class CanDelete << (F,LightGreen) >> #RoyalBlue {
# String $component
# Permission $permission
+ __construct(Config $config, Permission $permission)
+ get(string $nameSingleCode) : string
}
note right of CanDelete::__construct
Constructor.
since: 3.2.0
end note
note right of CanDelete::get
Get Can Delete Function Code
since: 3.2.0
return: string
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,87 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
/**
* Model Can Delete Class for Joomla 5
*
* @since 3.2.0
*/
final class CanDelete implements CanDeleteInterface
{
/**
* The Component code name.
*
* @var String
* @since 3.2.0
*/
protected String $component;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Permission $permission The Permission Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Permission $permission)
{
$this->component = $config->component_code_name;
$this->permission = $permission;
}
/**
* Get Can Delete Function Code
*
* @param string $nameSingleCode The single code name of the view.
*
* @since 3.2.0
* @return string The can delete method code
*/
public function get(string $nameSingleCode): string
{
$allow = [];
// setup the default script
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "return false;";
$allow[] = Indent::_(2) . "}" . PHP_EOL;
// check if the item has permissions.
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " The record has been set. Check the record permissions.";
$allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('"
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
. $nameSingleCode . ".' . (int) \$record->id);";
return implode(PHP_EOL, $allow);
}
}

View File

@ -0,0 +1,57 @@
/**
* The Component code name.
*
* @var String
* @since 3.2.0
*/
protected String $component;
/**
* The Permission Class.
*
* @var Permission
* @since 3.2.0
*/
protected Permission $permission;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Permission $permission The Permission Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Permission $permission)
{
$this->component = $config->component_code_name;
$this->permission = $permission;
}
/**
* Get Can Delete Function Code
*
* @param string $nameSingleCode The single code name of the view.
*
* @since 3.2.0
* @return string The can delete method code
*/
public function get(string $nameSingleCode): string
{
$allow = [];
// setup the default script
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
$allow[] = Indent::_(2) . "{";
$allow[] = Indent::_(3) . "return false;";
$allow[] = Indent::_(2) . "}" . PHP_EOL;
// check if the item has permissions.
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " The record has been set. Check the record permissions.";
$allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('"
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
. $nameSingleCode . ".' . (int) \$record->id);";
return implode(PHP_EOL, $allow);
}

View File

@ -0,0 +1,37 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "34df20ec-67db-4e7e-be61-fb94d360c408",
"implements": [
"e00a7d1d-6d80-41c5-bf13-32d41bc5bf91"
],
"load_selection": null,
"name": "CanDelete",
"power_version": "1.0.0",
"system_name": "JCB.Architecture.J5.Model.CanDelete",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection1": {
"use": "7f01622a-74c9-4e67-b111-3eb488035206",
"as": "default"
},
"use_selection2": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection3": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Architecture.JoomlaFive.Model.CanDelete",
"description": "Model Can Delete Class for Joomla 5\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -16,6 +16,7 @@ class Header #Gold {
+ getHeader(Container $container) : HeaderInterface
+ getJ3Header(Container $container) : J3Header
+ getJ4Header(Container $container) : J4Header
+ getJ5Header(Container $container) : J5Header
}
note right of Header::register
@ -45,6 +46,13 @@ note right of Header::getJ4Header
since: 3.2.0
return: J4Header
end note
note right of Header::getJ5Header
Get The Header Class.
since: 3.2.0
return: J5Header
end note
@enduml
```

View File

@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Header as J3Header;
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Header as J4Header;
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\Header as J5Header;
/**
@ -50,6 +51,9 @@ class Header implements ServiceProviderInterface
$container->alias(J4Header::class, 'J4.Header')
->share('J4.Header', [$this, 'getJ4Header'], true);
$container->alias(J5Header::class, 'J5.Header')
->share('J5.Header', [$this, 'getJ5Header'], true);
$container->alias(HeaderInterface::class, 'Header')
->share('Header', [$this, 'getHeader'], true);
}
@ -118,6 +122,30 @@ class Header implements ServiceProviderInterface
$container->get('Compiler.Builder.Filter'),
$container->get('Compiler.Builder.Tags')
);
}
/**
* Get The Header Class.
*
* @param Container $container The DI container.
*
* @return J5Header
* @since 3.2.0
*/
public function getJ5Header(Container $container): J5Header
{
return new J5Header(
$container->get('Config'),
$container->get('Event'),
$container->get('Placeholder'),
$container->get('Language'),
$container->get('Compiler.Builder.Uikit.Comp'),
$container->get('Compiler.Builder.Admin.Filter.Type'),
$container->get('Compiler.Builder.Category'),
$container->get('Compiler.Builder.Access.Switch.List'),
$container->get('Compiler.Builder.Filter'),
$container->get('Compiler.Builder.Tags')
);
}
}

View File

@ -22,6 +22,9 @@
$container->alias(J4Header::class, 'J4.Header')
->share('J4.Header', [$this, 'getJ4Header'], true);
$container->alias(J5Header::class, 'J5.Header')
->share('J5.Header', [$this, 'getJ5Header'], true);
$container->alias(HeaderInterface::class, 'Header')
->share('Header', [$this, 'getHeader'], true);
}
@ -90,4 +93,28 @@
$container->get('Compiler.Builder.Filter'),
$container->get('Compiler.Builder.Tags')
);
}
/**
* Get The Header Class.
*
* @param Container $container The DI container.
*
* @return J5Header
* @since 3.2.0
*/
public function getJ5Header(Container $container): J5Header
{
return new J5Header(
$container->get('Config'),
$container->get('Event'),
$container->get('Placeholder'),
$container->get('Language'),
$container->get('Compiler.Builder.Uikit.Comp'),
$container->get('Compiler.Builder.Admin.Filter.Type'),
$container->get('Compiler.Builder.Category'),
$container->get('Compiler.Builder.Access.Switch.List'),
$container->get('Compiler.Builder.Filter'),
$container->get('Compiler.Builder.Tags')
);
}

View File

@ -23,6 +23,10 @@
"use_selection2": {
"use": "1ee227b9-da0f-4e7b-ae66-99a9d53f6f49",
"as": "J4Header"
},
"use_selection3": {
"use": "95deb809-5f43-400b-939f-f9ceef720b13",
"as": "J5Header"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Header",

View File

@ -0,0 +1,102 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class Router (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model**
```uml
@startuml
class Router #Gold {
# Config $config
# Dispenser $dispenser
# Builder $builder
# array $guiMapper
# array $targets
+ __construct(Config $config, Dispenser $dispenser, ...)
+ set(object $item) : void
# getSiteViews(array $siteViews, array $adminViews) : array
# getSiteEditViews(?array $views) : array
# getSiteViewAliasKey(?string $viewName, array $adminViews) : ?string
# getSiteEditViewAliasKey(?array $fields) : ?string
# getMainSelection(?array $gets) : array
}
note right of Router::__construct
Constructor.
since: 3.2.0
arguments:
Config $config
Dispenser $dispenser
Builder $builder
end note
note right of Router::set
Set Router
since: 3.2.0
return: void
end note
note right of Router::getSiteViews
Get the array of site views with additional details.
This method processes each site view to enrich it with additional details such as the associated table,
alias keys, and other relevant information. The enrichment is based on the view's settings and the admin views.
since: 3.2.0
return: array
end note
note right of Router::getSiteEditViews
Get the array of site edit views
This method processes the provided admin views to extract and return an array of site edit views.
Each site edit view is constructed based on specific conditions from the admin view's settings.
since: 3.2.0
return: array
end note
note right of Router::getSiteViewAliasKey
Get the site edit view alias key value
This method fetches the alias keys for a given site edit view by matching the view name
against a list of admin views. It processes the admin views to find a match and then
retrieves the alias keys from the matched view's settings.
since: 3.2.0
return: ?string
end note
note right of Router::getSiteEditViewAliasKey
Get the site view alias key value
since: 3.2.0
return: ?string
end note
note right of Router::getMainSelection
Get the view (main selection) table and view name value
from the main get object
since: 3.2.0
return: array
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,330 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
use VDM\Joomla\Componentbuilder\Compiler\Builder\Router as Builder;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\JsonHelper;
/**
* Model Component Site Router Class
*
* @since 3.2.0
*/
class Router
{
/**
* The Config Class.
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The Dispenser Class.
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* The Router Class.
*
* @var Builder
* @since 3.2.0
*/
protected Builder $builder;
/**
* The gui mapper array
*
* @var array
* @since 3.2.0
*/
protected array $guiMapper = [
'table' => 'component_router',
'id' => null,
'field' => null,
'type' => 'php'
];
/**
* The field targets
*
* @var array
* @since 3.2.0
*/
protected array $targets = [
'before' => 'constructor_before_parent',
'after' => 'constructor_after_parent',
'method' => 'methods'
];
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Dispenser $dispenser The Dispenser Class.
* @param Builder $builder The Router Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Dispenser $dispenser, Builder $builder)
{
$this->config = $config;
$this->dispenser = $dispenser;
$this->builder = $builder;
}
/**
* Set Router
*
* @param object $item The item data
*
* @return void
* @since 3.2.0
*/
public function set(object &$item)
{
$this->config->lang_target = 'site';
foreach ($this->targets as $target)
{
// add the code
if ($item->{"router_mode_{$target}"} == 3
&& StringHelper::check($item->{"router_{$target}_code"}))
{
// update GUI mapper field
$this->guiMapper['field'] = "{$target}_code";
$this->dispenser->set(
$item->{"router_{$target}_code"},
"_site_router_",
$target,
null,
$this->guiMapper
);
}
unset($item->{"router_{$target}_code"});
}
// get the site views
$views = $this->getSiteViews($item->site_views ?? [], $item->admin_views ?? []);
$edit_views = $this->getSiteEditViews($item->admin_views);
// get the edit site views
$this->builder->set('views',
ArrayHelper::merge([$views, $edit_views])
);
if ($item->router_mode_constructor_before_parent == 2
&& JsonHelper::check($item->router_constructor_before_parent_manual))
{
// build and validate the constructor before parent call code
$this->builder->set('manual',
json_decode($item->router_constructor_before_parent_manual)
);
}
// clear the data from the item
foreach ($this->targets as $key => $target)
{
// set the modes
$this->builder->set("mode_{$key}",
(int) $item->{"router_mode_{$target}"}
);
unset($item->{"router_mode_{$target}"});
}
unset($item->router_constructor_before_parent_manual);
}
/**
* Get the array of site views with additional details.
*
* This method processes each site view to enrich it with additional details such as the associated table,
* alias keys, and other relevant information. The enrichment is based on the view's settings and the admin views.
*
* @param array $siteViews The site views to be processed.
* @param array $adminViews The admin views used for fetching additional data.
*
* @return array An array of objects, each representing a site view with enriched details.
* @since 3.2.0
*/
protected function getSiteViews(array $siteViews, array $adminViews): array
{
return array_map(function ($view) use ($adminViews) {
// Attempt to get the main selection details from the view's settings.
$selection = $this->getMainSelection($view['settings']->main_get->main_get ?? null);
// We can only work with ID if the [main get] is a [getItem] dynamicGet for this site view.
$key = ($view['settings']->main_get->gettype == 1) ? 'id' : null;
// Construct the enriched view object.
return (object) [
'view' => $view['settings']->code,
'View' => $view['settings']->Code,
'stable' => ($selection['view'] === $view['settings']->code), // sanity check
'target_view' => $selection['view'],
'table' => $selection['table'],
'table_name' => $selection['name'],
'alias' => $this->getSiteViewAliasKey($selection['name'] ?? null, $adminViews),
'key' => $key,
'form' => false
];
}, $siteViews);
}
/**
* Get the array of site edit views
*
* This method processes the provided admin views to extract and return an array of site edit views.
* Each site edit view is constructed based on specific conditions from the admin view's settings.
*
* @param array|null $views The admin views to process.
*
* @return array An array of site edit views, each as an object with view, table, alias, key, and form properties.
* @since 3.2.0
*/
protected function getSiteEditViews(?array $views): array
{
$siteEditViews = [];
// Return early if no views are provided.
if (empty($views))
{
return $siteEditViews;
}
foreach ($views as $view)
{
// Check if the view is marked for edit/create on the site.
if (!empty($view['edit_create_site_view']))
{
$siteEditViews[] = (object) [
'view' => $view['settings']->name_single_code,
'View' => StringHelper::safe($view['settings']->name_single_code, 'F'),
'stable' => true,
'target_view' => $view['settings']->name_single_code,
'table' => '#__' . $this->config->component_code_name . '_' . $view['settings']->name_single_code,
'alias' => $this->getSiteEditViewAliasKey($view['settings']->fields ?? null),
'key' => 'id',
'form' => true
];
}
}
return $siteEditViews;
}
/**
* Get the site edit view alias key value
*
* This method fetches the alias keys for a given site edit view by matching the view name
* against a list of admin views. It processes the admin views to find a match and then
* retrieves the alias keys from the matched view's settings.
*
* @param string|null $viewName The view name to match.
* @param array $adminViews The admin views to search within.
*
* @return string|null The alias key for the site edit view, or null if not found.
* @since 3.2.0
*/
protected function getSiteViewAliasKey(?string $viewName, array $adminViews): ?string
{
// Return early if no view name is provided or admin views are empty.
if ($viewName === null || empty($adminViews))
{
return null;
}
foreach ($adminViews as $view)
{
// Check if the current view matches the specified view name and has fields defined.
if ($view['settings']->name_single_code === $viewName && is_array($view['settings']->fields ?? null))
{
// If a match is found, retrieve and return the site edit view alias keys.
return $this->getSiteEditViewAliasKey($view['settings']->fields);
}
}
// Return an empty array if no matching view is found.
return null;
}
/**
* Get the site view alias key value
*
* @param array|null $fields The main get object
*
* @return string|null
* @since 3.2.0
*/
protected function getSiteEditViewAliasKey(?array $fields): ?string
{
if ($fields !== null)
{
foreach ($fields as $field)
{
if (isset($field['alias']) && $field['alias'] && $field['type_name'] === 'text')
{
return $field['base_name'];
}
}
}
return null;
}
/**
* Get the view (main selection) table and view name value
* from the main get object
*
* @param array|null $gets The main get objects
*
* @return array
* @since 3.2.0
*/
protected function getMainSelection(?array $gets): array
{
if ($gets !== null)
{
foreach ($gets as $get)
{
// get the main table
if (isset($get['as'])
&& $get['as'] === 'a'
&& isset($get['selection'])
&& ArrayHelper::check($get['selection'])
&& isset($get['selection']['select_gets'])
&& ArrayHelper::check($get['selection']['select_gets'])
&& isset($get['selection']['name']) && isset($get['selection']['table']))
{
$name = $get['selection']['name'];
$view = $get['selection']['view'];
$table = $get['selection']['table'];
return ['table' => $table, 'view' => $view, 'name' => $name];
}
}
}
return [];
}
}

View File

@ -0,0 +1,299 @@
/**
* The Config Class.
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The Dispenser Class.
*
* @var Dispenser
* @since 3.2.0
*/
protected Dispenser $dispenser;
/**
* The Router Class.
*
* @var Builder
* @since 3.2.0
*/
protected Builder $builder;
/**
* The gui mapper array
*
* @var array
* @since 3.2.0
*/
protected array $guiMapper = [
'table' => 'component_router',
'id' => null,
'field' => null,
'type' => 'php'
];
/**
* The field targets
*
* @var array
* @since 3.2.0
*/
protected array $targets = [
'before' => 'constructor_before_parent',
'after' => 'constructor_after_parent',
'method' => 'methods'
];
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param Dispenser $dispenser The Dispenser Class.
* @param Builder $builder The Router Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, Dispenser $dispenser, Builder $builder)
{
$this->config = $config;
$this->dispenser = $dispenser;
$this->builder = $builder;
}
/**
* Set Router
*
* @param object $item The item data
*
* @return void
* @since 3.2.0
*/
public function set(object &$item)
{
$this->config->lang_target = 'site';
foreach ($this->targets as $target)
{
// add the code
if ($item->{"router_mode_{$target}"} == 3
&& StringHelper::check($item->{"router_{$target}_code"}))
{
// update GUI mapper field
$this->guiMapper['field'] = "{$target}_code";
$this->dispenser->set(
$item->{"router_{$target}_code"},
"_site_router_",
$target,
null,
$this->guiMapper
);
}
unset($item->{"router_{$target}_code"});
}
// get the site views
$views = $this->getSiteViews($item->site_views ?? [], $item->admin_views ?? []);
$edit_views = $this->getSiteEditViews($item->admin_views);
// get the edit site views
$this->builder->set('views',
ArrayHelper::merge([$views, $edit_views])
);
if ($item->router_mode_constructor_before_parent == 2
&& JsonHelper::check($item->router_constructor_before_parent_manual))
{
// build and validate the constructor before parent call code
$this->builder->set('manual',
json_decode($item->router_constructor_before_parent_manual)
);
}
// clear the data from the item
foreach ($this->targets as $key => $target)
{
// set the modes
$this->builder->set("mode_{$key}",
(int) $item->{"router_mode_{$target}"}
);
unset($item->{"router_mode_{$target}"});
}
unset($item->router_constructor_before_parent_manual);
}
/**
* Get the array of site views with additional details.
*
* This method processes each site view to enrich it with additional details such as the associated table,
* alias keys, and other relevant information. The enrichment is based on the view's settings and the admin views.
*
* @param array $siteViews The site views to be processed.
* @param array $adminViews The admin views used for fetching additional data.
*
* @return array An array of objects, each representing a site view with enriched details.
* @since 3.2.0
*/
protected function getSiteViews(array $siteViews, array $adminViews): array
{
return array_map(function ($view) use ($adminViews) {
// Attempt to get the main selection details from the view's settings.
$selection = $this->getMainSelection($view['settings']->main_get->main_get ?? null);
// We can only work with ID if the [main get] is a [getItem] dynamicGet for this site view.
$key = ($view['settings']->main_get->gettype == 1) ? 'id' : null;
// Construct the enriched view object.
return (object) [
'view' => $view['settings']->code,
'View' => $view['settings']->Code,
'stable' => ($selection['view'] === $view['settings']->code), // sanity check
'target_view' => $selection['view'],
'table' => $selection['table'],
'table_name' => $selection['name'],
'alias' => $this->getSiteViewAliasKey($selection['name'] ?? null, $adminViews),
'key' => $key,
'form' => false
];
}, $siteViews);
}
/**
* Get the array of site edit views
*
* This method processes the provided admin views to extract and return an array of site edit views.
* Each site edit view is constructed based on specific conditions from the admin view's settings.
*
* @param array|null $views The admin views to process.
*
* @return array An array of site edit views, each as an object with view, table, alias, key, and form properties.
* @since 3.2.0
*/
protected function getSiteEditViews(?array $views): array
{
$siteEditViews = [];
// Return early if no views are provided.
if (empty($views))
{
return $siteEditViews;
}
foreach ($views as $view)
{
// Check if the view is marked for edit/create on the site.
if (!empty($view['edit_create_site_view']))
{
$siteEditViews[] = (object) [
'view' => $view['settings']->name_single_code,
'View' => StringHelper::safe($view['settings']->name_single_code, 'F'),
'stable' => true,
'target_view' => $view['settings']->name_single_code,
'table' => '#__' . $this->config->component_code_name . '_' . $view['settings']->name_single_code,
'alias' => $this->getSiteEditViewAliasKey($view['settings']->fields ?? null),
'key' => 'id',
'form' => true
];
}
}
return $siteEditViews;
}
/**
* Get the site edit view alias key value
*
* This method fetches the alias keys for a given site edit view by matching the view name
* against a list of admin views. It processes the admin views to find a match and then
* retrieves the alias keys from the matched view's settings.
*
* @param string|null $viewName The view name to match.
* @param array $adminViews The admin views to search within.
*
* @return string|null The alias key for the site edit view, or null if not found.
* @since 3.2.0
*/
protected function getSiteViewAliasKey(?string $viewName, array $adminViews): ?string
{
// Return early if no view name is provided or admin views are empty.
if ($viewName === null || empty($adminViews))
{
return null;
}
foreach ($adminViews as $view)
{
// Check if the current view matches the specified view name and has fields defined.
if ($view['settings']->name_single_code === $viewName && is_array($view['settings']->fields ?? null))
{
// If a match is found, retrieve and return the site edit view alias keys.
return $this->getSiteEditViewAliasKey($view['settings']->fields);
}
}
// Return an empty array if no matching view is found.
return null;
}
/**
* Get the site view alias key value
*
* @param array|null $fields The main get object
*
* @return string|null
* @since 3.2.0
*/
protected function getSiteEditViewAliasKey(?array $fields): ?string
{
if ($fields !== null)
{
foreach ($fields as $field)
{
if (isset($field['alias']) && $field['alias'] && $field['type_name'] === 'text')
{
return $field['base_name'];
}
}
}
return null;
}
/**
* Get the view (main selection) table and view name value
* from the main get object
*
* @param array|null $gets The main get objects
*
* @return array
* @since 3.2.0
*/
protected function getMainSelection(?array $gets): array
{
if ($gets !== null)
{
foreach ($gets as $get)
{
// get the main table
if (isset($get['as'])
&& $get['as'] === 'a'
&& isset($get['selection'])
&& ArrayHelper::check($get['selection'])
&& isset($get['selection']['select_gets'])
&& ArrayHelper::check($get['selection']['select_gets'])
&& isset($get['selection']['name']) && isset($get['selection']['table']))
{
$name = $get['selection']['name'];
$view = $get['selection']['view'];
$table = $get['selection']['table'];
return ['table' => $table, 'view' => $view, 'name' => $name];
}
}
}
return [];
}

View File

@ -0,0 +1,43 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "402239e6-ceec-4ee0-af62-22d462417bf6",
"implements": null,
"load_selection": null,
"name": "Router",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Model.Router",
"type": "class",
"use_selection": {
"use_selection0": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection1": {
"use": "f1dc6430-fb54-452e-aa53-ce32ae93db88",
"as": "default"
},
"use_selection2": {
"use": "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5",
"as": "Builder"
},
"use_selection3": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection4": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection5": {
"use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Router",
"description": "Model Component Site Router Class\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -0,0 +1,56 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class Customtabs (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour**
```uml
@startuml
class Customtabs << (F,LightGreen) >> #RoyalBlue {
# Config $config
# BuilderCustomTabs $buildercustomtabs
# Language $language
# Placeholder $placeholder
# Customcode $customcode
+ __construct(Config $config, BuilderCustomTabs $buildercustomtabs, ...)
+ set(object $item) : void
}
note right of Customtabs::__construct
Constructor.
since: 3.2.0
arguments:
Config $config
BuilderCustomTabs $buildercustomtabs
Language $language
Placeholder $placeholder
Customcode $customcode
end note
note right of Customtabs::set
Set custom tabs
since: 3.2.0
return: void
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,240 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs as BuilderCustomTabs;
use VDM\Joomla\Componentbuilder\Compiler\Language;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface;
/**
* Model Custom Tabs Class
*
* @since 3.2.0
*/
final class Customtabs implements CustomtabsInterface
{
/**
* The Config Class.
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The CustomTabs Class.
*
* @var BuilderCustomTabs
* @since 3.2.0
*/
protected BuilderCustomTabs $buildercustomtabs;
/**
* The Language Class.
*
* @var Language
* @since 3.2.0
*/
protected Language $language;
/**
* The Placeholder Class.
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* The Customcode Class.
*
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param BuilderCustomTabs $buildercustomtabs The CustomTabs Class.
* @param Language $language The Language Class.
* @param Placeholder $placeholder The Placeholder Class.
* @param Customcode $customcode The Customcode Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, BuilderCustomTabs $buildercustomtabs, Language $language, Placeholder $placeholder, Customcode $customcode)
{
$this->config = $config;
$this->buildercustomtabs = $buildercustomtabs;
$this->language = $language;
$this->placeholder = $placeholder;
$this->customcode = $customcode;
}
/**
* Set custom tabs
*
* @param object $item The view data
*
* @return void
* @since 3.2.0
*/
public function set(object &$item)
{
$item->customtabs = (isset($item->customtabs)
&& JsonHelper::check($item->customtabs))
? json_decode((string) $item->customtabs, true) : null;
if (ArrayHelper::check($item->customtabs))
{
// get the name
$name = $item->name_single_code;
// setup custom tabs to global data sets
$this->buildercustomtabs->set($name,
array_map(
function ($tab) use (&$name) {
// set the view name
$tab['view'] = $name;
// load the dynamic data
$tab['html'] = $this->placeholder->update_(
$this->customcode->update($tab['html'])
);
// set the tab name
$tab['name'] = (isset($tab['name'])
&& StringHelper::check(
$tab['name']
)) ? $tab['name'] : 'Tab';
// set lang
$tab['lang'] = $this->config->lang_prefix . '_'
. StringHelper::safe(
$tab['view'], 'U'
) . '_' . StringHelper::safe(
$tab['name'], 'U'
);
$this->language->set(
'both', $tab['lang'], $tab['name']
);
// set code name
$tab['code'] = StringHelper::safe(
$tab['name']
);
// check if the permissions for the tab should be added
$_tab = '';
if (isset($tab['permission'])
&& $tab['permission'] == 1)
{
$_tab = Indent::_(1);
}
// check if the php of the tab is set, if not load it now
if (strpos((string) $tab['html'], 'uitab.addTab') === false
&& strpos((string) $tab['html'], 'uitab.endTab')
=== false)
{
// add the tab
$tmp = PHP_EOL . $_tab . Indent::_(1)
. "<?php echo Html::_('uitab.addTab', '"
. $tab['view'] . "Tab', '" . $tab['code']
. "', JT" . "ext::_('" . $tab['lang']
. "', true)); ?>";
$tmp .= PHP_EOL . $_tab . Indent::_(2)
. '<div class="row">';
$tmp .= PHP_EOL . $_tab . Indent::_(3)
. '<div class="col-md-12">';
$tmp .= PHP_EOL . $_tab . Indent::_(4) . implode(
PHP_EOL . $_tab . Indent::_(4),
(array) explode(PHP_EOL, trim((string) $tab['html']))
);
$tmp .= PHP_EOL . $_tab . Indent::_(3) . '</div>';
$tmp .= PHP_EOL . $_tab . Indent::_(2) . '</div>';
$tmp .= PHP_EOL . $_tab . Indent::_(1)
. "<?php echo Html::_('uitab.endTab'); ?>";
// update html
$tab['html'] = $tmp;
}
else
{
$tab['html'] = PHP_EOL . $_tab . Indent::_(1)
. implode(
PHP_EOL . $_tab . Indent::_(1),
(array) explode(PHP_EOL, trim((string) $tab['html']))
);
}
// add the permissions if needed
if (isset($tab['permission'])
&& $tab['permission'] == 1)
{
$tmp = PHP_EOL . Indent::_(1)
. "<?php if (\$this->canDo->get('"
. $tab['view'] . "." . $tab['code']
. ".viewtab')) : ?>";
$tmp .= $tab['html'];
$tmp .= PHP_EOL . Indent::_(1) . "<?php endif; ?>";
// update html
$tab['html'] = $tmp;
// set lang for permissions
$tab['lang_permission'] = $tab['lang']
. '_TAB_PERMISSION';
$tab['lang_permission_desc'] = $tab['lang']
. '_TAB_PERMISSION_DESC';
$tab['lang_permission_title']
= $this->placeholder->get('Views') . ' View '
. $tab['name'] . ' Tab';
$this->language->set(
'both', $tab['lang_permission'],
$tab['lang_permission_title']
);
$this->language->set(
'both', $tab['lang_permission_desc'],
'Allow the users in this group to view '
. $tab['name'] . ' Tab of '
. $this->placeholder->get('views')
);
// set the sort key
$tab['sortKey']
= StringHelper::safe(
$tab['lang_permission_title']
);
}
// return tab
return $tab;
}, array_values($item->customtabs)
)
);
}
unset($item->customtabs);
}
}

View File

@ -0,0 +1,205 @@
/**
* The Config Class.
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* The CustomTabs Class.
*
* @var BuilderCustomTabs
* @since 3.2.0
*/
protected BuilderCustomTabs $buildercustomtabs;
/**
* The Language Class.
*
* @var Language
* @since 3.2.0
*/
protected Language $language;
/**
* The Placeholder Class.
*
* @var Placeholder
* @since 3.2.0
*/
protected Placeholder $placeholder;
/**
* The Customcode Class.
*
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Constructor.
*
* @param Config $config The Config Class.
* @param BuilderCustomTabs $buildercustomtabs The CustomTabs Class.
* @param Language $language The Language Class.
* @param Placeholder $placeholder The Placeholder Class.
* @param Customcode $customcode The Customcode Class.
*
* @since 3.2.0
*/
public function __construct(Config $config, BuilderCustomTabs $buildercustomtabs, Language $language, Placeholder $placeholder, Customcode $customcode)
{
$this->config = $config;
$this->buildercustomtabs = $buildercustomtabs;
$this->language = $language;
$this->placeholder = $placeholder;
$this->customcode = $customcode;
}
/**
* Set custom tabs
*
* @param object $item The view data
*
* @return void
* @since 3.2.0
*/
public function set(object &$item)
{
$item->customtabs = (isset($item->customtabs)
&& JsonHelper::check($item->customtabs))
? json_decode((string) $item->customtabs, true) : null;
if (ArrayHelper::check($item->customtabs))
{
// get the name
$name = $item->name_single_code;
// setup custom tabs to global data sets
$this->buildercustomtabs->set($name,
array_map(
function ($tab) use (&$name) {
// set the view name
$tab['view'] = $name;
// load the dynamic data
$tab['html'] = $this->placeholder->update_(
$this->customcode->update($tab['html'])
);
// set the tab name
$tab['name'] = (isset($tab['name'])
&& StringHelper::check(
$tab['name']
)) ? $tab['name'] : 'Tab';
// set lang
$tab['lang'] = $this->config->lang_prefix . '_'
. StringHelper::safe(
$tab['view'], 'U'
) . '_' . StringHelper::safe(
$tab['name'], 'U'
);
$this->language->set(
'both', $tab['lang'], $tab['name']
);
// set code name
$tab['code'] = StringHelper::safe(
$tab['name']
);
// check if the permissions for the tab should be added
$_tab = '';
if (isset($tab['permission'])
&& $tab['permission'] == 1)
{
$_tab = Indent::_(1);
}
// check if the php of the tab is set, if not load it now
if (strpos((string) $tab['html'], 'uitab.addTab') === false
&& strpos((string) $tab['html'], 'uitab.endTab')
=== false)
{
// add the tab
$tmp = PHP_EOL . $_tab . Indent::_(1)
. "<?php echo Html::_('uitab.addTab', '"
. $tab['view'] . "Tab', '" . $tab['code']
. "', JT" . "ext::_('" . $tab['lang']
. "', true)); ?>";
$tmp .= PHP_EOL . $_tab . Indent::_(2)
. '<div class="row">';
$tmp .= PHP_EOL . $_tab . Indent::_(3)
. '<div class="col-md-12">';
$tmp .= PHP_EOL . $_tab . Indent::_(4) . implode(
PHP_EOL . $_tab . Indent::_(4),
(array) explode(PHP_EOL, trim((string) $tab['html']))
);
$tmp .= PHP_EOL . $_tab . Indent::_(3) . '</div>';
$tmp .= PHP_EOL . $_tab . Indent::_(2) . '</div>';
$tmp .= PHP_EOL . $_tab . Indent::_(1)
. "<?php echo Html::_('uitab.endTab'); ?>";
// update html
$tab['html'] = $tmp;
}
else
{
$tab['html'] = PHP_EOL . $_tab . Indent::_(1)
. implode(
PHP_EOL . $_tab . Indent::_(1),
(array) explode(PHP_EOL, trim((string) $tab['html']))
);
}
// add the permissions if needed
if (isset($tab['permission'])
&& $tab['permission'] == 1)
{
$tmp = PHP_EOL . Indent::_(1)
. "<?php if (\$this->canDo->get('"
. $tab['view'] . "." . $tab['code']
. ".viewtab')) : ?>";
$tmp .= $tab['html'];
$tmp .= PHP_EOL . Indent::_(1) . "<?php endif; ?>";
// update html
$tab['html'] = $tmp;
// set lang for permissions
$tab['lang_permission'] = $tab['lang']
. '_TAB_PERMISSION';
$tab['lang_permission_desc'] = $tab['lang']
. '_TAB_PERMISSION_DESC';
$tab['lang_permission_title']
= $this->placeholder->get('Views') . ' View '
. $tab['name'] . ' Tab';
$this->language->set(
'both', $tab['lang_permission'],
$tab['lang_permission_title']
);
$this->language->set(
'both', $tab['lang_permission_desc'],
'Allow the users in this group to view '
. $tab['name'] . ' Tab of '
. $this->placeholder->get('views')
);
// set the sort key
$tab['sortKey']
= StringHelper::safe(
$tab['lang_permission_title']
);
}
// return tab
return $tab;
}, array_values($item->customtabs)
)
);
}
unset($item->customtabs);
}

View File

@ -0,0 +1,57 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "0",
"guid": "42648fb4-dfdc-4986-a180-69e5726a25c4",
"implements": [
"fcf42c53-0967-4c87-9699-a4d86adfdadf"
],
"load_selection": null,
"name": "Customtabs",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Model.J4.Customtabs",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection1": {
"use": "9551b683-67b6-4367-bb14-4b016def37e3",
"as": "BuilderCustomTabs"
},
"use_selection2": {
"use": "8eee7df5-2775-41a9-9372-c46c5939a252",
"as": "default"
},
"use_selection3": {
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
"as": "default"
},
"use_selection4": {
"use": "313b43c4-98c3-4f62-9177-2d73ec8eba31",
"as": "default"
},
"use_selection5": {
"use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18",
"as": "default"
},
"use_selection6": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection7": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection8": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.JoomlaFour.Customtabs",
"description": "Model Custom Tabs Class\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -6,11 +6,11 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class CoreRule (Details)
# final class CoreRule (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour**
```uml
@startuml
class CoreRule #Gold {
class CoreRule << (F,LightGreen) >> #RoyalBlue {
# array $rules
# string $path
+ __construct()

View File

@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
*
* @since 3.2.0
*/
class CoreRule implements CoreRuleInterface
final class CoreRule implements CoreRuleInterface
{
/**
* Local Core Joomla Rules

View File

@ -10,7 +10,7 @@
"name": "CoreRule",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Field.J4.CoreRule",
"type": "class",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",

View File

@ -6,12 +6,13 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class Event (Details)
# final class Event (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour**
```uml
@startuml
class Event #Gold {
class Event << (F,LightGreen) >> #RoyalBlue {
# $activePlugins
# $dispatcher
+ __construct(?Registry $params = null)
+ trigger(string $event, mixed $data = null) : void
}
@ -23,7 +24,7 @@ note right of Event::__construct
end note
note right of Event::trigger
Trigger and event
Trigger an event
since: 3.2.0
return: void

View File

@ -12,7 +12,9 @@
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
use Joomla\Registry\Registry;
use Joomla\CMS\Factory;
use Joomla\Registry\Registry;
use Joomla\CMS\Plugin\PluginHelper;
use VDM\Joomla\Utilities\Component\Helper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
@ -22,16 +24,23 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
*
* @since 3.2.0
*/
class Event implements EventInterface
final class Event implements EventInterface
{
/**
* event plugin trigger switch
* event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
/**
* The application to trigger and event TODO
*
* @since 3.2.0
*/
protected $dispatcher;
/**
* Constructor
*
@ -50,19 +59,21 @@ class Event implements EventInterface
foreach ($plugins as $plugin)
{
// get possible plugins
if (\JPluginHelper::isEnabled('extension', $plugin))
if (PluginHelper::isEnabled('extension', $plugin))
{
// Import the appropriate plugin group.
\JPluginHelper::importPlugin('extension', $plugin);
PluginHelper::importPlugin('extension', $plugin);
// activate events
$this->activePlugins = true;
}
}
}
$this->dispatcher = Factory::getApplication();
}
/**
* Trigger and event
* Trigger an event
*
* @param string $event The event to trigger
* @param mixed $data The values to pass to the event/plugin
@ -76,22 +87,14 @@ class Event implements EventInterface
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
// Get the dispatcher.
$dispatcher = \JEventDispatcher::getInstance();
// Trigger this compiler event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count((array) $results) && in_array(false, $results, true))
try
{
// Get the last error.
$error = $dispatcher->getError();
if (!($error instanceof \Exception))
{
throw new \Exception($error);
}
// Trigger this compiler event.
$results = $this->dispatcher->triggerEvent($event, $data ?? []);
}
catch (\Exception $e)
{
throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}

View File

@ -1,11 +1,18 @@
/**
* event plugin trigger switch
* event plug-in trigger switch
*
* @var boolean
* @since 3.2.0
*/
protected $activePlugins = false;
/**
* The application to trigger and event TODO
*
* @since 3.2.0
*/
protected $dispatcher;
/**
* Constructor
*
@ -24,19 +31,21 @@
foreach ($plugins as $plugin)
{
// get possible plugins
if (\JPluginHelper::isEnabled('extension', $plugin))
if (PluginHelper::isEnabled('extension', $plugin))
{
// Import the appropriate plugin group.
\JPluginHelper::importPlugin('extension', $plugin);
PluginHelper::importPlugin('extension', $plugin);
// activate events
$this->activePlugins = true;
}
}
}
$this->dispatcher = Factory::getApplication();
}
/**
* Trigger and event
* Trigger an event
*
* @param string $event The event to trigger
* @param mixed $data The values to pass to the event/plugin
@ -50,22 +59,14 @@
// only execute if plugins were loaded (active)
if ($this->activePlugins)
{
// Get the dispatcher.
$dispatcher = \JEventDispatcher::getInstance();
// Trigger this compiler event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count((array) $results) && in_array(false, $results, true))
try
{
// Get the last error.
$error = $dispatcher->getError();
if (!($error instanceof \Exception))
{
throw new \Exception($error);
}
// Trigger this compiler event.
$results = $this->dispatcher->triggerEvent($event, $data ?? []);
}
catch (\Exception $e)
{
throw new \Exception("Error processing event '$event': " . $e->getMessage());
}
}
}

View File

@ -9,8 +9,8 @@
"load_selection": null,
"name": "Event",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.JoomlaFour.Event",
"type": "class",
"system_name": "JCB.Compiler.J4.Event",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "640b5352-fb09-425f-a26e-cd44eda03f15",
@ -20,6 +20,6 @@
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFour.Event",
"description": "Compiler Events\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "use Joomla\\Registry\\Registry;",
"head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\Registry\\Registry;\r\nuse Joomla\\CMS\\Plugin\\PluginHelper;",
"composer": ""
}

View File

@ -0,0 +1,30 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class Router (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder**
> extends: **Registry**
```uml
@startuml
class Router << (F,LightGreen) >> #RoyalBlue {
}
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,27 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
use VDM\Joomla\Interfaces\Registryinterface;
use VDM\Joomla\Abstraction\Registry;
/**
* Database Uninstall Builder Class
*
* @since 3.2.0
*/
final class Router extends Registry implements Registryinterface
{
}

View File

@ -0,0 +1 @@
###CODEPOWER###

View File

@ -0,0 +1,20 @@
{
"add_head": "0",
"add_licensing_template": "2",
"extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7",
"guid": "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5",
"implements": [
"64e291c2-11f1-423d-a44d-837cc12cc017"
],
"load_selection": null,
"name": "Router",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Builder.Router",
"type": "final class",
"use_selection": null,
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.Router",
"description": "Database Uninstall Builder Class\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "",
"composer": ""
}

View File

@ -6,11 +6,11 @@
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# class Event (Details)
# final class Event (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaThree**
```uml
@startuml
class Event #Gold {
class Event << (F,LightGreen) >> #RoyalBlue {
# $activePlugins
+ __construct(?Registry $params = null)
+ trigger(string $event, mixed $data = null) : void
@ -23,7 +23,7 @@ note right of Event::__construct
end note
note right of Event::trigger
Trigger and event
Trigger an event
since: 3.2.0
return: void

View File

@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
*
* @since 3.2.0
*/
class Event implements EventInterface
final class Event implements EventInterface
{
/**
* event plugin trigger switch
@ -62,7 +62,7 @@ class Event implements EventInterface
}
/**
* Trigger and event
* Trigger an event
*
* @param string $event The event to trigger
* @param mixed $data The values to pass to the event/plugin

View File

@ -36,7 +36,7 @@
}
/**
* Trigger and event
* Trigger an event
*
* @param string $event The event to trigger
* @param mixed $data The values to pass to the event/plugin

View File

@ -9,8 +9,8 @@
"load_selection": null,
"name": "Event",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.JoomlaThree.Event",
"type": "class",
"system_name": "JCB.Compiler.J3.Event",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "640b5352-fb09-425f-a26e-cd44eda03f15",

View File

@ -0,0 +1,54 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# final class CoreField (Details)
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive**
```uml
@startuml
class CoreField << (F,LightGreen) >> #RoyalBlue {
# array $fields
# array $paths
+ __construct()
+ get(bool $lowercase = false) : array
- set(string $path) : void
}
note right of CoreField::__construct
Constructor
since: 3.2.0
end note
note right of CoreField::get
Get the Array of Existing Validation Field Names
since: 3.2.0
return: array
end note
note right of CoreField::set
Set the fields found in a path
since: 3.2.0
return: void
end note
@enduml
```
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,129 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive;
use Joomla\CMS\Filesystem\Folder;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface;
/**
* Core Joomla Fields
*
* @since 3.2.0
*/
final class CoreField implements CoreFieldInterface
{
/**
* Local Core Joomla Fields
*
* @var array|null
* @since 3.2.0
**/
protected array $fields = [];
/**
* Local Core Joomla Fields Path
*
* @var array
* @since 3.2.0
**/
protected array $paths = [];
/**
* Constructor
*
* @since 3.2.0
*/
public function __construct()
{
// set the path to the form validation fields
$this->paths[] = JPATH_LIBRARIES . '/src/Form/Field';
}
/**
* Get the Array of Existing Validation Field Names
*
* @param bool $lowercase Switch to set fields lowercase
*
* @return array
* @since 3.2.0
*/
public function get(bool $lowercase = false): array
{
if ($this->fields === [])
{
// check if the path exist
foreach ($this->paths as $path)
{
$this->set($path);
}
}
// return fields if found
if ($this->fields !== [])
{
// check if the names should be all lowercase
if ($lowercase)
{
return array_map(
fn($item): string => strtolower((string) $item),
$this->fields
);
}
return $this->fields;
}
// return empty array
return [];
}
/**
* Set the fields found in a path
*
* @param string $path The path to load fields from
* @return void
* @since 3.2.0
*/
private function set(string $path): void
{
// Check if the path exists
if (!Folder::exists($path))
{
return;
}
// Load all PHP files in this path
$fields = Folder::files($path, '\.php$', true, true);
// Process the files to extract field names
$processedFields = array_map(function ($name) {
$fileName = basename($name);
// Remove 'Field.php' if it exists or just '.php' otherwise
if (substr($fileName, -9) === 'Field.php')
{
return str_replace('Field.php', '', $fileName);
}
else
{
return str_replace('.php', '', $fileName);
}
}, $fields);
// Merge with existing fields and remove duplicates
$this->fields = array_unique(array_merge($processedFields, $this->fields));
}
}

View File

@ -0,0 +1,101 @@
/**
* Local Core Joomla Fields
*
* @var array|null
* @since 3.2.0
**/
protected array $fields = [];
/**
* Local Core Joomla Fields Path
*
* @var array
* @since 3.2.0
**/
protected array $paths = [];
/**
* Constructor
*
* @since 3.2.0
*/
public function __construct()
{
// set the path to the form validation fields
$this->paths[] = JPATH_LIBRARIES . '/src/Form/Field';
}
/**
* Get the Array of Existing Validation Field Names
*
* @param bool $lowercase Switch to set fields lowercase
*
* @return array
* @since 3.2.0
*/
public function get(bool $lowercase = false): array
{
if ($this->fields === [])
{
// check if the path exist
foreach ($this->paths as $path)
{
$this->set($path);
}
}
// return fields if found
if ($this->fields !== [])
{
// check if the names should be all lowercase
if ($lowercase)
{
return array_map(
fn($item): string => strtolower((string) $item),
$this->fields
);
}
return $this->fields;
}
// return empty array
return [];
}
/**
* Set the fields found in a path
*
* @param string $path The path to load fields from
* @return void
* @since 3.2.0
*/
private function set(string $path): void
{
// Check if the path exists
if (!Folder::exists($path))
{
return;
}
// Load all PHP files in this path
$fields = Folder::files($path, '\.php$', true, true);
// Process the files to extract field names
$processedFields = array_map(function ($name) {
$fileName = basename($name);
// Remove 'Field.php' if it exists or just '.php' otherwise
if (substr($fileName, -9) === 'Field.php')
{
return str_replace('Field.php', '', $fileName);
}
else
{
return str_replace('.php', '', $fileName);
}
}, $fields);
// Merge with existing fields and remove duplicates
$this->fields = array_unique(array_merge($processedFields, $this->fields));
}

View File

@ -0,0 +1,25 @@
{
"add_head": "1",
"add_licensing_template": "2",
"extends": "0",
"guid": "4c143764-1b84-4b9f-86c5-8de119b26f1a",
"implements": [
"e2f5fddf-cbc8-44ee-836c-7f3fb08d8900"
],
"load_selection": null,
"name": "CoreField",
"power_version": "1.0.0",
"system_name": "JCB.Compiler.Field.J5.CoreField",
"type": "final class",
"use_selection": {
"use_selection0": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
}
},
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaFive.CoreField",
"description": "Core Joomla Fields\r\n\r\n@since 3.2.0",
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
"head": "use Joomla\\CMS\\Filesystem\\Folder;",
"composer": ""
}

View File

@ -800,6 +800,8 @@ final class Builders
);
}
}
// extends value
$extends_field = $custom['extends'] ?? '';
// build the list values
if (($listSwitch || $listJoin) && $typeName != 'repeatable'
&& $typeName != 'subform')
@ -925,7 +927,7 @@ final class Builders
);
}
// build script switch for user
if ($custom['extends'] === 'user')
if ($extends_field === 'user')
{
$this->scriptuserswitch->set($typeName, $typeName);
}
@ -997,7 +999,7 @@ final class Builders
}
// setup checkbox for this view
if ($dbSwitch && ($typeName === 'checkbox' ||
(ArrayHelper::check($custom) && isset($custom['extends']) && $custom['extends'] === 'checkboxes')))
(ArrayHelper::check($custom) && $extends_field === 'checkboxes')))
{
$this->checkbox->add($nameSingleCode, $name, true);
}

View File

@ -723,6 +723,8 @@
);
}
}
// extends value
$extends_field = $custom['extends'] ?? '';
// build the list values
if (($listSwitch || $listJoin) && $typeName != 'repeatable'
&& $typeName != 'subform')
@ -848,7 +850,7 @@
);
}
// build script switch for user
if ($custom['extends'] === 'user')
if ($extends_field === 'user')
{
$this->scriptuserswitch->set($typeName, $typeName);
}
@ -920,7 +922,7 @@
}
// setup checkbox for this view
if ($dbSwitch && ($typeName === 'checkbox' ||
(ArrayHelper::check($custom) && isset($custom['extends']) && $custom['extends'] === 'checkboxes')))
(ArrayHelper::check($custom) && $extends_field === 'checkboxes')))
{
$this->checkbox->add($nameSingleCode, $name, true);
}

View File

@ -14,9 +14,11 @@ class ArchitectureController #Gold {
# $targetVersion
+ register(Container $container) : void
+ getAllowAdd(Container $container) : AllowAddInterface
+ getJ5ControllerAllowAdd(Container $container) : J5ControllerAllowAdd
+ getJ4ControllerAllowAdd(Container $container) : J4ControllerAllowAdd
+ getJ3ControllerAllowAdd(Container $container) : J3ControllerAllowAdd
+ getAllowEdit(Container $container) : AllowEditInterface
+ getJ5ControllerAllowEdit(Container $container) : J5ControllerAllowEdit
+ getJ4ControllerAllowEdit(Container $container) : J4ControllerAllowEdit
+ getJ3ControllerAllowEdit(Container $container) : J3ControllerAllowEdit
}
@ -28,14 +30,21 @@ note right of ArchitectureController::register
return: void
end note
note right of ArchitectureController::getAllowAdd
note left of ArchitectureController::getAllowAdd
Get The AllowAddInterface Class.
since: 3.2.0
return: AllowAddInterface
end note
note right of ArchitectureController::getJ4ControllerAllowAdd
note right of ArchitectureController::getJ5ControllerAllowAdd
Get The AllowAdd Class.
since: 3.2.0
return: J5ControllerAllowAdd
end note
note left of ArchitectureController::getJ4ControllerAllowAdd
Get The AllowAdd Class.
since: 3.2.0
@ -49,14 +58,21 @@ note right of ArchitectureController::getJ3ControllerAllowAdd
return: J3ControllerAllowAdd
end note
note right of ArchitectureController::getAllowEdit
note left of ArchitectureController::getAllowEdit
Get The AllowEditInterface Class.
since: 3.2.0
return: AllowEditInterface
end note
note right of ArchitectureController::getJ4ControllerAllowEdit
note right of ArchitectureController::getJ5ControllerAllowEdit
Get The AllowEdit Class.
since: 3.2.0
return: J5ControllerAllowEdit
end note
note left of ArchitectureController::getJ4ControllerAllowEdit
Get The AllowEdit Class.
since: 3.2.0

View File

@ -15,9 +15,11 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller\AllowAdd as J5ControllerAllowAdd;
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowAdd as J4ControllerAllowAdd;
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowAdd as J3ControllerAllowAdd;
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller\AllowEdit as J5ControllerAllowEdit;
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowEdit as J4ControllerAllowEdit;
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowEdit as J3ControllerAllowEdit;
@ -50,6 +52,9 @@ class ArchitectureController implements ServiceProviderInterface
$container->alias(AllowAddInterface::class, 'Architecture.Controller.AllowAdd')
->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true);
$container->alias(J5ControllerAllowAdd::class, 'Architecture.Controller.J5.AllowAdd')
->share('Architecture.Controller.J5.AllowAdd', [$this, 'getJ5ControllerAllowAdd'], true);
$container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd')
->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true);
@ -59,6 +64,9 @@ class ArchitectureController implements ServiceProviderInterface
$container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit')
->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true);
$container->alias(J5ControllerAllowEdit::class, 'Architecture.Controller.J5.AllowEdit')
->share('Architecture.Controller.J5.AllowEdit', [$this, 'getJ5ControllerAllowEdit'], true);
$container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit')
->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true);
@ -84,6 +92,23 @@ class ArchitectureController implements ServiceProviderInterface
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd');
}
/**
* Get The AllowAdd Class.
*
* @param Container $container The DI container.
*
* @return J5ControllerAllowAdd
* @since 3.2.0
*/
public function getJ5ControllerAllowAdd(Container $container): J5ControllerAllowAdd
{
return new J5ControllerAllowAdd(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser')
);
}
/**
* Get The AllowAdd Class.
*
@ -136,6 +161,25 @@ class ArchitectureController implements ServiceProviderInterface
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit');
}
/**
* Get The AllowEdit Class.
*
* @param Container $container The DI container.
*
* @return J5ControllerAllowEdit
* @since 3.2.0
*/
public function getJ5ControllerAllowEdit(Container $container): J5ControllerAllowEdit
{
return new J5ControllerAllowEdit(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser'),
$container->get('Compiler.Builder.Category'),
$container->get('Compiler.Builder.Category.Other.Name')
);
}
/**
* Get The AllowEdit Class.
*

Some files were not shown because too many files have changed in this diff Show More