diff --git a/README.md b/README.md index f8bd26c..074a057 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/README.md b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/README.md new file mode 100644 index 0000000..6acf6a9 --- /dev/null +++ b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/README.md @@ -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) + diff --git a/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.php b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.php new file mode 100644 index 0000000..2b7fbdb --- /dev/null +++ b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.php @@ -0,0 +1,129 @@ + + * @git 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); + } +} + diff --git a/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.power b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.power new file mode 100644 index 0000000..375152e --- /dev/null +++ b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/code.power @@ -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); + } \ No newline at end of file diff --git a/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/settings.json b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/settings.json new file mode 100644 index 0000000..d9920eb --- /dev/null +++ b/src/005fce79-1b62-4a93-8d5e-8c89fee1afc6/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md index aa87c1f..efb433e 100644 --- a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md @@ -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 diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php index 4780f73..41e97e7 100644 --- a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php @@ -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; + } } } diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power index e34c353..7d23bec 100644 --- a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.power @@ -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; + } } } diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json index ca6ad12..ab93906 100644 --- a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json @@ -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" } diff --git a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php index 19934d0..3076bac 100644 --- a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php +++ b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.php @@ -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) . "/>"; diff --git a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power index f20e695..cc52376 100644 --- a/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power +++ b/src/05448890-e324-41a0-b6db-d804bfc241cc/code.power @@ -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) . "/>"; diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md index 1af2f2c..b46945a 100644 --- a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md @@ -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 diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php index fe9caea..8333982 100644 --- a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php @@ -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') - ); } } diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.power b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.power index 1f5c094..d5314d2 100644 --- a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.power +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.power @@ -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') - ); } \ No newline at end of file diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json index 90dcc53..1766fda 100644 --- a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json @@ -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" } diff --git a/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/README.md b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/README.md new file mode 100644 index 0000000..a3b6018 --- /dev/null +++ b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/README.md @@ -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) + diff --git a/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.php b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.php new file mode 100644 index 0000000..eeddd63 --- /dev/null +++ b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.php @@ -0,0 +1,263 @@ + + * @git 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); + } +} + diff --git a/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.power b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.power new file mode 100644 index 0000000..0ef9f0d --- /dev/null +++ b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/code.power @@ -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); + } \ No newline at end of file diff --git a/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/settings.json b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/settings.json new file mode 100644 index 0000000..f0c2f21 --- /dev/null +++ b/src/1294a7c7-46fb-4527-a69d-f8db830fd39a/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/README.md b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/README.md new file mode 100644 index 0000000..8334f62 --- /dev/null +++ b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/README.md @@ -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) + diff --git a/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.php b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.php new file mode 100644 index 0000000..54a9b7b --- /dev/null +++ b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.php @@ -0,0 +1,345 @@ + + * @git 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 = '&ref=' . \$values['view'] . '&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 .= '&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 = '&field=' . \$values['view'] . '&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 = '&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[] = 'config->lang_prefix + . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\""; + $addButton[] = Indent::_(5) . "href=\"index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['view'] + . "&layout=edit'.\$ref.'\" >"; + $addButton[] = Indent::_(5) + . "';"; + $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[] = 'config->lang_prefix + . "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >"; + $addButton[] = Indent::_(5) + . "';"; + + $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 '
' .\$html . implode('',\$button).'
';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; + + return implode(PHP_EOL, $addButton); + } + + return ''; + } +} + diff --git a/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.power b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.power new file mode 100644 index 0000000..27cbb01 --- /dev/null +++ b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/code.power @@ -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 = '&ref=' . \$values['view'] . '&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 .= '&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 = '&field=' . \$values['view'] . '&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 = '&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[] = 'config->lang_prefix + . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\""; + $addButton[] = Indent::_(5) . "href=\"index.php?option=" + . $fieldData['component'] . "&view=" . $fieldData['view'] + . "&layout=edit'.\$ref.'\" >"; + $addButton[] = Indent::_(5) + . "';"; + $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[] = 'config->lang_prefix + . "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >"; + $addButton[] = Indent::_(5) + . "';"; + + $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 '
' .\$html . implode('',\$button).'
';"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; + + return implode(PHP_EOL, $addButton); + } + + return ''; + } \ No newline at end of file diff --git a/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/settings.json b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/settings.json new file mode 100644 index 0000000..c08b47b --- /dev/null +++ b/src/163fa7ca-21bd-4e7f-a618-26fe10b870fe/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php index 4d818fd..37bdb9a 100644 --- a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php @@ -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) { diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power index cc3ba66..a5a1da8 100644 --- a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.power @@ -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) { diff --git a/src/17c590ed-8a44-485c-9be8-9a144a6b7429/README.md b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/README.md new file mode 100644 index 0000000..c50e7fc --- /dev/null +++ b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/README.md @@ -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) + diff --git a/src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.php b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.php new file mode 100644 index 0000000..59ec6e3 --- /dev/null +++ b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.php @@ -0,0 +1,137 @@ + + * @git 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 ''; + } +} + diff --git a/src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.power b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.power new file mode 100644 index 0000000..4435ebb --- /dev/null +++ b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/code.power @@ -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 ''; + } \ No newline at end of file diff --git a/src/17c590ed-8a44-485c-9be8-9a144a6b7429/settings.json b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/settings.json new file mode 100644 index 0000000..4c7c934 --- /dev/null +++ b/src/17c590ed-8a44-485c-9be8-9a144a6b7429/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md b/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md index 0711f8f..d8e1232 100644 --- a/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md @@ -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 diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php index eb3f69e..c36a36b 100644 --- a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php @@ -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 * diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power index 7946c5a..ff4c7bf 100644 --- a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.power @@ -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 * diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json b/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json index 2af5c94..44c4e95 100644 --- a/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json @@ -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", diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md index 1f83a5e..3abd499 100644 --- a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md @@ -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 ``` diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php index de0e098..712242b 100644 --- a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php @@ -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 . '\') . \' -\']);'; - } - } } } diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power index 3bf4342..c0a8142 100644 --- a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power @@ -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 . '\') . \' -\']);'; - } - } } \ No newline at end of file diff --git a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json index 0742091..a11c0be 100644 --- a/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json +++ b/src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json @@ -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" diff --git a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php index 42f5632..778fdf1 100644 --- a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php +++ b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php @@ -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) ), diff --git a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power index 1ea4253..3db4317 100644 --- a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power +++ b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power @@ -48,7 +48,7 @@ { return $this->model->value( $this->load->value( - ["a.${field}" => $field], + ["a.{$field}" => $field], ['a' => 'power'], $this->prefix($keys) ), diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md index 57fab13..f7fa6e0 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md @@ -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() diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php index e8e8100..378f9f9 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php @@ -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 diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json index 0a5a5ef..fc9ff2b 100644 --- a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json @@ -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", diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md index 6622d52..f14d329 100644 --- a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md @@ -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 diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php index 7256866..0412672 100644 --- a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php @@ -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'); + } } diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power index 1c89814..ba11d03 100644 --- a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power @@ -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'); + } \ No newline at end of file diff --git a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json index 0b90294..acd2448 100644 --- a/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json +++ b/src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json @@ -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", diff --git a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php index 48f20a5..69208e3 100644 --- a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php +++ b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php @@ -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; diff --git a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power index 789fc48..a3bf45b 100644 --- a/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power +++ b/src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power @@ -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; diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md index a8b0409..ff4ac62 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md @@ -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 diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php index 3642c47..b6421dd 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php @@ -14,54 +14,6 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitch; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; -use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomList; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseKeys; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseTables; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueGuid; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FrontendParams; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HasMenuGlobal; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\History; -use VDM\Joomla\Componentbuilder\Compiler\Builder\IntegerFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodEximportString; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; use VDM\Joomla\Componentbuilder\Compiler\Builder\LanguageMessages; use VDM\Joomla\Componentbuilder\Compiler\Builder\Layout; use VDM\Joomla\Componentbuilder\Compiler\Builder\LayoutData; @@ -95,6 +47,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionGlobalAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews; use VDM\Joomla\Componentbuilder\Compiler\Builder\Request; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Router; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptMediaSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptUserSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\Search; @@ -117,1621 +70,869 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\ViewsDefaultOrdering; /** - * Builder Service Provider + * Builder L-Z Service Provider * * @since 3.2.0 */ -class Builder implements ServiceProviderInterface +class BuilderLZ implements ServiceProviderInterface { - /** - * Registers the service provider with a DI container. - * - * @param Container $container The DI container. - * - * @return void - * @since 3.2.0 - */ - public function register(Container $container) - { - $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') - ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); - - $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') - ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); - - $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') - ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); - - $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') - ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); - - $container->alias(Alias::class, 'Compiler.Builder.Alias') - ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); - - $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') - ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); - - $container->alias(Category::class, 'Compiler.Builder.Category') - ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); - - $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') - ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); - - $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') - ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); - - $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') - ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); - - $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') - ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); - - $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') - ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); - - $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') - ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); - - $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') - ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); - - $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') - ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); - - $container->alias(Contributors::class, 'Compiler.Builder.Contributors') - ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); - - $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') - ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); - - $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') - ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); - - $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') - ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); - - $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') - ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); - - $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') - ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); - - $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') - ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); - - $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') - ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); - - $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') - ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); - - $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') - ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); - - $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') - ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); - - $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') - ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); - - $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') - ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); - - $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') - ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); - - $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') - ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); - - $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') - ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); - - $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') - ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); - - $container->alias(Filter::class, 'Compiler.Builder.Filter') - ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); - - $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') - ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); - - $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') - ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); - - $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') - ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); - - $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') - ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); - - $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') - ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); - - $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') - ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); - - $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') - ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); - - $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') - ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); - - $container->alias(History::class, 'Compiler.Builder.History') - ->share('Compiler.Builder.History', [$this, 'getHistory'], true); - - $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') - ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); - - $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') - ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); - - $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') - ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); - - $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') - ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); - - $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') - ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); - - $container->alias(JsonString::class, 'Compiler.Builder.Json.String') - ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); - - $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') - ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); - - $container->alias(Layout::class, 'Compiler.Builder.Layout') - ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); - - $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') - ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); - - $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') - ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); - - $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') - ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); - - $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') - ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); - - $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') - ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); - - $container->alias(Lists::class, 'Compiler.Builder.Lists') - ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); - - $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') - ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); - - $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') - ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); - - $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') - ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); - - $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') - ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); - - $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') - ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); - - $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') - ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); - - $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') - ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); - - $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') - ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); - - $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') - ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); - - $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') - ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); - - $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') - ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); - - $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') - ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); - - $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') - ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); - - $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') - ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); - - $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') - ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); - - $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') - ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); - - $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') - ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); - - $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') - ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); - - $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') - ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); - - $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') - ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); - - $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') - ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); - - $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') - ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); - - $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') - ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); - - $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') - ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); - - $container->alias(Request::class, 'Compiler.Builder.Request') - ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); - - $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') - ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); - - $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') - ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); - - $container->alias(Search::class, 'Compiler.Builder.Search') - ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); - - $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') - ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); - - $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') - ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); - - $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') - ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); - - $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') - ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); - - $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') - ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); - - $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') - ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); - - $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') - ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); - - $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') - ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); - - $container->alias(Sort::class, 'Compiler.Builder.Sort') - ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); - - $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') - ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); - - $container->alias(Tags::class, 'Compiler.Builder.Tags') - ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); - - $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') - ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); - - $container->alias(Title::class, 'Compiler.Builder.Title') - ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); - - $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') - ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); - - $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') - ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); - - $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') - ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); - } - - /** - * Get The AccessSwitch Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitch - * @since 3.2.0 - */ - public function getAccessSwitch(Container $container): AccessSwitch - { - return new AccessSwitch(); - } - - /** - * Get The AccessSwitchList Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitchList - * @since 3.2.0 - */ - public function getAccessSwitchList(Container $container): AccessSwitchList - { - return new AccessSwitchList(); - } - - /** - * Get The AssetsRules Class. - * - * @param Container $container The DI container. - * - * @return AssetsRules - * @since 3.2.0 - */ - public function getAssetsRules(Container $container): AssetsRules - { - return new AssetsRules(); - } - - /** - * Get The AdminFilterType Class. - * - * @param Container $container The DI container. - * - * @return AdminFilterType - * @since 3.2.0 - */ - public function getAdminFilterType(Container $container): AdminFilterType - { - return new AdminFilterType(); - } - - /** - * Get The Alias Class. - * - * @param Container $container The DI container. - * - * @return Alias - * @since 3.2.0 - */ - public function getAlias(Container $container): Alias - { - return new Alias(); - } - - /** - * Get The BaseSixFour Class. - * - * @param Container $container The DI container. - * - * @return BaseSixFour - * @since 3.2.0 - */ - public function getBaseSixFour(Container $container): BaseSixFour - { - return new BaseSixFour(); - } - - /** - * Get The Category Class. - * - * @param Container $container The DI container. - * - * @return Category - * @since 3.2.0 - */ - public function getCategory(Container $container): Category - { - return new Category(); - } - - /** - * Get The CategoryCode Class. - * - * @param Container $container The DI container. - * - * @return CategoryCode - * @since 3.2.0 - */ - public function getCategoryCode(Container $container): CategoryCode - { - return new CategoryCode(); - } - - /** - * Get The CategoryOtherName Class. - * - * @param Container $container The DI container. - * - * @return CategoryOtherName - * @since 3.2.0 - */ - public function getCategoryOtherName(Container $container): CategoryOtherName - { - return new CategoryOtherName(); - } - - /** - * Get The CheckBox Class. - * - * @param Container $container The DI container. - * - * @return CheckBox - * @since 3.2.0 - */ - public function getCheckBox(Container $container): CheckBox - { - return new CheckBox(); - } - - /** - * Get The ComponentFields Class. - * - * @param Container $container The DI container. - * - * @return ComponentFields - * @since 3.2.0 - */ - public function getComponentFields(Container $container): ComponentFields - { - return new ComponentFields(); - } - - /** - * Get The ConfigFieldsets Class. - * - * @param Container $container The DI container. - * - * @return ConfigFieldsets - * @since 3.2.0 - */ - public function getConfigFieldsets(Container $container): ConfigFieldsets - { - return new ConfigFieldsets(); - } - - /** - * Get The ConfigFieldsetsCustomfield Class. - * - * @param Container $container The DI container. - * - * @return ConfigFieldsetsCustomfield - * @since 3.2.0 - */ - public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield - { - return new ConfigFieldsetsCustomfield(); - } - - /** - * Get The ContentMulti Class. - * - * @param Container $container The DI container. - * - * @return ContentMulti - * @since 3.2.0 - */ - public function getContentMulti(Container $container): ContentMulti - { - return new ContentMulti(); - } - - /** - * Get The ContentOne Class. - * - * @param Container $container The DI container. - * - * @return ContentOne - * @since 3.2.0 - */ - public function getContentOne(Container $container): ContentOne - { - return new ContentOne(); - } - - /** - * Get The Contributors Class. - * - * @param Container $container The DI container. - * - * @return Contributors - * @since 3.2.0 - */ - public function getContributors(Container $container): Contributors - { - return new Contributors(); - } - - /** - * Get The CustomAlias Class. - * - * @param Container $container The DI container. - * - * @return CustomAlias - * @since 3.2.0 - */ - public function getCustomAlias(Container $container): CustomAlias - { - return new CustomAlias(); - } - - /** - * Get The CustomField Class. - * - * @param Container $container The DI container. - * - * @return CustomField - * @since 3.2.0 - */ - public function getCustomField(Container $container): CustomField - { - return new CustomField(); - } - - /** - * Get The CustomFieldLinks Class. - * - * @param Container $container The DI container. - * - * @return CustomFieldLinks - * @since 3.2.0 - */ - public function getCustomFieldLinks(Container $container): CustomFieldLinks - { - return new CustomFieldLinks(); - } - - /** - * Get The CustomList Class. - * - * @param Container $container The DI container. - * - * @return CustomList - * @since 3.2.0 - */ - public function getCustomList(Container $container): CustomList - { - return new CustomList(); - } - - /** - * Get The CustomTabs Class. - * - * @param Container $container The DI container. - * - * @return CustomTabs - * @since 3.2.0 - */ - public function getCustomTabs(Container $container): CustomTabs - { - return new CustomTabs(); - } - - /** - * Get The DatabaseKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseKeys - * @since 3.2.0 - */ - public function getDatabaseKeys(Container $container): DatabaseKeys - { - return new DatabaseKeys(); - } - - /** - * Get The DatabaseTables Class. - * - * @param Container $container The DI container. - * - * @return DatabaseTables - * @since 3.2.0 - */ - public function getDatabaseTables(Container $container): DatabaseTables - { - return new DatabaseTables(); - } - - /** - * Get The DatabaseUniqueGuid Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueGuid - * @since 3.2.0 - */ - public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid - { - return new DatabaseUniqueGuid(); - } - - /** - * Get The DatabaseUniqueKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueKeys - * @since 3.2.0 - */ - public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys - { - return new DatabaseUniqueKeys(); - } - - /** - * Get The DoNotEscape Class. - * - * @param Container $container The DI container. - * - * @return DoNotEscape - * @since 3.2.0 - */ - public function getDoNotEscape(Container $container): DoNotEscape - { - return new DoNotEscape(); - } - - /** - * Get The DynamicFields Class. - * - * @param Container $container The DI container. - * - * @return DynamicFields - * @since 3.2.0 - */ - public function getDynamicFields(Container $container): DynamicFields - { - return new DynamicFields(); - } - - /** - * Get The ExtensionCustomFields Class. - * - * @param Container $container The DI container. - * - * @return ExtensionCustomFields - * @since 3.2.0 - */ - public function getExtensionCustomFields(Container $container): ExtensionCustomFields - { - return new ExtensionCustomFields(); - } - - /** - * Get The ExtensionsParams Class. - * - * @param Container $container The DI container. - * - * @return ExtensionsParams - * @since 3.2.0 - */ - public function getExtensionsParams(Container $container): ExtensionsParams - { - return new ExtensionsParams(); - } - - /** - * Get The FieldGroupControl Class. - * - * @param Container $container The DI container. - * - * @return FieldGroupControl - * @since 3.2.0 - */ - public function getFieldGroupControl(Container $container): FieldGroupControl - { - return new FieldGroupControl(); - } - - /** - * Get The FieldNames Class. - * - * @param Container $container The DI container. - * - * @return FieldNames - * @since 3.2.0 - */ - public function getFieldNames(Container $container): FieldNames - { - return new FieldNames(); - } - - /** - * Get The FieldRelations Class. - * - * @param Container $container The DI container. - * - * @return FieldRelations - * @since 3.2.0 - */ - public function getFieldRelations(Container $container): FieldRelations - { - return new FieldRelations(); - } - - /** - * Get The Filter Class. - * - * @param Container $container The DI container. - * - * @return Filter - * @since 3.2.0 - */ - public function getFilter(Container $container): Filter - { - return new Filter(); - } - - /** - * Get The FootableScripts Class. - * - * @param Container $container The DI container. - * - * @return FootableScripts - * @since 3.2.0 - */ - public function getFootableScripts(Container $container): FootableScripts - { - return new FootableScripts(); - } - - /** - * Get The FrontendParams Class. - * - * @param Container $container The DI container. - * - * @return FrontendParams - * @since 3.2.0 - */ - public function getFrontendParams(Container $container): FrontendParams - { - return new FrontendParams(); - } - - /** - * Get The GetAsLookup Class. - * - * @param Container $container The DI container. - * - * @return GetAsLookup - * @since 3.2.0 - */ - public function getGetAsLookup(Container $container): GetAsLookup - { - return new GetAsLookup(); - } - - /** - * Get The GetModule Class. - * - * @param Container $container The DI container. - * - * @return GetModule - * @since 3.2.0 - */ - public function getGetModule(Container $container): GetModule - { - return new GetModule(); - } - - /** - * Get The GoogleChart Class. - * - * @param Container $container The DI container. - * - * @return GoogleChart - * @since 3.2.0 - */ - public function getGoogleChart(Container $container): GoogleChart - { - return new GoogleChart(); - } - - /** - * Get The HasMenuGlobal Class. - * - * @param Container $container The DI container. - * - * @return HasMenuGlobal - * @since 3.2.0 - */ - public function getHasMenuGlobal(Container $container): HasMenuGlobal - { - return new HasMenuGlobal(); - } - - /** - * Get The HasPermissions Class. - * - * @param Container $container The DI container. - * - * @return HasPermissions - * @since 3.2.0 - */ - public function getHasPermissions(Container $container): HasPermissions - { - return new HasPermissions(); - } - - /** - * Get The HiddenFields Class. - * - * @param Container $container The DI container. - * - * @return HiddenFields - * @since 3.2.0 - */ - public function getHiddenFields(Container $container): HiddenFields - { - return new HiddenFields(); - } - - /** - * Get The History Class. - * - * @param Container $container The DI container. - * - * @return History - * @since 3.2.0 - */ - public function getHistory(Container $container): History - { - return new History(); - } - - /** - * Get The IntegerFields Class. - * - * @param Container $container The DI container. - * - * @return IntegerFields - * @since 3.2.0 - */ - public function getIntegerFields(Container $container): IntegerFields - { - return new IntegerFields(); - } - - /** - * Get The ItemsMethodEximportString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodEximportString - * @since 3.2.0 - */ - public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString - { - return new ItemsMethodEximportString(); - } - - /** - * Get The ItemsMethodListString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodListString - * @since 3.2.0 - */ - public function getItemsMethodListString(Container $container): ItemsMethodListString - { - return new ItemsMethodListString(); - } - - /** - * Get The JsonItem Class. - * - * @param Container $container The DI container. - * - * @return JsonItem - * @since 3.2.0 - */ - public function getJsonItem(Container $container): JsonItem - { - return new JsonItem(); - } - - /** - * Get The JsonItemArray Class. - * - * @param Container $container The DI container. - * - * @return JsonItemArray - * @since 3.2.0 - */ - public function getJsonItemArray(Container $container): JsonItemArray - { - return new JsonItemArray(); - } - - /** - * Get The JsonString Class. - * - * @param Container $container The DI container. - * - * @return JsonString - * @since 3.2.0 - */ - public function getJsonString(Container $container): JsonString - { - return new JsonString(); - } - - /** - * Get The LanguageMessages Class. - * - * @param Container $container The DI container. - * - * @return LanguageMessages - * @since 3.2.0 - */ - public function getLanguageMessages(Container $container): LanguageMessages - { - return new LanguageMessages(); - } - - /** - * Get The Layout Class. - * - * @param Container $container The DI container. - * - * @return Layout - * @since 3.2.0 - */ - public function getLayout(Container $container): Layout - { - return new Layout(); - } - - /** - * Get The LayoutData Class. - * - * @param Container $container The DI container. - * - * @return LayoutData - * @since 3.2.0 - */ - public function getLayoutData(Container $container): LayoutData - { - return new LayoutData(); - } - - /** - * Get The LibraryManager Class. - * - * @param Container $container The DI container. - * - * @return LibraryManager - * @since 3.2.0 - */ - public function getLibraryManager(Container $container): LibraryManager - { - return new LibraryManager(); - } - - /** - * Get The ListFieldClass Class. - * - * @param Container $container The DI container. - * - * @return ListFieldClass - * @since 3.2.0 - */ - public function getListFieldClass(Container $container): ListFieldClass - { - return new ListFieldClass(); - } - - /** - * Get The ListHeadOverride Class. - * - * @param Container $container The DI container. - * - * @return ListHeadOverride - * @since 3.2.0 - */ - public function getListHeadOverride(Container $container): ListHeadOverride - { - return new ListHeadOverride(); - } - - /** - * Get The ListJoin Class. - * - * @param Container $container The DI container. - * - * @return ListJoin - * @since 3.2.0 - */ - public function getListJoin(Container $container): ListJoin - { - return new ListJoin(); - } - - /** - * Get The Lists Class. - * - * @param Container $container The DI container. - * - * @return Lists - * @since 3.2.0 - */ - public function getLists(Container $container): Lists - { - return new Lists(); - } - - /** - * Get The MainTextField Class. - * - * @param Container $container The DI container. - * - * @return MainTextField - * @since 3.2.0 - */ - public function getMainTextField(Container $container): MainTextField - { - return new MainTextField(); - } - - /** - * Get The MetaData Class. - * - * @param Container $container The DI container. - * - * @return MetaData - * @since 3.2.0 - */ - public function getMetaData(Container $container): MetaData - { - return new MetaData(); - } - - /** - * Get The ModelBasicField Class. - * - * @param Container $container The DI container. - * - * @return ModelBasicField - * @since 3.2.0 - */ - public function getModelBasicField(Container $container): ModelBasicField - { - return new ModelBasicField(); - } - - /** - * Get The ModelExpertField Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertField - * @since 3.2.0 - */ - public function getModelExpertField(Container $container): ModelExpertField - { - return new ModelExpertField(); - } - - /** - * Get The ModelExpertFieldInitiator Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertFieldInitiator - * @since 3.2.0 - */ - public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator - { - return new ModelExpertFieldInitiator(); - } - - /** - * Get The ModelMediumField Class. - * - * @param Container $container The DI container. - * - * @return ModelMediumField - * @since 3.2.0 - */ - public function getModelMediumField(Container $container): ModelMediumField - { - return new ModelMediumField(); - } - - /** - * Get The ModelWhmcsField Class. - * - * @param Container $container The DI container. - * - * @return ModelWhmcsField - * @since 3.2.0 - */ - public function getModelWhmcsField(Container $container): ModelWhmcsField - { - return new ModelWhmcsField(); - } - - /** - * Get The MovedPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return MovedPublishingFields - * @since 3.2.0 - */ - public function getMovedPublishingFields(Container $container): MovedPublishingFields - { - return new MovedPublishingFields(); - } - - /** - * Get The MysqlTableSetting Class. - * - * @param Container $container The DI container. - * - * @return MysqlTableSetting - * @since 3.2.0 - */ - public function getMysqlTableSetting(Container $container): MysqlTableSetting - { - return new MysqlTableSetting(); - } - - /** - * Get The NewPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return NewPublishingFields - * @since 3.2.0 - */ - public function getNewPublishingFields(Container $container): NewPublishingFields - { - return new NewPublishingFields(); - } - - /** - * Get The OrderZero Class. - * - * @param Container $container The DI container. - * - * @return OrderZero - * @since 3.2.0 - */ - public function getOrderZero(Container $container): OrderZero - { - return new OrderZero(); - } - - /** - * Get The OtherFilter Class. - * - * @param Container $container The DI container. - * - * @return OtherFilter - * @since 3.2.0 - */ - public function getOtherFilter(Container $container): OtherFilter - { - return new OtherFilter(); - } - - /** - * Get The OtherGroup Class. - * - * @param Container $container The DI container. - * - * @return OtherGroup - * @since 3.2.0 - */ - public function getOtherGroup(Container $container): OtherGroup - { - return new OtherGroup(); - } - - /** - * Get The OtherJoin Class. - * - * @param Container $container The DI container. - * - * @return OtherJoin - * @since 3.2.0 - */ - public function getOtherJoin(Container $container): OtherJoin - { - return new OtherJoin(); - } - - /** - * Get The OtherOrder Class. - * - * @param Container $container The DI container. - * - * @return OtherOrder - * @since 3.2.0 - */ - public function getOtherOrder(Container $container): OtherOrder - { - return new OtherOrder(); - } - - /** - * Get The OtherQuery Class. - * - * @param Container $container The DI container. - * - * @return OtherQuery - * @since 3.2.0 - */ - public function getOtherQuery(Container $container): OtherQuery - { - return new OtherQuery(); - } - - /** - * Get The OtherWhere Class. - * - * @param Container $container The DI container. - * - * @return OtherWhere - * @since 3.2.0 - */ - public function getOtherWhere(Container $container): OtherWhere - { - return new OtherWhere(); - } - - /** - * Get The PermissionAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionAction - * @since 3.2.0 - */ - public function getPermissionAction(Container $container): PermissionAction - { - return new PermissionAction(); - } - - /** - * Get The PermissionComponent Class. - * - * @param Container $container The DI container. - * - * @return PermissionComponent - * @since 3.2.0 - */ - public function getPermissionComponent(Container $container): PermissionComponent - { - return new PermissionComponent(); - } - - /** - * Get The PermissionCore Class. - * - * @param Container $container The DI container. - * - * @return PermissionCore - * @since 3.2.0 - */ - public function getPermissionCore(Container $container): PermissionCore - { - return new PermissionCore(); - } - - /** - * Get The PermissionDashboard Class. - * - * @param Container $container The DI container. - * - * @return PermissionDashboard - * @since 3.2.0 - */ - public function getPermissionDashboard(Container $container): PermissionDashboard - { - return new PermissionDashboard(); - } - - /** - * Get The PermissionFields Class. - * - * @param Container $container The DI container. - * - * @return PermissionFields - * @since 3.2.0 - */ - public function getPermissionFields(Container $container): PermissionFields - { - return new PermissionFields(); - } - - /** - * Get The PermissionGlobalAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionGlobalAction - * @since 3.2.0 - */ - public function getPermissionGlobalAction(Container $container): PermissionGlobalAction - { - return new PermissionGlobalAction(); - } - - /** - * Get The PermissionViews Class. - * - * @param Container $container The DI container. - * - * @return PermissionViews - * @since 3.2.0 - */ - public function getPermissionViews(Container $container): PermissionViews - { - return new PermissionViews(); - } - - /** - * Get The Request Class. - * - * @param Container $container The DI container. - * - * @return Request - * @since 3.2.0 - */ - public function getRequest(Container $container): Request - { - return new Request(); - } - - /** - * Get The ScriptMediaSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptMediaSwitch - * @since 3.2.0 - */ - public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch - { - return new ScriptMediaSwitch(); - } - - /** - * Get The ScriptUserSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptUserSwitch - * @since 3.2.0 - */ - public function getScriptUserSwitch(Container $container): ScriptUserSwitch - { - return new ScriptUserSwitch(); - } - - /** - * Get The Search Class. - * - * @param Container $container The DI container. - * - * @return Search - * @since 3.2.0 - */ - public function getSearch(Container $container): Search - { - return new Search(); - } - - /** - * Get The SelectionTranslation Class. - * - * @param Container $container The DI container. - * - * @return SelectionTranslation - * @since 3.2.0 - */ - public function getSelectionTranslation(Container $container): SelectionTranslation - { - return new SelectionTranslation(); - } - - /** - * Get The SiteDecrypt Class. - * - * @param Container $container The DI container. - * - * @return SiteDecrypt - * @since 3.2.0 - */ - public function getSiteDecrypt(Container $container): SiteDecrypt - { - return new SiteDecrypt(); - } - - /** - * Get The SiteDynamicGet Class. - * - * @param Container $container The DI container. - * - * @return SiteDynamicGet - * @since 3.2.0 - */ - public function getSiteDynamicGet(Container $container): SiteDynamicGet - { - return new SiteDynamicGet(); - } - - /** - * Get The SiteEditView Class. - * - * @param Container $container The DI container. - * - * @return SiteEditView - * @since 3.2.0 - */ - public function getSiteEditView(Container $container): SiteEditView - { - return new SiteEditView(); - } - - /** - * Get The SiteFieldData Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldData - * @since 3.2.0 - */ - public function getSiteFieldData(Container $container): SiteFieldData - { - return new SiteFieldData(); - } - - /** - * Get The SiteFieldDecodeFilter Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldDecodeFilter - * @since 3.2.0 - */ - public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter - { - return new SiteFieldDecodeFilter(); - } - - /** - * Get The SiteFields Class. - * - * @param Container $container The DI container. - * - * @return SiteFields - * @since 3.2.0 - */ - public function getSiteFields(Container $container): SiteFields - { - return new SiteFields(); - } - - /** - * Get The SiteMainGet Class. - * - * @param Container $container The DI container. - * - * @return SiteMainGet - * @since 3.2.0 - */ - public function getSiteMainGet(Container $container): SiteMainGet - { - return new SiteMainGet(); - } - - /** - * Get The Sort Class. - * - * @param Container $container The DI container. - * - * @return Sort - * @since 3.2.0 - */ - public function getSort(Container $container): Sort - { - return new Sort(); - } - - /** - * Get The TabCounter Class. - * - * @param Container $container The DI container. - * - * @return TabCounter - * @since 3.2.0 - */ - public function getTabCounter(Container $container): TabCounter - { - return new TabCounter(); - } - - /** - * Get The Tags Class. - * - * @param Container $container The DI container. - * - * @return Tags - * @since 3.2.0 - */ - public function getTags(Container $container): Tags - { - return new Tags(); - } - - /** - * Get The TemplateData Class. - * - * @param Container $container The DI container. - * - * @return TemplateData - * @since 3.2.0 - */ - public function getTemplateData(Container $container): TemplateData - { - return new TemplateData(); - } - - /** - * Get The Title Class. - * - * @param Container $container The DI container. - * - * @return Title - * @since 3.2.0 - */ - public function getTitle(Container $container): Title - { - return new Title(); - } - - /** - * Get The UikitComp Class. - * - * @param Container $container The DI container. - * - * @return UikitComp - * @since 3.2.0 - */ - public function getUikitComp(Container $container): UikitComp - { - return new UikitComp(); - } - - /** - * Get The UpdateMysql Class. - * - * @param Container $container The DI container. - * - * @return UpdateMysql - * @since 3.2.0 - */ - public function getUpdateMysql(Container $container): UpdateMysql - { - return new UpdateMysql(); - } - - /** - * Get The ViewsDefaultOrdering Class. - * - * @param Container $container The DI container. - * - * @return ViewsDefaultOrdering - * @since 3.2.0 - */ - public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering - { - return new ViewsDefaultOrdering(); + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') + ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); + + $container->alias(Layout::class, 'Compiler.Builder.Layout') + ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); + + $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') + ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); + + $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') + ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); + + $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') + ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); + + $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') + ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); + + $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') + ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); + + $container->alias(Lists::class, 'Compiler.Builder.Lists') + ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); + + $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') + ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); + + $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') + ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); + + $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') + ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); + + $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') + ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); + + $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') + ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); + + $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') + ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); + + $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') + ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); + + $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') + ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); + + $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') + ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); + + $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') + ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); + + $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') + ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); + + $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') + ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); + + $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') + ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); + + $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') + ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); + + $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') + ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); + + $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') + ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); + + $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') + ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); + + $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') + ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); + + $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') + ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); + + $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') + ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); + + $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') + ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); + + $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') + ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); + + $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') + ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); + + $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') + ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); + + $container->alias(Request::class, 'Compiler.Builder.Request') + ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); + + $container->alias(Router::class, 'Compiler.Builder.Router') + ->share('Compiler.Builder.Router', [$this, 'getRouter'], true); + + $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') + ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); + + $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') + ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); + + $container->alias(Search::class, 'Compiler.Builder.Search') + ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); + + $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') + ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); + + $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') + ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); + + $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') + ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); + + $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') + ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); + + $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') + ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); + + $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') + ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); + + $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') + ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); + + $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') + ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); + + $container->alias(Sort::class, 'Compiler.Builder.Sort') + ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); + + $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') + ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); + + $container->alias(Tags::class, 'Compiler.Builder.Tags') + ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); + + $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') + ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); + + $container->alias(Title::class, 'Compiler.Builder.Title') + ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); + + $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') + ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); + + $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') + ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); + + $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') + ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); + } + + /** + * Get The LanguageMessages Class. + * + * @param Container $container The DI container. + * + * @return LanguageMessages + * @since 3.2.0 + */ + public function getLanguageMessages(Container $container): LanguageMessages + { + return new LanguageMessages(); + } + + /** + * Get The Layout Class. + * + * @param Container $container The DI container. + * + * @return Layout + * @since 3.2.0 + */ + public function getLayout(Container $container): Layout + { + return new Layout(); + } + + /** + * Get The LayoutData Class. + * + * @param Container $container The DI container. + * + * @return LayoutData + * @since 3.2.0 + */ + public function getLayoutData(Container $container): LayoutData + { + return new LayoutData(); + } + + /** + * Get The LibraryManager Class. + * + * @param Container $container The DI container. + * + * @return LibraryManager + * @since 3.2.0 + */ + public function getLibraryManager(Container $container): LibraryManager + { + return new LibraryManager(); + } + + /** + * Get The ListFieldClass Class. + * + * @param Container $container The DI container. + * + * @return ListFieldClass + * @since 3.2.0 + */ + public function getListFieldClass(Container $container): ListFieldClass + { + return new ListFieldClass(); + } + + /** + * Get The ListHeadOverride Class. + * + * @param Container $container The DI container. + * + * @return ListHeadOverride + * @since 3.2.0 + */ + public function getListHeadOverride(Container $container): ListHeadOverride + { + return new ListHeadOverride(); + } + + /** + * Get The ListJoin Class. + * + * @param Container $container The DI container. + * + * @return ListJoin + * @since 3.2.0 + */ + public function getListJoin(Container $container): ListJoin + { + return new ListJoin(); + } + + /** + * Get The Lists Class. + * + * @param Container $container The DI container. + * + * @return Lists + * @since 3.2.0 + */ + public function getLists(Container $container): Lists + { + return new Lists(); + } + + /** + * Get The MainTextField Class. + * + * @param Container $container The DI container. + * + * @return MainTextField + * @since 3.2.0 + */ + public function getMainTextField(Container $container): MainTextField + { + return new MainTextField(); + } + + /** + * Get The MetaData Class. + * + * @param Container $container The DI container. + * + * @return MetaData + * @since 3.2.0 + */ + public function getMetaData(Container $container): MetaData + { + return new MetaData(); + } + + /** + * Get The ModelBasicField Class. + * + * @param Container $container The DI container. + * + * @return ModelBasicField + * @since 3.2.0 + */ + public function getModelBasicField(Container $container): ModelBasicField + { + return new ModelBasicField(); + } + + /** + * Get The ModelExpertField Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertField + * @since 3.2.0 + */ + public function getModelExpertField(Container $container): ModelExpertField + { + return new ModelExpertField(); + } + + /** + * Get The ModelExpertFieldInitiator Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertFieldInitiator + * @since 3.2.0 + */ + public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator + { + return new ModelExpertFieldInitiator(); + } + + /** + * Get The ModelMediumField Class. + * + * @param Container $container The DI container. + * + * @return ModelMediumField + * @since 3.2.0 + */ + public function getModelMediumField(Container $container): ModelMediumField + { + return new ModelMediumField(); + } + + /** + * Get The ModelWhmcsField Class. + * + * @param Container $container The DI container. + * + * @return ModelWhmcsField + * @since 3.2.0 + */ + public function getModelWhmcsField(Container $container): ModelWhmcsField + { + return new ModelWhmcsField(); + } + + /** + * Get The MovedPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return MovedPublishingFields + * @since 3.2.0 + */ + public function getMovedPublishingFields(Container $container): MovedPublishingFields + { + return new MovedPublishingFields(); + } + + /** + * Get The MysqlTableSetting Class. + * + * @param Container $container The DI container. + * + * @return MysqlTableSetting + * @since 3.2.0 + */ + public function getMysqlTableSetting(Container $container): MysqlTableSetting + { + return new MysqlTableSetting(); + } + + /** + * Get The NewPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return NewPublishingFields + * @since 3.2.0 + */ + public function getNewPublishingFields(Container $container): NewPublishingFields + { + return new NewPublishingFields(); + } + + /** + * Get The OrderZero Class. + * + * @param Container $container The DI container. + * + * @return OrderZero + * @since 3.2.0 + */ + public function getOrderZero(Container $container): OrderZero + { + return new OrderZero(); + } + + /** + * Get The OtherFilter Class. + * + * @param Container $container The DI container. + * + * @return OtherFilter + * @since 3.2.0 + */ + public function getOtherFilter(Container $container): OtherFilter + { + return new OtherFilter(); + } + + /** + * Get The OtherGroup Class. + * + * @param Container $container The DI container. + * + * @return OtherGroup + * @since 3.2.0 + */ + public function getOtherGroup(Container $container): OtherGroup + { + return new OtherGroup(); + } + + /** + * Get The OtherJoin Class. + * + * @param Container $container The DI container. + * + * @return OtherJoin + * @since 3.2.0 + */ + public function getOtherJoin(Container $container): OtherJoin + { + return new OtherJoin(); + } + + /** + * Get The OtherOrder Class. + * + * @param Container $container The DI container. + * + * @return OtherOrder + * @since 3.2.0 + */ + public function getOtherOrder(Container $container): OtherOrder + { + return new OtherOrder(); + } + + /** + * Get The OtherQuery Class. + * + * @param Container $container The DI container. + * + * @return OtherQuery + * @since 3.2.0 + */ + public function getOtherQuery(Container $container): OtherQuery + { + return new OtherQuery(); + } + + /** + * Get The OtherWhere Class. + * + * @param Container $container The DI container. + * + * @return OtherWhere + * @since 3.2.0 + */ + public function getOtherWhere(Container $container): OtherWhere + { + return new OtherWhere(); + } + + /** + * Get The PermissionAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionAction + * @since 3.2.0 + */ + public function getPermissionAction(Container $container): PermissionAction + { + return new PermissionAction(); + } + + /** + * Get The PermissionComponent Class. + * + * @param Container $container The DI container. + * + * @return PermissionComponent + * @since 3.2.0 + */ + public function getPermissionComponent(Container $container): PermissionComponent + { + return new PermissionComponent(); + } + + /** + * Get The PermissionCore Class. + * + * @param Container $container The DI container. + * + * @return PermissionCore + * @since 3.2.0 + */ + public function getPermissionCore(Container $container): PermissionCore + { + return new PermissionCore(); + } + + /** + * Get The PermissionDashboard Class. + * + * @param Container $container The DI container. + * + * @return PermissionDashboard + * @since 3.2.0 + */ + public function getPermissionDashboard(Container $container): PermissionDashboard + { + return new PermissionDashboard(); + } + + /** + * Get The PermissionFields Class. + * + * @param Container $container The DI container. + * + * @return PermissionFields + * @since 3.2.0 + */ + public function getPermissionFields(Container $container): PermissionFields + { + return new PermissionFields(); + } + + /** + * Get The PermissionGlobalAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionGlobalAction + * @since 3.2.0 + */ + public function getPermissionGlobalAction(Container $container): PermissionGlobalAction + { + return new PermissionGlobalAction(); + } + + /** + * Get The PermissionViews Class. + * + * @param Container $container The DI container. + * + * @return PermissionViews + * @since 3.2.0 + */ + public function getPermissionViews(Container $container): PermissionViews + { + return new PermissionViews(); + } + + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request(); + } + + /** + * 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(); + } + + /** + * Get The ScriptMediaSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptMediaSwitch + * @since 3.2.0 + */ + public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch + { + return new ScriptMediaSwitch(); + } + + /** + * Get The ScriptUserSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptUserSwitch + * @since 3.2.0 + */ + public function getScriptUserSwitch(Container $container): ScriptUserSwitch + { + return new ScriptUserSwitch(); + } + + /** + * Get The Search Class. + * + * @param Container $container The DI container. + * + * @return Search + * @since 3.2.0 + */ + public function getSearch(Container $container): Search + { + return new Search(); + } + + /** + * Get The SelectionTranslation Class. + * + * @param Container $container The DI container. + * + * @return SelectionTranslation + * @since 3.2.0 + */ + public function getSelectionTranslation(Container $container): SelectionTranslation + { + return new SelectionTranslation(); + } + + /** + * Get The SiteDecrypt Class. + * + * @param Container $container The DI container. + * + * @return SiteDecrypt + * @since 3.2.0 + */ + public function getSiteDecrypt(Container $container): SiteDecrypt + { + return new SiteDecrypt(); + } + + /** + * Get The SiteDynamicGet Class. + * + * @param Container $container The DI container. + * + * @return SiteDynamicGet + * @since 3.2.0 + */ + public function getSiteDynamicGet(Container $container): SiteDynamicGet + { + return new SiteDynamicGet(); + } + + /** + * Get The SiteEditView Class. + * + * @param Container $container The DI container. + * + * @return SiteEditView + * @since 3.2.0 + */ + public function getSiteEditView(Container $container): SiteEditView + { + return new SiteEditView(); + } + + /** + * Get The SiteFieldData Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldData + * @since 3.2.0 + */ + public function getSiteFieldData(Container $container): SiteFieldData + { + return new SiteFieldData(); + } + + /** + * Get The SiteFieldDecodeFilter Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldDecodeFilter + * @since 3.2.0 + */ + public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter + { + return new SiteFieldDecodeFilter(); + } + + /** + * Get The SiteFields Class. + * + * @param Container $container The DI container. + * + * @return SiteFields + * @since 3.2.0 + */ + public function getSiteFields(Container $container): SiteFields + { + return new SiteFields(); + } + + /** + * Get The SiteMainGet Class. + * + * @param Container $container The DI container. + * + * @return SiteMainGet + * @since 3.2.0 + */ + public function getSiteMainGet(Container $container): SiteMainGet + { + return new SiteMainGet(); + } + + /** + * Get The Sort Class. + * + * @param Container $container The DI container. + * + * @return Sort + * @since 3.2.0 + */ + public function getSort(Container $container): Sort + { + return new Sort(); + } + + /** + * Get The TabCounter Class. + * + * @param Container $container The DI container. + * + * @return TabCounter + * @since 3.2.0 + */ + public function getTabCounter(Container $container): TabCounter + { + return new TabCounter(); + } + + /** + * Get The Tags Class. + * + * @param Container $container The DI container. + * + * @return Tags + * @since 3.2.0 + */ + public function getTags(Container $container): Tags + { + return new Tags(); + } + + /** + * Get The TemplateData Class. + * + * @param Container $container The DI container. + * + * @return TemplateData + * @since 3.2.0 + */ + public function getTemplateData(Container $container): TemplateData + { + return new TemplateData(); + } + + /** + * Get The Title Class. + * + * @param Container $container The DI container. + * + * @return Title + * @since 3.2.0 + */ + public function getTitle(Container $container): Title + { + return new Title(); + } + + /** + * Get The UikitComp Class. + * + * @param Container $container The DI container. + * + * @return UikitComp + * @since 3.2.0 + */ + public function getUikitComp(Container $container): UikitComp + { + return new UikitComp(); + } + + /** + * Get The UpdateMysql Class. + * + * @param Container $container The DI container. + * + * @return UpdateMysql + * @since 3.2.0 + */ + public function getUpdateMysql(Container $container): UpdateMysql + { + return new UpdateMysql(); + } + + /** + * Get The ViewsDefaultOrdering Class. + * + * @param Container $container The DI container. + * + * @return ViewsDefaultOrdering + * @since 3.2.0 + */ + public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering + { + return new ViewsDefaultOrdering(); } } diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power index cc6d6d1..9aa1110 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.power @@ -1,1610 +1,858 @@ - /** - * Registers the service provider with a DI container. - * - * @param Container $container The DI container. - * - * @return void - * @since 3.2.0 - */ - public function register(Container $container) - { - $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') - ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); - - $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') - ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); - - $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') - ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); - - $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') - ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); - - $container->alias(Alias::class, 'Compiler.Builder.Alias') - ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); - - $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') - ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); - - $container->alias(Category::class, 'Compiler.Builder.Category') - ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); - - $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') - ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); - - $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') - ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); - - $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') - ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); - - $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') - ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); - - $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') - ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); - - $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') - ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); - - $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') - ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); - - $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') - ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); - - $container->alias(Contributors::class, 'Compiler.Builder.Contributors') - ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); - - $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') - ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); - - $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') - ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); - - $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') - ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); - - $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') - ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); - - $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') - ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); - - $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') - ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); - - $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') - ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); - - $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') - ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); - - $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') - ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); - - $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') - ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); - - $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') - ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); - - $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') - ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); - - $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') - ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); - - $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') - ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); - - $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') - ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); - - $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') - ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); - - $container->alias(Filter::class, 'Compiler.Builder.Filter') - ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); - - $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') - ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); - - $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') - ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); - - $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') - ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); - - $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') - ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); - - $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') - ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); - - $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') - ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); - - $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') - ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); - - $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') - ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); - - $container->alias(History::class, 'Compiler.Builder.History') - ->share('Compiler.Builder.History', [$this, 'getHistory'], true); - - $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') - ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); - - $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') - ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); - - $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') - ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); - - $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') - ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); - - $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') - ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); - - $container->alias(JsonString::class, 'Compiler.Builder.Json.String') - ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); - - $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') - ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); - - $container->alias(Layout::class, 'Compiler.Builder.Layout') - ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); - - $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') - ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); - - $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') - ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); - - $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') - ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); - - $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') - ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); - - $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') - ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); - - $container->alias(Lists::class, 'Compiler.Builder.Lists') - ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); - - $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') - ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); - - $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') - ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); - - $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') - ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); - - $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') - ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); - - $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') - ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); - - $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') - ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); - - $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') - ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); - - $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') - ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); - - $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') - ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); - - $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') - ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); - - $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') - ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); - - $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') - ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); - - $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') - ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); - - $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') - ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); - - $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') - ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); - - $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') - ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); - - $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') - ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); - - $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') - ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); - - $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') - ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); - - $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') - ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); - - $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') - ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); - - $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') - ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); - - $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') - ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); - - $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') - ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); - - $container->alias(Request::class, 'Compiler.Builder.Request') - ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); - - $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') - ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); - - $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') - ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); - - $container->alias(Search::class, 'Compiler.Builder.Search') - ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); - - $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') - ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); - - $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') - ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); - - $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') - ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); - - $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') - ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); - - $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') - ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); - - $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') - ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); - - $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') - ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); - - $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') - ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); - - $container->alias(Sort::class, 'Compiler.Builder.Sort') - ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); - - $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') - ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); - - $container->alias(Tags::class, 'Compiler.Builder.Tags') - ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); - - $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') - ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); - - $container->alias(Title::class, 'Compiler.Builder.Title') - ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); - - $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') - ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); - - $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') - ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); - - $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') - ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); - } - - /** - * Get The AccessSwitch Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitch - * @since 3.2.0 - */ - public function getAccessSwitch(Container $container): AccessSwitch - { - return new AccessSwitch(); - } - - /** - * Get The AccessSwitchList Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitchList - * @since 3.2.0 - */ - public function getAccessSwitchList(Container $container): AccessSwitchList - { - return new AccessSwitchList(); - } - - /** - * Get The AssetsRules Class. - * - * @param Container $container The DI container. - * - * @return AssetsRules - * @since 3.2.0 - */ - public function getAssetsRules(Container $container): AssetsRules - { - return new AssetsRules(); - } - - /** - * Get The AdminFilterType Class. - * - * @param Container $container The DI container. - * - * @return AdminFilterType - * @since 3.2.0 - */ - public function getAdminFilterType(Container $container): AdminFilterType - { - return new AdminFilterType(); - } - - /** - * Get The Alias Class. - * - * @param Container $container The DI container. - * - * @return Alias - * @since 3.2.0 - */ - public function getAlias(Container $container): Alias - { - return new Alias(); - } - - /** - * Get The BaseSixFour Class. - * - * @param Container $container The DI container. - * - * @return BaseSixFour - * @since 3.2.0 - */ - public function getBaseSixFour(Container $container): BaseSixFour - { - return new BaseSixFour(); - } - - /** - * Get The Category Class. - * - * @param Container $container The DI container. - * - * @return Category - * @since 3.2.0 - */ - public function getCategory(Container $container): Category - { - return new Category(); - } - - /** - * Get The CategoryCode Class. - * - * @param Container $container The DI container. - * - * @return CategoryCode - * @since 3.2.0 - */ - public function getCategoryCode(Container $container): CategoryCode - { - return new CategoryCode(); - } - - /** - * Get The CategoryOtherName Class. - * - * @param Container $container The DI container. - * - * @return CategoryOtherName - * @since 3.2.0 - */ - public function getCategoryOtherName(Container $container): CategoryOtherName - { - return new CategoryOtherName(); - } - - /** - * Get The CheckBox Class. - * - * @param Container $container The DI container. - * - * @return CheckBox - * @since 3.2.0 - */ - public function getCheckBox(Container $container): CheckBox - { - return new CheckBox(); - } - - /** - * Get The ComponentFields Class. - * - * @param Container $container The DI container. - * - * @return ComponentFields - * @since 3.2.0 - */ - public function getComponentFields(Container $container): ComponentFields - { - return new ComponentFields(); - } - - /** - * Get The ConfigFieldsets Class. - * - * @param Container $container The DI container. - * - * @return ConfigFieldsets - * @since 3.2.0 - */ - public function getConfigFieldsets(Container $container): ConfigFieldsets - { - return new ConfigFieldsets(); - } - - /** - * Get The ConfigFieldsetsCustomfield Class. - * - * @param Container $container The DI container. - * - * @return ConfigFieldsetsCustomfield - * @since 3.2.0 - */ - public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield - { - return new ConfigFieldsetsCustomfield(); - } - - /** - * Get The ContentMulti Class. - * - * @param Container $container The DI container. - * - * @return ContentMulti - * @since 3.2.0 - */ - public function getContentMulti(Container $container): ContentMulti - { - return new ContentMulti(); - } - - /** - * Get The ContentOne Class. - * - * @param Container $container The DI container. - * - * @return ContentOne - * @since 3.2.0 - */ - public function getContentOne(Container $container): ContentOne - { - return new ContentOne(); - } - - /** - * Get The Contributors Class. - * - * @param Container $container The DI container. - * - * @return Contributors - * @since 3.2.0 - */ - public function getContributors(Container $container): Contributors - { - return new Contributors(); - } - - /** - * Get The CustomAlias Class. - * - * @param Container $container The DI container. - * - * @return CustomAlias - * @since 3.2.0 - */ - public function getCustomAlias(Container $container): CustomAlias - { - return new CustomAlias(); - } - - /** - * Get The CustomField Class. - * - * @param Container $container The DI container. - * - * @return CustomField - * @since 3.2.0 - */ - public function getCustomField(Container $container): CustomField - { - return new CustomField(); - } - - /** - * Get The CustomFieldLinks Class. - * - * @param Container $container The DI container. - * - * @return CustomFieldLinks - * @since 3.2.0 - */ - public function getCustomFieldLinks(Container $container): CustomFieldLinks - { - return new CustomFieldLinks(); - } - - /** - * Get The CustomList Class. - * - * @param Container $container The DI container. - * - * @return CustomList - * @since 3.2.0 - */ - public function getCustomList(Container $container): CustomList - { - return new CustomList(); - } - - /** - * Get The CustomTabs Class. - * - * @param Container $container The DI container. - * - * @return CustomTabs - * @since 3.2.0 - */ - public function getCustomTabs(Container $container): CustomTabs - { - return new CustomTabs(); - } - - /** - * Get The DatabaseKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseKeys - * @since 3.2.0 - */ - public function getDatabaseKeys(Container $container): DatabaseKeys - { - return new DatabaseKeys(); - } - - /** - * Get The DatabaseTables Class. - * - * @param Container $container The DI container. - * - * @return DatabaseTables - * @since 3.2.0 - */ - public function getDatabaseTables(Container $container): DatabaseTables - { - return new DatabaseTables(); - } - - /** - * Get The DatabaseUniqueGuid Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueGuid - * @since 3.2.0 - */ - public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid - { - return new DatabaseUniqueGuid(); - } - - /** - * Get The DatabaseUniqueKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueKeys - * @since 3.2.0 - */ - public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys - { - return new DatabaseUniqueKeys(); - } - - /** - * Get The DoNotEscape Class. - * - * @param Container $container The DI container. - * - * @return DoNotEscape - * @since 3.2.0 - */ - public function getDoNotEscape(Container $container): DoNotEscape - { - return new DoNotEscape(); - } - - /** - * Get The DynamicFields Class. - * - * @param Container $container The DI container. - * - * @return DynamicFields - * @since 3.2.0 - */ - public function getDynamicFields(Container $container): DynamicFields - { - return new DynamicFields(); - } - - /** - * Get The ExtensionCustomFields Class. - * - * @param Container $container The DI container. - * - * @return ExtensionCustomFields - * @since 3.2.0 - */ - public function getExtensionCustomFields(Container $container): ExtensionCustomFields - { - return new ExtensionCustomFields(); - } - - /** - * Get The ExtensionsParams Class. - * - * @param Container $container The DI container. - * - * @return ExtensionsParams - * @since 3.2.0 - */ - public function getExtensionsParams(Container $container): ExtensionsParams - { - return new ExtensionsParams(); - } - - /** - * Get The FieldGroupControl Class. - * - * @param Container $container The DI container. - * - * @return FieldGroupControl - * @since 3.2.0 - */ - public function getFieldGroupControl(Container $container): FieldGroupControl - { - return new FieldGroupControl(); - } - - /** - * Get The FieldNames Class. - * - * @param Container $container The DI container. - * - * @return FieldNames - * @since 3.2.0 - */ - public function getFieldNames(Container $container): FieldNames - { - return new FieldNames(); - } - - /** - * Get The FieldRelations Class. - * - * @param Container $container The DI container. - * - * @return FieldRelations - * @since 3.2.0 - */ - public function getFieldRelations(Container $container): FieldRelations - { - return new FieldRelations(); - } - - /** - * Get The Filter Class. - * - * @param Container $container The DI container. - * - * @return Filter - * @since 3.2.0 - */ - public function getFilter(Container $container): Filter - { - return new Filter(); - } - - /** - * Get The FootableScripts Class. - * - * @param Container $container The DI container. - * - * @return FootableScripts - * @since 3.2.0 - */ - public function getFootableScripts(Container $container): FootableScripts - { - return new FootableScripts(); - } - - /** - * Get The FrontendParams Class. - * - * @param Container $container The DI container. - * - * @return FrontendParams - * @since 3.2.0 - */ - public function getFrontendParams(Container $container): FrontendParams - { - return new FrontendParams(); - } - - /** - * Get The GetAsLookup Class. - * - * @param Container $container The DI container. - * - * @return GetAsLookup - * @since 3.2.0 - */ - public function getGetAsLookup(Container $container): GetAsLookup - { - return new GetAsLookup(); - } - - /** - * Get The GetModule Class. - * - * @param Container $container The DI container. - * - * @return GetModule - * @since 3.2.0 - */ - public function getGetModule(Container $container): GetModule - { - return new GetModule(); - } - - /** - * Get The GoogleChart Class. - * - * @param Container $container The DI container. - * - * @return GoogleChart - * @since 3.2.0 - */ - public function getGoogleChart(Container $container): GoogleChart - { - return new GoogleChart(); - } - - /** - * Get The HasMenuGlobal Class. - * - * @param Container $container The DI container. - * - * @return HasMenuGlobal - * @since 3.2.0 - */ - public function getHasMenuGlobal(Container $container): HasMenuGlobal - { - return new HasMenuGlobal(); - } - - /** - * Get The HasPermissions Class. - * - * @param Container $container The DI container. - * - * @return HasPermissions - * @since 3.2.0 - */ - public function getHasPermissions(Container $container): HasPermissions - { - return new HasPermissions(); - } - - /** - * Get The HiddenFields Class. - * - * @param Container $container The DI container. - * - * @return HiddenFields - * @since 3.2.0 - */ - public function getHiddenFields(Container $container): HiddenFields - { - return new HiddenFields(); - } - - /** - * Get The History Class. - * - * @param Container $container The DI container. - * - * @return History - * @since 3.2.0 - */ - public function getHistory(Container $container): History - { - return new History(); - } - - /** - * Get The IntegerFields Class. - * - * @param Container $container The DI container. - * - * @return IntegerFields - * @since 3.2.0 - */ - public function getIntegerFields(Container $container): IntegerFields - { - return new IntegerFields(); - } - - /** - * Get The ItemsMethodEximportString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodEximportString - * @since 3.2.0 - */ - public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString - { - return new ItemsMethodEximportString(); - } - - /** - * Get The ItemsMethodListString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodListString - * @since 3.2.0 - */ - public function getItemsMethodListString(Container $container): ItemsMethodListString - { - return new ItemsMethodListString(); - } - - /** - * Get The JsonItem Class. - * - * @param Container $container The DI container. - * - * @return JsonItem - * @since 3.2.0 - */ - public function getJsonItem(Container $container): JsonItem - { - return new JsonItem(); - } - - /** - * Get The JsonItemArray Class. - * - * @param Container $container The DI container. - * - * @return JsonItemArray - * @since 3.2.0 - */ - public function getJsonItemArray(Container $container): JsonItemArray - { - return new JsonItemArray(); - } - - /** - * Get The JsonString Class. - * - * @param Container $container The DI container. - * - * @return JsonString - * @since 3.2.0 - */ - public function getJsonString(Container $container): JsonString - { - return new JsonString(); - } - - /** - * Get The LanguageMessages Class. - * - * @param Container $container The DI container. - * - * @return LanguageMessages - * @since 3.2.0 - */ - public function getLanguageMessages(Container $container): LanguageMessages - { - return new LanguageMessages(); - } - - /** - * Get The Layout Class. - * - * @param Container $container The DI container. - * - * @return Layout - * @since 3.2.0 - */ - public function getLayout(Container $container): Layout - { - return new Layout(); - } - - /** - * Get The LayoutData Class. - * - * @param Container $container The DI container. - * - * @return LayoutData - * @since 3.2.0 - */ - public function getLayoutData(Container $container): LayoutData - { - return new LayoutData(); - } - - /** - * Get The LibraryManager Class. - * - * @param Container $container The DI container. - * - * @return LibraryManager - * @since 3.2.0 - */ - public function getLibraryManager(Container $container): LibraryManager - { - return new LibraryManager(); - } - - /** - * Get The ListFieldClass Class. - * - * @param Container $container The DI container. - * - * @return ListFieldClass - * @since 3.2.0 - */ - public function getListFieldClass(Container $container): ListFieldClass - { - return new ListFieldClass(); - } - - /** - * Get The ListHeadOverride Class. - * - * @param Container $container The DI container. - * - * @return ListHeadOverride - * @since 3.2.0 - */ - public function getListHeadOverride(Container $container): ListHeadOverride - { - return new ListHeadOverride(); - } - - /** - * Get The ListJoin Class. - * - * @param Container $container The DI container. - * - * @return ListJoin - * @since 3.2.0 - */ - public function getListJoin(Container $container): ListJoin - { - return new ListJoin(); - } - - /** - * Get The Lists Class. - * - * @param Container $container The DI container. - * - * @return Lists - * @since 3.2.0 - */ - public function getLists(Container $container): Lists - { - return new Lists(); - } - - /** - * Get The MainTextField Class. - * - * @param Container $container The DI container. - * - * @return MainTextField - * @since 3.2.0 - */ - public function getMainTextField(Container $container): MainTextField - { - return new MainTextField(); - } - - /** - * Get The MetaData Class. - * - * @param Container $container The DI container. - * - * @return MetaData - * @since 3.2.0 - */ - public function getMetaData(Container $container): MetaData - { - return new MetaData(); - } - - /** - * Get The ModelBasicField Class. - * - * @param Container $container The DI container. - * - * @return ModelBasicField - * @since 3.2.0 - */ - public function getModelBasicField(Container $container): ModelBasicField - { - return new ModelBasicField(); - } - - /** - * Get The ModelExpertField Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertField - * @since 3.2.0 - */ - public function getModelExpertField(Container $container): ModelExpertField - { - return new ModelExpertField(); - } - - /** - * Get The ModelExpertFieldInitiator Class. - * - * @param Container $container The DI container. - * - * @return ModelExpertFieldInitiator - * @since 3.2.0 - */ - public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator - { - return new ModelExpertFieldInitiator(); - } - - /** - * Get The ModelMediumField Class. - * - * @param Container $container The DI container. - * - * @return ModelMediumField - * @since 3.2.0 - */ - public function getModelMediumField(Container $container): ModelMediumField - { - return new ModelMediumField(); - } - - /** - * Get The ModelWhmcsField Class. - * - * @param Container $container The DI container. - * - * @return ModelWhmcsField - * @since 3.2.0 - */ - public function getModelWhmcsField(Container $container): ModelWhmcsField - { - return new ModelWhmcsField(); - } - - /** - * Get The MovedPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return MovedPublishingFields - * @since 3.2.0 - */ - public function getMovedPublishingFields(Container $container): MovedPublishingFields - { - return new MovedPublishingFields(); - } - - /** - * Get The MysqlTableSetting Class. - * - * @param Container $container The DI container. - * - * @return MysqlTableSetting - * @since 3.2.0 - */ - public function getMysqlTableSetting(Container $container): MysqlTableSetting - { - return new MysqlTableSetting(); - } - - /** - * Get The NewPublishingFields Class. - * - * @param Container $container The DI container. - * - * @return NewPublishingFields - * @since 3.2.0 - */ - public function getNewPublishingFields(Container $container): NewPublishingFields - { - return new NewPublishingFields(); - } - - /** - * Get The OrderZero Class. - * - * @param Container $container The DI container. - * - * @return OrderZero - * @since 3.2.0 - */ - public function getOrderZero(Container $container): OrderZero - { - return new OrderZero(); - } - - /** - * Get The OtherFilter Class. - * - * @param Container $container The DI container. - * - * @return OtherFilter - * @since 3.2.0 - */ - public function getOtherFilter(Container $container): OtherFilter - { - return new OtherFilter(); - } - - /** - * Get The OtherGroup Class. - * - * @param Container $container The DI container. - * - * @return OtherGroup - * @since 3.2.0 - */ - public function getOtherGroup(Container $container): OtherGroup - { - return new OtherGroup(); - } - - /** - * Get The OtherJoin Class. - * - * @param Container $container The DI container. - * - * @return OtherJoin - * @since 3.2.0 - */ - public function getOtherJoin(Container $container): OtherJoin - { - return new OtherJoin(); - } - - /** - * Get The OtherOrder Class. - * - * @param Container $container The DI container. - * - * @return OtherOrder - * @since 3.2.0 - */ - public function getOtherOrder(Container $container): OtherOrder - { - return new OtherOrder(); - } - - /** - * Get The OtherQuery Class. - * - * @param Container $container The DI container. - * - * @return OtherQuery - * @since 3.2.0 - */ - public function getOtherQuery(Container $container): OtherQuery - { - return new OtherQuery(); - } - - /** - * Get The OtherWhere Class. - * - * @param Container $container The DI container. - * - * @return OtherWhere - * @since 3.2.0 - */ - public function getOtherWhere(Container $container): OtherWhere - { - return new OtherWhere(); - } - - /** - * Get The PermissionAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionAction - * @since 3.2.0 - */ - public function getPermissionAction(Container $container): PermissionAction - { - return new PermissionAction(); - } - - /** - * Get The PermissionComponent Class. - * - * @param Container $container The DI container. - * - * @return PermissionComponent - * @since 3.2.0 - */ - public function getPermissionComponent(Container $container): PermissionComponent - { - return new PermissionComponent(); - } - - /** - * Get The PermissionCore Class. - * - * @param Container $container The DI container. - * - * @return PermissionCore - * @since 3.2.0 - */ - public function getPermissionCore(Container $container): PermissionCore - { - return new PermissionCore(); - } - - /** - * Get The PermissionDashboard Class. - * - * @param Container $container The DI container. - * - * @return PermissionDashboard - * @since 3.2.0 - */ - public function getPermissionDashboard(Container $container): PermissionDashboard - { - return new PermissionDashboard(); - } - - /** - * Get The PermissionFields Class. - * - * @param Container $container The DI container. - * - * @return PermissionFields - * @since 3.2.0 - */ - public function getPermissionFields(Container $container): PermissionFields - { - return new PermissionFields(); - } - - /** - * Get The PermissionGlobalAction Class. - * - * @param Container $container The DI container. - * - * @return PermissionGlobalAction - * @since 3.2.0 - */ - public function getPermissionGlobalAction(Container $container): PermissionGlobalAction - { - return new PermissionGlobalAction(); - } - - /** - * Get The PermissionViews Class. - * - * @param Container $container The DI container. - * - * @return PermissionViews - * @since 3.2.0 - */ - public function getPermissionViews(Container $container): PermissionViews - { - return new PermissionViews(); - } - - /** - * Get The Request Class. - * - * @param Container $container The DI container. - * - * @return Request - * @since 3.2.0 - */ - public function getRequest(Container $container): Request - { - return new Request(); - } - - /** - * Get The ScriptMediaSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptMediaSwitch - * @since 3.2.0 - */ - public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch - { - return new ScriptMediaSwitch(); - } - - /** - * Get The ScriptUserSwitch Class. - * - * @param Container $container The DI container. - * - * @return ScriptUserSwitch - * @since 3.2.0 - */ - public function getScriptUserSwitch(Container $container): ScriptUserSwitch - { - return new ScriptUserSwitch(); - } - - /** - * Get The Search Class. - * - * @param Container $container The DI container. - * - * @return Search - * @since 3.2.0 - */ - public function getSearch(Container $container): Search - { - return new Search(); - } - - /** - * Get The SelectionTranslation Class. - * - * @param Container $container The DI container. - * - * @return SelectionTranslation - * @since 3.2.0 - */ - public function getSelectionTranslation(Container $container): SelectionTranslation - { - return new SelectionTranslation(); - } - - /** - * Get The SiteDecrypt Class. - * - * @param Container $container The DI container. - * - * @return SiteDecrypt - * @since 3.2.0 - */ - public function getSiteDecrypt(Container $container): SiteDecrypt - { - return new SiteDecrypt(); - } - - /** - * Get The SiteDynamicGet Class. - * - * @param Container $container The DI container. - * - * @return SiteDynamicGet - * @since 3.2.0 - */ - public function getSiteDynamicGet(Container $container): SiteDynamicGet - { - return new SiteDynamicGet(); - } - - /** - * Get The SiteEditView Class. - * - * @param Container $container The DI container. - * - * @return SiteEditView - * @since 3.2.0 - */ - public function getSiteEditView(Container $container): SiteEditView - { - return new SiteEditView(); - } - - /** - * Get The SiteFieldData Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldData - * @since 3.2.0 - */ - public function getSiteFieldData(Container $container): SiteFieldData - { - return new SiteFieldData(); - } - - /** - * Get The SiteFieldDecodeFilter Class. - * - * @param Container $container The DI container. - * - * @return SiteFieldDecodeFilter - * @since 3.2.0 - */ - public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter - { - return new SiteFieldDecodeFilter(); - } - - /** - * Get The SiteFields Class. - * - * @param Container $container The DI container. - * - * @return SiteFields - * @since 3.2.0 - */ - public function getSiteFields(Container $container): SiteFields - { - return new SiteFields(); - } - - /** - * Get The SiteMainGet Class. - * - * @param Container $container The DI container. - * - * @return SiteMainGet - * @since 3.2.0 - */ - public function getSiteMainGet(Container $container): SiteMainGet - { - return new SiteMainGet(); - } - - /** - * Get The Sort Class. - * - * @param Container $container The DI container. - * - * @return Sort - * @since 3.2.0 - */ - public function getSort(Container $container): Sort - { - return new Sort(); - } - - /** - * Get The TabCounter Class. - * - * @param Container $container The DI container. - * - * @return TabCounter - * @since 3.2.0 - */ - public function getTabCounter(Container $container): TabCounter - { - return new TabCounter(); - } - - /** - * Get The Tags Class. - * - * @param Container $container The DI container. - * - * @return Tags - * @since 3.2.0 - */ - public function getTags(Container $container): Tags - { - return new Tags(); - } - - /** - * Get The TemplateData Class. - * - * @param Container $container The DI container. - * - * @return TemplateData - * @since 3.2.0 - */ - public function getTemplateData(Container $container): TemplateData - { - return new TemplateData(); - } - - /** - * Get The Title Class. - * - * @param Container $container The DI container. - * - * @return Title - * @since 3.2.0 - */ - public function getTitle(Container $container): Title - { - return new Title(); - } - - /** - * Get The UikitComp Class. - * - * @param Container $container The DI container. - * - * @return UikitComp - * @since 3.2.0 - */ - public function getUikitComp(Container $container): UikitComp - { - return new UikitComp(); - } - - /** - * Get The UpdateMysql Class. - * - * @param Container $container The DI container. - * - * @return UpdateMysql - * @since 3.2.0 - */ - public function getUpdateMysql(Container $container): UpdateMysql - { - return new UpdateMysql(); - } - - /** - * Get The ViewsDefaultOrdering Class. - * - * @param Container $container The DI container. - * - * @return ViewsDefaultOrdering - * @since 3.2.0 - */ - public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering - { - return new ViewsDefaultOrdering(); + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') + ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); + + $container->alias(Layout::class, 'Compiler.Builder.Layout') + ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); + + $container->alias(LayoutData::class, 'Compiler.Builder.Layout.Data') + ->share('Compiler.Builder.Layout.Data', [$this, 'getLayoutData'], true); + + $container->alias(LibraryManager::class, 'Compiler.Builder.Library.Manager') + ->share('Compiler.Builder.Library.Manager', [$this, 'getLibraryManager'], true); + + $container->alias(ListFieldClass::class, 'Compiler.Builder.List.Field.Class') + ->share('Compiler.Builder.List.Field.Class', [$this, 'getListFieldClass'], true); + + $container->alias(ListHeadOverride::class, 'Compiler.Builder.List.Head.Override') + ->share('Compiler.Builder.List.Head.Override', [$this, 'getListHeadOverride'], true); + + $container->alias(ListJoin::class, 'Compiler.Builder.List.Join') + ->share('Compiler.Builder.List.Join', [$this, 'getListJoin'], true); + + $container->alias(Lists::class, 'Compiler.Builder.Lists') + ->share('Compiler.Builder.Lists', [$this, 'getLists'], true); + + $container->alias(MainTextField::class, 'Compiler.Builder.Main.Text.Field') + ->share('Compiler.Builder.Main.Text.Field', [$this, 'getMainTextField'], true); + + $container->alias(MetaData::class, 'Compiler.Builder.Meta.Data') + ->share('Compiler.Builder.Meta.Data', [$this, 'getMetaData'], true); + + $container->alias(ModelBasicField::class, 'Compiler.Builder.Model.Basic.Field') + ->share('Compiler.Builder.Model.Basic.Field', [$this, 'getModelBasicField'], true); + + $container->alias(ModelExpertField::class, 'Compiler.Builder.Model.Expert.Field') + ->share('Compiler.Builder.Model.Expert.Field', [$this, 'getModelExpertField'], true); + + $container->alias(ModelExpertFieldInitiator::class, 'Compiler.Builder.Model.Expert.Field.Initiator') + ->share('Compiler.Builder.Model.Expert.Field.Initiator', [$this, 'getModelExpertFieldInitiator'], true); + + $container->alias(ModelMediumField::class, 'Compiler.Builder.Model.Medium.Field') + ->share('Compiler.Builder.Model.Medium.Field', [$this, 'getModelMediumField'], true); + + $container->alias(ModelWhmcsField::class, 'Compiler.Builder.Model.Whmcs.Field') + ->share('Compiler.Builder.Model.Whmcs.Field', [$this, 'getModelWhmcsField'], true); + + $container->alias(MovedPublishingFields::class, 'Compiler.Builder.Moved.Publishing.Fields') + ->share('Compiler.Builder.Moved.Publishing.Fields', [$this, 'getMovedPublishingFields'], true); + + $container->alias(MysqlTableSetting::class, 'Compiler.Builder.Mysql.Table.Setting') + ->share('Compiler.Builder.Mysql.Table.Setting', [$this, 'getMysqlTableSetting'], true); + + $container->alias(NewPublishingFields::class, 'Compiler.Builder.New.Publishing.Fields') + ->share('Compiler.Builder.New.Publishing.Fields', [$this, 'getNewPublishingFields'], true); + + $container->alias(OrderZero::class, 'Compiler.Builder.Order.Zero') + ->share('Compiler.Builder.Order.Zero', [$this, 'getOrderZero'], true); + + $container->alias(OtherFilter::class, 'Compiler.Builder.Other.Filter') + ->share('Compiler.Builder.Other.Filter', [$this, 'getOtherFilter'], true); + + $container->alias(OtherGroup::class, 'Compiler.Builder.Other.Group') + ->share('Compiler.Builder.Other.Group', [$this, 'getOtherGroup'], true); + + $container->alias(OtherJoin::class, 'Compiler.Builder.Other.Join') + ->share('Compiler.Builder.Other.Join', [$this, 'getOtherJoin'], true); + + $container->alias(OtherOrder::class, 'Compiler.Builder.Other.Order') + ->share('Compiler.Builder.Other.Order', [$this, 'getOtherOrder'], true); + + $container->alias(OtherQuery::class, 'Compiler.Builder.Other.Query') + ->share('Compiler.Builder.Other.Query', [$this, 'getOtherQuery'], true); + + $container->alias(OtherWhere::class, 'Compiler.Builder.Other.Where') + ->share('Compiler.Builder.Other.Where', [$this, 'getOtherWhere'], true); + + $container->alias(PermissionAction::class, 'Compiler.Builder.Permission.Action') + ->share('Compiler.Builder.Permission.Action', [$this, 'getPermissionAction'], true); + + $container->alias(PermissionComponent::class, 'Compiler.Builder.Permission.Component') + ->share('Compiler.Builder.Permission.Component', [$this, 'getPermissionComponent'], true); + + $container->alias(PermissionCore::class, 'Compiler.Builder.Permission.Core') + ->share('Compiler.Builder.Permission.Core', [$this, 'getPermissionCore'], true); + + $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') + ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); + + $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') + ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); + + $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') + ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); + + $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') + ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); + + $container->alias(Request::class, 'Compiler.Builder.Request') + ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); + + $container->alias(Router::class, 'Compiler.Builder.Router') + ->share('Compiler.Builder.Router', [$this, 'getRouter'], true); + + $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') + ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); + + $container->alias(ScriptUserSwitch::class, 'Compiler.Builder.Script.User.Switch') + ->share('Compiler.Builder.Script.User.Switch', [$this, 'getScriptUserSwitch'], true); + + $container->alias(Search::class, 'Compiler.Builder.Search') + ->share('Compiler.Builder.Search', [$this, 'getSearch'], true); + + $container->alias(SelectionTranslation::class, 'Compiler.Builder.Selection.Translation') + ->share('Compiler.Builder.Selection.Translation', [$this, 'getSelectionTranslation'], true); + + $container->alias(SiteDecrypt::class, 'Compiler.Builder.Site.Decrypt') + ->share('Compiler.Builder.Site.Decrypt', [$this, 'getSiteDecrypt'], true); + + $container->alias(SiteDynamicGet::class, 'Compiler.Builder.Site.Dynamic.Get') + ->share('Compiler.Builder.Site.Dynamic.Get', [$this, 'getSiteDynamicGet'], true); + + $container->alias(SiteEditView::class, 'Compiler.Builder.Site.Edit.View') + ->share('Compiler.Builder.Site.Edit.View', [$this, 'getSiteEditView'], true); + + $container->alias(SiteFieldData::class, 'Compiler.Builder.Site.Field.Data') + ->share('Compiler.Builder.Site.Field.Data', [$this, 'getSiteFieldData'], true); + + $container->alias(SiteFieldDecodeFilter::class, 'Compiler.Builder.Site.Field.Decode.Filter') + ->share('Compiler.Builder.Site.Field.Decode.Filter', [$this, 'getSiteFieldDecodeFilter'], true); + + $container->alias(SiteFields::class, 'Compiler.Builder.Site.Fields') + ->share('Compiler.Builder.Site.Fields', [$this, 'getSiteFields'], true); + + $container->alias(SiteMainGet::class, 'Compiler.Builder.Site.Main.Get') + ->share('Compiler.Builder.Site.Main.Get', [$this, 'getSiteMainGet'], true); + + $container->alias(Sort::class, 'Compiler.Builder.Sort') + ->share('Compiler.Builder.Sort', [$this, 'getSort'], true); + + $container->alias(TabCounter::class, 'Compiler.Builder.Tab.Counter') + ->share('Compiler.Builder.Tab.Counter', [$this, 'getTabCounter'], true); + + $container->alias(Tags::class, 'Compiler.Builder.Tags') + ->share('Compiler.Builder.Tags', [$this, 'getTags'], true); + + $container->alias(TemplateData::class, 'Compiler.Builder.Template.Data') + ->share('Compiler.Builder.Template.Data', [$this, 'getTemplateData'], true); + + $container->alias(Title::class, 'Compiler.Builder.Title') + ->share('Compiler.Builder.Title', [$this, 'getTitle'], true); + + $container->alias(UikitComp::class, 'Compiler.Builder.Uikit.Comp') + ->share('Compiler.Builder.Uikit.Comp', [$this, 'getUikitComp'], true); + + $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') + ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); + + $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') + ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); + } + + /** + * Get The LanguageMessages Class. + * + * @param Container $container The DI container. + * + * @return LanguageMessages + * @since 3.2.0 + */ + public function getLanguageMessages(Container $container): LanguageMessages + { + return new LanguageMessages(); + } + + /** + * Get The Layout Class. + * + * @param Container $container The DI container. + * + * @return Layout + * @since 3.2.0 + */ + public function getLayout(Container $container): Layout + { + return new Layout(); + } + + /** + * Get The LayoutData Class. + * + * @param Container $container The DI container. + * + * @return LayoutData + * @since 3.2.0 + */ + public function getLayoutData(Container $container): LayoutData + { + return new LayoutData(); + } + + /** + * Get The LibraryManager Class. + * + * @param Container $container The DI container. + * + * @return LibraryManager + * @since 3.2.0 + */ + public function getLibraryManager(Container $container): LibraryManager + { + return new LibraryManager(); + } + + /** + * Get The ListFieldClass Class. + * + * @param Container $container The DI container. + * + * @return ListFieldClass + * @since 3.2.0 + */ + public function getListFieldClass(Container $container): ListFieldClass + { + return new ListFieldClass(); + } + + /** + * Get The ListHeadOverride Class. + * + * @param Container $container The DI container. + * + * @return ListHeadOverride + * @since 3.2.0 + */ + public function getListHeadOverride(Container $container): ListHeadOverride + { + return new ListHeadOverride(); + } + + /** + * Get The ListJoin Class. + * + * @param Container $container The DI container. + * + * @return ListJoin + * @since 3.2.0 + */ + public function getListJoin(Container $container): ListJoin + { + return new ListJoin(); + } + + /** + * Get The Lists Class. + * + * @param Container $container The DI container. + * + * @return Lists + * @since 3.2.0 + */ + public function getLists(Container $container): Lists + { + return new Lists(); + } + + /** + * Get The MainTextField Class. + * + * @param Container $container The DI container. + * + * @return MainTextField + * @since 3.2.0 + */ + public function getMainTextField(Container $container): MainTextField + { + return new MainTextField(); + } + + /** + * Get The MetaData Class. + * + * @param Container $container The DI container. + * + * @return MetaData + * @since 3.2.0 + */ + public function getMetaData(Container $container): MetaData + { + return new MetaData(); + } + + /** + * Get The ModelBasicField Class. + * + * @param Container $container The DI container. + * + * @return ModelBasicField + * @since 3.2.0 + */ + public function getModelBasicField(Container $container): ModelBasicField + { + return new ModelBasicField(); + } + + /** + * Get The ModelExpertField Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertField + * @since 3.2.0 + */ + public function getModelExpertField(Container $container): ModelExpertField + { + return new ModelExpertField(); + } + + /** + * Get The ModelExpertFieldInitiator Class. + * + * @param Container $container The DI container. + * + * @return ModelExpertFieldInitiator + * @since 3.2.0 + */ + public function getModelExpertFieldInitiator(Container $container): ModelExpertFieldInitiator + { + return new ModelExpertFieldInitiator(); + } + + /** + * Get The ModelMediumField Class. + * + * @param Container $container The DI container. + * + * @return ModelMediumField + * @since 3.2.0 + */ + public function getModelMediumField(Container $container): ModelMediumField + { + return new ModelMediumField(); + } + + /** + * Get The ModelWhmcsField Class. + * + * @param Container $container The DI container. + * + * @return ModelWhmcsField + * @since 3.2.0 + */ + public function getModelWhmcsField(Container $container): ModelWhmcsField + { + return new ModelWhmcsField(); + } + + /** + * Get The MovedPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return MovedPublishingFields + * @since 3.2.0 + */ + public function getMovedPublishingFields(Container $container): MovedPublishingFields + { + return new MovedPublishingFields(); + } + + /** + * Get The MysqlTableSetting Class. + * + * @param Container $container The DI container. + * + * @return MysqlTableSetting + * @since 3.2.0 + */ + public function getMysqlTableSetting(Container $container): MysqlTableSetting + { + return new MysqlTableSetting(); + } + + /** + * Get The NewPublishingFields Class. + * + * @param Container $container The DI container. + * + * @return NewPublishingFields + * @since 3.2.0 + */ + public function getNewPublishingFields(Container $container): NewPublishingFields + { + return new NewPublishingFields(); + } + + /** + * Get The OrderZero Class. + * + * @param Container $container The DI container. + * + * @return OrderZero + * @since 3.2.0 + */ + public function getOrderZero(Container $container): OrderZero + { + return new OrderZero(); + } + + /** + * Get The OtherFilter Class. + * + * @param Container $container The DI container. + * + * @return OtherFilter + * @since 3.2.0 + */ + public function getOtherFilter(Container $container): OtherFilter + { + return new OtherFilter(); + } + + /** + * Get The OtherGroup Class. + * + * @param Container $container The DI container. + * + * @return OtherGroup + * @since 3.2.0 + */ + public function getOtherGroup(Container $container): OtherGroup + { + return new OtherGroup(); + } + + /** + * Get The OtherJoin Class. + * + * @param Container $container The DI container. + * + * @return OtherJoin + * @since 3.2.0 + */ + public function getOtherJoin(Container $container): OtherJoin + { + return new OtherJoin(); + } + + /** + * Get The OtherOrder Class. + * + * @param Container $container The DI container. + * + * @return OtherOrder + * @since 3.2.0 + */ + public function getOtherOrder(Container $container): OtherOrder + { + return new OtherOrder(); + } + + /** + * Get The OtherQuery Class. + * + * @param Container $container The DI container. + * + * @return OtherQuery + * @since 3.2.0 + */ + public function getOtherQuery(Container $container): OtherQuery + { + return new OtherQuery(); + } + + /** + * Get The OtherWhere Class. + * + * @param Container $container The DI container. + * + * @return OtherWhere + * @since 3.2.0 + */ + public function getOtherWhere(Container $container): OtherWhere + { + return new OtherWhere(); + } + + /** + * Get The PermissionAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionAction + * @since 3.2.0 + */ + public function getPermissionAction(Container $container): PermissionAction + { + return new PermissionAction(); + } + + /** + * Get The PermissionComponent Class. + * + * @param Container $container The DI container. + * + * @return PermissionComponent + * @since 3.2.0 + */ + public function getPermissionComponent(Container $container): PermissionComponent + { + return new PermissionComponent(); + } + + /** + * Get The PermissionCore Class. + * + * @param Container $container The DI container. + * + * @return PermissionCore + * @since 3.2.0 + */ + public function getPermissionCore(Container $container): PermissionCore + { + return new PermissionCore(); + } + + /** + * Get The PermissionDashboard Class. + * + * @param Container $container The DI container. + * + * @return PermissionDashboard + * @since 3.2.0 + */ + public function getPermissionDashboard(Container $container): PermissionDashboard + { + return new PermissionDashboard(); + } + + /** + * Get The PermissionFields Class. + * + * @param Container $container The DI container. + * + * @return PermissionFields + * @since 3.2.0 + */ + public function getPermissionFields(Container $container): PermissionFields + { + return new PermissionFields(); + } + + /** + * Get The PermissionGlobalAction Class. + * + * @param Container $container The DI container. + * + * @return PermissionGlobalAction + * @since 3.2.0 + */ + public function getPermissionGlobalAction(Container $container): PermissionGlobalAction + { + return new PermissionGlobalAction(); + } + + /** + * Get The PermissionViews Class. + * + * @param Container $container The DI container. + * + * @return PermissionViews + * @since 3.2.0 + */ + public function getPermissionViews(Container $container): PermissionViews + { + return new PermissionViews(); + } + + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request(); + } + + /** + * 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(); + } + + /** + * Get The ScriptMediaSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptMediaSwitch + * @since 3.2.0 + */ + public function getScriptMediaSwitch(Container $container): ScriptMediaSwitch + { + return new ScriptMediaSwitch(); + } + + /** + * Get The ScriptUserSwitch Class. + * + * @param Container $container The DI container. + * + * @return ScriptUserSwitch + * @since 3.2.0 + */ + public function getScriptUserSwitch(Container $container): ScriptUserSwitch + { + return new ScriptUserSwitch(); + } + + /** + * Get The Search Class. + * + * @param Container $container The DI container. + * + * @return Search + * @since 3.2.0 + */ + public function getSearch(Container $container): Search + { + return new Search(); + } + + /** + * Get The SelectionTranslation Class. + * + * @param Container $container The DI container. + * + * @return SelectionTranslation + * @since 3.2.0 + */ + public function getSelectionTranslation(Container $container): SelectionTranslation + { + return new SelectionTranslation(); + } + + /** + * Get The SiteDecrypt Class. + * + * @param Container $container The DI container. + * + * @return SiteDecrypt + * @since 3.2.0 + */ + public function getSiteDecrypt(Container $container): SiteDecrypt + { + return new SiteDecrypt(); + } + + /** + * Get The SiteDynamicGet Class. + * + * @param Container $container The DI container. + * + * @return SiteDynamicGet + * @since 3.2.0 + */ + public function getSiteDynamicGet(Container $container): SiteDynamicGet + { + return new SiteDynamicGet(); + } + + /** + * Get The SiteEditView Class. + * + * @param Container $container The DI container. + * + * @return SiteEditView + * @since 3.2.0 + */ + public function getSiteEditView(Container $container): SiteEditView + { + return new SiteEditView(); + } + + /** + * Get The SiteFieldData Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldData + * @since 3.2.0 + */ + public function getSiteFieldData(Container $container): SiteFieldData + { + return new SiteFieldData(); + } + + /** + * Get The SiteFieldDecodeFilter Class. + * + * @param Container $container The DI container. + * + * @return SiteFieldDecodeFilter + * @since 3.2.0 + */ + public function getSiteFieldDecodeFilter(Container $container): SiteFieldDecodeFilter + { + return new SiteFieldDecodeFilter(); + } + + /** + * Get The SiteFields Class. + * + * @param Container $container The DI container. + * + * @return SiteFields + * @since 3.2.0 + */ + public function getSiteFields(Container $container): SiteFields + { + return new SiteFields(); + } + + /** + * Get The SiteMainGet Class. + * + * @param Container $container The DI container. + * + * @return SiteMainGet + * @since 3.2.0 + */ + public function getSiteMainGet(Container $container): SiteMainGet + { + return new SiteMainGet(); + } + + /** + * Get The Sort Class. + * + * @param Container $container The DI container. + * + * @return Sort + * @since 3.2.0 + */ + public function getSort(Container $container): Sort + { + return new Sort(); + } + + /** + * Get The TabCounter Class. + * + * @param Container $container The DI container. + * + * @return TabCounter + * @since 3.2.0 + */ + public function getTabCounter(Container $container): TabCounter + { + return new TabCounter(); + } + + /** + * Get The Tags Class. + * + * @param Container $container The DI container. + * + * @return Tags + * @since 3.2.0 + */ + public function getTags(Container $container): Tags + { + return new Tags(); + } + + /** + * Get The TemplateData Class. + * + * @param Container $container The DI container. + * + * @return TemplateData + * @since 3.2.0 + */ + public function getTemplateData(Container $container): TemplateData + { + return new TemplateData(); + } + + /** + * Get The Title Class. + * + * @param Container $container The DI container. + * + * @return Title + * @since 3.2.0 + */ + public function getTitle(Container $container): Title + { + return new Title(); + } + + /** + * Get The UikitComp Class. + * + * @param Container $container The DI container. + * + * @return UikitComp + * @since 3.2.0 + */ + public function getUikitComp(Container $container): UikitComp + { + return new UikitComp(); + } + + /** + * Get The UpdateMysql Class. + * + * @param Container $container The DI container. + * + * @return UpdateMysql + * @since 3.2.0 + */ + public function getUpdateMysql(Container $container): UpdateMysql + { + return new UpdateMysql(); + } + + /** + * Get The ViewsDefaultOrdering Class. + * + * @param Container $container The DI container. + * + * @return ViewsDefaultOrdering + * @since 3.2.0 + */ + public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering + { + return new ViewsDefaultOrdering(); } \ No newline at end of file diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json index d27265f..523a5ff 100644 --- a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json @@ -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 \r\n * @git 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;", diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php index 8474a7f..d6d21a4 100644 --- a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php @@ -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; diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json index 13a3b2c..be561cd 100644 --- a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json @@ -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", diff --git a/src/318a98a3-bb6f-42cb-a000-352d4c848b51/README.md b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/README.md new file mode 100644 index 0000000..c2c0c15 --- /dev/null +++ b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/README.md @@ -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) + diff --git a/src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.php b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.php new file mode 100644 index 0000000..318644a --- /dev/null +++ b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.php @@ -0,0 +1,108 @@ + + * @git 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); + } +} + diff --git a/src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.power b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.power new file mode 100644 index 0000000..f774d18 --- /dev/null +++ b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/code.power @@ -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); + } \ No newline at end of file diff --git a/src/318a98a3-bb6f-42cb-a000-352d4c848b51/settings.json b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/settings.json new file mode 100644 index 0000000..6fb70db --- /dev/null +++ b/src/318a98a3-bb6f-42cb-a000-352d4c848b51/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md index 62dbfcf..1a21796 100644 --- a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md @@ -12,6 +12,7 @@ @startuml class Structure #Gold { # array $htaccess + # array $done # Power $power # Config $config # Registry $registry diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php index dc4f391..da6862d 100644 --- a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php @@ -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); diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power index 5bc4c02..485ed62 100644 --- a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.power @@ -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); diff --git a/src/34df20ec-67db-4e7e-be61-fb94d360c408/README.md b/src/34df20ec-67db-4e7e-be61-fb94d360c408/README.md new file mode 100644 index 0000000..b808fc2 --- /dev/null +++ b/src/34df20ec-67db-4e7e-be61-fb94d360c408/README.md @@ -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) + diff --git a/src/34df20ec-67db-4e7e-be61-fb94d360c408/code.php b/src/34df20ec-67db-4e7e-be61-fb94d360c408/code.php new file mode 100644 index 0000000..b9cf8d9 --- /dev/null +++ b/src/34df20ec-67db-4e7e-be61-fb94d360c408/code.php @@ -0,0 +1,87 @@ + + * @git 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); + } +} + diff --git a/src/34df20ec-67db-4e7e-be61-fb94d360c408/code.power b/src/34df20ec-67db-4e7e-be61-fb94d360c408/code.power new file mode 100644 index 0000000..a3bf45b --- /dev/null +++ b/src/34df20ec-67db-4e7e-be61-fb94d360c408/code.power @@ -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); + } \ No newline at end of file diff --git a/src/34df20ec-67db-4e7e-be61-fb94d360c408/settings.json b/src/34df20ec-67db-4e7e-be61-fb94d360c408/settings.json new file mode 100644 index 0000000..07cc99f --- /dev/null +++ b/src/34df20ec-67db-4e7e-be61-fb94d360c408/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md index 37e39bc..a1e4791 100644 --- a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/README.md @@ -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 ``` diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php index d8e3f45..6f3ee5c 100644 --- a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php @@ -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') + ); } } diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power index 4e7ad6e..04e985a 100644 --- a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.power @@ -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') + ); } \ No newline at end of file diff --git a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json index bf67321..969e8b6 100644 --- a/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json +++ b/src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json @@ -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", diff --git a/src/402239e6-ceec-4ee0-af62-22d462417bf6/README.md b/src/402239e6-ceec-4ee0-af62-22d462417bf6/README.md new file mode 100644 index 0000000..cf83951 --- /dev/null +++ b/src/402239e6-ceec-4ee0-af62-22d462417bf6/README.md @@ -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) + diff --git a/src/402239e6-ceec-4ee0-af62-22d462417bf6/code.php b/src/402239e6-ceec-4ee0-af62-22d462417bf6/code.php new file mode 100644 index 0000000..87f1066 --- /dev/null +++ b/src/402239e6-ceec-4ee0-af62-22d462417bf6/code.php @@ -0,0 +1,330 @@ + + * @git 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 []; + } +} + diff --git a/src/402239e6-ceec-4ee0-af62-22d462417bf6/code.power b/src/402239e6-ceec-4ee0-af62-22d462417bf6/code.power new file mode 100644 index 0000000..6950b1e --- /dev/null +++ b/src/402239e6-ceec-4ee0-af62-22d462417bf6/code.power @@ -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 []; + } \ No newline at end of file diff --git a/src/402239e6-ceec-4ee0-af62-22d462417bf6/settings.json b/src/402239e6-ceec-4ee0-af62-22d462417bf6/settings.json new file mode 100644 index 0000000..05e76d2 --- /dev/null +++ b/src/402239e6-ceec-4ee0-af62-22d462417bf6/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/42648fb4-dfdc-4986-a180-69e5726a25c4/README.md b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/README.md new file mode 100644 index 0000000..8a7cde3 --- /dev/null +++ b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/README.md @@ -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) + diff --git a/src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.php b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.php new file mode 100644 index 0000000..efa0e74 --- /dev/null +++ b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.php @@ -0,0 +1,240 @@ + + * @git 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) + . ""; + $tmp .= PHP_EOL . $_tab . Indent::_(2) + . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(3) + . '
'; + $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) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(1) + . ""; + + // 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) + . "canDo->get('" + . $tab['view'] . "." . $tab['code'] + . ".viewtab')) : ?>"; + $tmp .= $tab['html']; + $tmp .= PHP_EOL . Indent::_(1) . ""; + // 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); + } +} + diff --git a/src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.power b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.power new file mode 100644 index 0000000..f2424c9 --- /dev/null +++ b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/code.power @@ -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) + . ""; + $tmp .= PHP_EOL . $_tab . Indent::_(2) + . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(3) + . '
'; + $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) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(1) + . ""; + + // 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) + . "canDo->get('" + . $tab['view'] . "." . $tab['code'] + . ".viewtab')) : ?>"; + $tmp .= $tab['html']; + $tmp .= PHP_EOL . Indent::_(1) . ""; + // 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); + } \ No newline at end of file diff --git a/src/42648fb4-dfdc-4986-a180-69e5726a25c4/settings.json b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/settings.json new file mode 100644 index 0000000..5c58524 --- /dev/null +++ b/src/42648fb4-dfdc-4986-a180-69e5726a25c4/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md index b7e5768..c8136e6 100644 --- a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/README.md @@ -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() diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php index 02ed5aa..0da51e4 100644 --- a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/code.php @@ -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 diff --git a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json index 26f0dfe..6524362 100644 --- a/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json +++ b/src/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb/settings.json @@ -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", diff --git a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md index 441106f..7cb43e9 100644 --- a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/README.md @@ -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 diff --git a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php index 5fda6eb..578f5f6 100644 --- a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php @@ -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()); } } } diff --git a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power index 6a49e3d..4527c51 100644 --- a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.power @@ -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()); } } } \ No newline at end of file diff --git a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json index c6d9b59..d994fba 100644 --- a/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json +++ b/src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json @@ -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 \r\n * @git 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": "" } \ No newline at end of file diff --git a/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/README.md b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/README.md new file mode 100644 index 0000000..e41215c --- /dev/null +++ b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/README.md @@ -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) + diff --git a/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.php b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.php new file mode 100644 index 0000000..c9bc4ef --- /dev/null +++ b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.php @@ -0,0 +1,27 @@ + + * @git 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 +{ +} + diff --git a/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.power b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.power new file mode 100644 index 0000000..69309b0 --- /dev/null +++ b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/code.power @@ -0,0 +1 @@ +###CODEPOWER### \ No newline at end of file diff --git a/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/settings.json b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/settings.json new file mode 100644 index 0000000..c469788 --- /dev/null +++ b/src/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md b/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md index 4f9a1b7..2917836 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md @@ -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 diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php index c1583f4..e376c47 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php @@ -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 diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power index f58ddd4..2f07097 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.power @@ -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 diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json b/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json index 6e54c80..d9213cc 100644 --- a/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json @@ -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", diff --git a/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/README.md b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/README.md new file mode 100644 index 0000000..ad7e0b6 --- /dev/null +++ b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/README.md @@ -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) + diff --git a/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.php b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.php new file mode 100644 index 0000000..591fd53 --- /dev/null +++ b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.php @@ -0,0 +1,129 @@ + + * @git 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)); + } +} + diff --git a/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.power b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.power new file mode 100644 index 0000000..49049dc --- /dev/null +++ b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/code.power @@ -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)); + } \ No newline at end of file diff --git a/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/settings.json b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/settings.json new file mode 100644 index 0000000..2e7a85f --- /dev/null +++ b/src/4c143764-1b84-4b9f-86c5-8de119b26f1a/settings.json @@ -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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/55278140-80d5-4168-8241-d64515c4b35e/code.php b/src/55278140-80d5-4168-8241-d64515c4b35e/code.php index ab07969..ee79b9a 100644 --- a/src/55278140-80d5-4168-8241-d64515c4b35e/code.php +++ b/src/55278140-80d5-4168-8241-d64515c4b35e/code.php @@ -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); } diff --git a/src/55278140-80d5-4168-8241-d64515c4b35e/code.power b/src/55278140-80d5-4168-8241-d64515c4b35e/code.power index 72a62bc..b224cca 100644 --- a/src/55278140-80d5-4168-8241-d64515c4b35e/code.power +++ b/src/55278140-80d5-4168-8241-d64515c4b35e/code.power @@ -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); } diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md index c915c67..ceeab8c 100644 --- a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/README.md @@ -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 diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php index dbe542e..b6c6820 100644 --- a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.php @@ -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. * diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power index 1e7bf86..1b15da1 100644 --- a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/code.power @@ -19,6 +19,9 @@ $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); @@ -28,6 +31,9 @@ $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); @@ -53,6 +59,23 @@ 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. * @@ -105,6 +128,25 @@ 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. * diff --git a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json index a91afca..bdd58fa 100644 --- a/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json +++ b/src/56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60/settings.json @@ -16,6 +16,10 @@ "use": "c9700450-4f44-4455-bc86-6a7660daadee", "as": "default" }, + "use_selection6": { + "use": "005fce79-1b62-4a93-8d5e-8c89fee1afc6", + "as": "J5ControllerAllowAdd" + }, "use_selection1": { "use": "425b1107-933d-4436-87ac-63540ec101c5", "as": "J4ControllerAllowAdd" @@ -28,6 +32,10 @@ "use": "992a842f-1ba9-4a5c-b214-042459ffe038", "as": "default" }, + "use_selection7": { + "use": "e85175fd-e297-46df-a497-27f7a37190fd", + "as": "J5ControllerAllowEdit" + }, "use_selection4": { "use": "ddf31f4b-96ba-46e7-8100-f48e1cefe533", "as": "J4ControllerAllowEdit" diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php index e118114..f1daa85 100644 --- a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php @@ -248,6 +248,7 @@ class Selection return [ 'select' => $querySelect, 'from' => $queryFrom, + 'view' => $viewCode, 'name' => $queryName, 'table' => $table, 'type' => $type, diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power index 92865d3..dfc87e0 100644 --- a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.power @@ -216,6 +216,7 @@ return [ 'select' => $querySelect, 'from' => $queryFrom, + 'view' => $viewCode, 'name' => $queryName, 'table' => $table, 'type' => $type, diff --git a/src/6034587d-82a3-4b19-ac58-40507f79122a/README.md b/src/6034587d-82a3-4b19-ac58-40507f79122a/README.md new file mode 100644 index 0000000..4f88f7a --- /dev/null +++ b/src/6034587d-82a3-4b19-ac58-40507f79122a/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class RouterMethodsManual (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class RouterMethodsManual << (F,LightGreen) >> #RoyalBlue { + # Router $router + + __construct(Router $router) + + get() : string +} + +note right of RouterMethodsManual::__construct + Constructor. + + since: 3.2.0 +end note + +note right of RouterMethodsManual::get + Get Methods Code (SOON) + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6034587d-82a3-4b19-ac58-40507f79122a/code.php b/src/6034587d-82a3-4b19-ac58-40507f79122a/code.php new file mode 100644 index 0000000..c36271f --- /dev/null +++ b/src/6034587d-82a3-4b19-ac58-40507f79122a/code.php @@ -0,0 +1,137 @@ + + * @git 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 Manual Creator Class + * + * @since 3.2.0 + */ +final class RouterMethodsManual +{ + /** + * 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 (SOON) + * + * @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 an {$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 a {$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 ''; + } +} + diff --git a/src/6034587d-82a3-4b19-ac58-40507f79122a/code.power b/src/6034587d-82a3-4b19-ac58-40507f79122a/code.power new file mode 100644 index 0000000..3360483 --- /dev/null +++ b/src/6034587d-82a3-4b19-ac58-40507f79122a/code.power @@ -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 (SOON) + * + * @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 an {$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 a {$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 ''; + } \ No newline at end of file diff --git a/src/6034587d-82a3-4b19-ac58-40507f79122a/settings.json b/src/6034587d-82a3-4b19-ac58-40507f79122a/settings.json new file mode 100644 index 0000000..bfdf01b --- /dev/null +++ b/src/6034587d-82a3-4b19-ac58-40507f79122a/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "6034587d-82a3-4b19-ac58-40507f79122a", + "implements": null, + "load_selection": null, + "name": "RouterMethodsManual", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.RouterMethodsManual", + "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.RouterMethodsManual", + "description": "Router Methods Manual 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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md index a31f254..7c6a739 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md @@ -16,6 +16,7 @@ class History #Gold { + getHistory(Container $container) : HistoryInterface + getJ3History(Container $container) : J3History + getJ4History(Container $container) : J4History + + getJ5History(Container $container) : J5History } note right of History::register @@ -45,6 +46,13 @@ note right of History::getJ4History since: 3.2.0 return: J4History end note + +note right of History::getJ5History + Get the Joomla 5 History + + since: 3.2.0 + return: J5History +end note @enduml ``` diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php index 031d3f7..9beb59d 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php @@ -18,6 +18,7 @@ use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History; use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\History as J4History; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\History as J5History; /** @@ -51,6 +52,9 @@ class History implements ServiceProviderInterface $container->alias(J4History::class, 'J4.History') ->share('J4.History', [$this, 'getJ4History'], true); + $container->alias(J5History::class, 'J5.History') + ->share('J5.History', [$this, 'getJ5History'], true); + $container->alias(HistoryInterface::class, 'History') ->share('History', [$this, 'getHistory'], true); } @@ -101,6 +105,21 @@ class History implements ServiceProviderInterface return new J4History( $container->get('Config') ); + } + + /** + * Get the Joomla 5 History + * + * @param Container $container The DI container. + * + * @return J5History + * @since 3.2.0 + */ + public function getJ5History(Container $container): J5History + { + return new J5History( + $container->get('Config') + ); } } diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power index 403a290..d213bde 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.power @@ -22,6 +22,9 @@ $container->alias(J4History::class, 'J4.History') ->share('J4.History', [$this, 'getJ4History'], true); + $container->alias(J5History::class, 'J5.History') + ->share('J5.History', [$this, 'getJ5History'], true); + $container->alias(HistoryInterface::class, 'History') ->share('History', [$this, 'getHistory'], true); } @@ -72,4 +75,19 @@ return new J4History( $container->get('Config') ); + } + + /** + * Get the Joomla 5 History + * + * @param Container $container The DI container. + * + * @return J5History + * @since 3.2.0 + */ + public function getJ5History(Container $container): J5History + { + return new J5History( + $container->get('Config') + ); } \ No newline at end of file diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json index 773cee2..2fa2e25 100644 --- a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json @@ -23,6 +23,10 @@ "use_selection2": { "use": "25c7ca86-6088-4f5f-b9fe-13504779c6ba", "as": "J4History" + }, + "use_selection3": { + "use": "8ab6fe75-ba5a-4316-9ef8-1eccceec813f", + "as": "J5History" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.History", diff --git a/src/69d2b980-a665-48cd-96f8-757bf3810b41/README.md b/src/69d2b980-a665-48cd-96f8-757bf3810b41/README.md new file mode 100644 index 0000000..9780615 --- /dev/null +++ b/src/69d2b980-a665-48cd-96f8-757bf3810b41/README.md @@ -0,0 +1,209 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Settings (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFive** +```uml +@startuml +class Settings << (F,LightGreen) >> #RoyalBlue { + # array $standardFolders + # array $standardRootFiles + # ?object $data + # Config $config + # Registry $registry + # EventInterface $event + # Placeholder $placeholder + # Component $component + # Paths $paths + # Dynamicpath $dynamicpath + # Pathfix $pathfix + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + exists() : bool + + structure() : object + + multiple() : object + + single() : object + + standardFolder(string $folder) : bool + + standardRootFile(string $file) : bool + - isSet() : bool + - get() : ?object + - readJsonFile(string $filePath) : ?object + - isValidData(object $versionData) : bool + - loadExtraFolders() : void + - addImportViewFolder() : void + - addPhpSpreadsheetFolder() : void + - addUikitFolder() : void + - addFooTableFolder() : void + - loadExtraFiles() : void + - addGoogleChartFiles() : void + - addFolders(object $versionData) : void + - addFiles(object $versionData) : void +} + +note right of Settings::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Placeholder $placeholder = null + ?Component $component = null + ?Paths $paths = null + ?Dynamicpath $dynamicpath = null + ?Pathfix $pathfix = null +end note + +note left of Settings::exists + Check if data set is loaded + + since: 3.2.0 + return: bool +end note + +note right of Settings::structure + Get Joomla - Folder Structure to Create + + since: 3.2.0 + return: object +end note + +note left of Settings::multiple + Get Joomla - Move Multiple Structure + + since: 3.2.0 + return: object +end note + +note right of Settings::single + Get Joomla - Move Single Structure + + since: 3.2.0 + return: object +end note + +note left of Settings::standardFolder + Check if Folder is a Standard Folder + + since: 3.2.0 + return: bool +end note + +note right of Settings::standardRootFile + Check if File is a Standard Root File + + since: 3.2.0 + return: bool +end note + +note left of Settings::isSet + Check if Data is Set + + since: 3.2.0 + return: bool +end note + +note right of Settings::get + get the Joomla Version Data + + since: 3.2.0 + return: ?object +end note + +note left of Settings::readJsonFile + Read the Json file data + + since: 3.2.0 + return: ?object +end note + +note right of Settings::isValidData + Check if this is valid data + + since: 3.2.0 + return: bool +end note + +note left of Settings::loadExtraFolders + Add Extra/Dynamic folders + + since: 3.2.0 + return: void +end note + +note right of Settings::addImportViewFolder + Add Import and Export Folder + + since: 3.2.0 + return: void +end note + +note left of Settings::addPhpSpreadsheetFolder + Add Php Spreadsheet Folder + + since: 3.2.0 + return: void +end note + +note right of Settings::addUikitFolder + Add Uikit Folders + + since: 3.2.0 + return: void +end note + +note left of Settings::addFooTableFolder + Add Foo Table Folder + + since: 3.2.0 + return: void +end note + +note right of Settings::loadExtraFiles + Add Extra/Dynamic files + + since: 3.2.0 + return: void +end note + +note left of Settings::addGoogleChartFiles + Add Google Chart Files + + since: 3.2.0 + return: void +end note + +note right of Settings::addFolders + Add Folders + + since: 3.2.0 + return: void +end note + +note left of Settings::addFiles + Add Files + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/69d2b980-a665-48cd-96f8-757bf3810b41/code.php b/src/69d2b980-a665-48cd-96f8-757bf3810b41/code.php new file mode 100644 index 0000000..1feea90 --- /dev/null +++ b/src/69d2b980-a665-48cd-96f8-757bf3810b41/code.php @@ -0,0 +1,748 @@ + + * @git 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\Component\JoomlaFive; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface; + + +/** + * Compiler Component (Joomla Version) Settings + * + * @since 3.2.0 + */ +final class Settings implements SettingsInterface +{ + /** + * The standard folders + * + * @var array + * @since 3.2.0 + */ + protected array $standardFolders = [ + 'site', + 'admin', + 'media' + ]; + + /** + * The standard root files + * + * @var array + * @since 3.2.0 + */ + protected array $standardRootFiles = [ + 'access.xml', + 'config.xml', + 'controller.php', + 'index.html', + 'README.txt' + ]; + + /** + * Compiler Joomla Version Data + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $data = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Component Dynamic Path + * + * @var Dynamicpath + * @since 3.2.0 + **/ + protected Dynamicpath $dynamicpath; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Component|null $component The component class. + * @param Paths|null $paths The compiler paths object. + * @param Dynamicpath|null $dynamicpath The compiler dynamic path object. + * @param Pathfix|null $pathfix The compiler path fixing object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, + ?Component $component = null, ?Paths $paths = null, + ?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->component = $component ?: Compiler::_('Component'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); + + // add component endpoint file to stander list of root files + $this->standardRootFiles[] = $this->component->get('name_code') . '.php'; + } + + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool + { + if (!$this->isSet()) + { + // load the data + $this->data = $this->get(); + + if (!$this->isSet()) + { + return false; + } + } + + return true; + } + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object + { + return $this->data->create; + } + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object + { + return $this->data->move->dynamic; + } + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object + { + return $this->data->move->static; + } + + /** + * Check if Folder is a Standard Folder + * + * @param string $folder The folder name + * + * @return bool true if the folder exists + * @since 3.2.0 + */ + public function standardFolder(string $folder): bool + { + return in_array($folder, $this->standardFolders); + } + + /** + * Check if File is a Standard Root File + * + * @param string $file The file name + * + * @return bool true if the file exists + * @since 3.2.0 + */ + public function standardRootFile(string $file): bool + { + return in_array($file, $this->standardRootFiles); + } + + /** + * Check if Data is Set + * + * @return bool + * @since 3.2.0 + */ + private function isSet(): bool + { + return is_object($this->data) && + isset($this->data->create) && + isset($this->data->move) && + isset($this->data->move->static) && + isset($this->data->move->dynamic); + } + + /** + * get the Joomla Version Data + * + * @return object|null The version data + * @since 3.2.0 + */ + private function get(): ?object + { + // override option + $customSettings = $this->paths->template_path . '/settings_' . + $this->config->component_code_name . '.json'; + + // get the data + $version_data = $this->readJsonFile($customSettings); + + if (is_null($version_data) || !$this->isValidData($version_data)) + { + return null; + } + + $this->loadExtraFolders(); + $this->loadExtraFiles(); + + $this->addFolders($version_data); + $this->addFiles($version_data); + + // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData + $this->event->trigger( + 'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data] + ); + + return $version_data; + } + + /** + * Read the Json file data + * + * @param string $filePath + * + * @return object|null The version data + * @since 3.2.0 + */ + private function readJsonFile(string $filePath): ?object + { + if (FileHelper::exists($filePath)) + { + $jsonContent = FileHelper::getContent($filePath); + } + else + { + $jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json'); + } + + if (JsonHelper::check($jsonContent)) + { + return json_decode((string) $jsonContent); + } + + return null; + } + + /** + * Check if this is valid data + * + * @param object $versionData + * + * @return bool + * @since 3.2.0 + */ + private function isValidData(object $versionData): bool + { + return isset($versionData->create) && + isset($versionData->move) && + isset($versionData->move->static) && + isset($versionData->move->dynamic); + } + + /** + * Add Extra/Dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFolders() + { + if ($this->component->isArray('folders') || + $this->config->get('add_eximport', false) || + $this->config->get('uikit', 0) || + $this->config->get('footable', false)) + { + $this->addImportViewFolder(); + $this->addPhpSpreadsheetFolder(); + $this->addUikitFolder(); + $this->addFooTableFolder(); + } + } + + /** + * Add Import and Export Folder + * + * @return void + * @since 3.2.0 + */ + private function addImportViewFolder() + { + if ($this->config->get('add_eximport', false)) + { + // soon + } + } + + /** + * Add Php Spreadsheet Folder + * + * @return void + * @since 3.2.0 + */ + private function addPhpSpreadsheetFolder() + { + // move the phpspreadsheet Folder (TODO we must move this to a library package) + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', + 'path' => '/libraries/phpspreadsheet/', + 'rename' => 0 + ]); + } + } + + /** + * Add Uikit Folders + * + * @return void + * @since 3.2.0 + */ + private function addUikitFolder() + { + $uikit = $this->config->get('uikit', 0); + if (2 == $uikit || 1 == $uikit) + { + // move the UIKIT Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + if (2 == $uikit || 3 == $uikit) + { + // move the UIKIT-3 Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Foo Table Folder + * + * @return void + * @since 3.2.0 + */ + private function addFooTableFolder() + { + if (!$this->config->get('footable', false)) + { + return; + } + + $footable_version = $this->config->get('footable_version', 2); + + if (2 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + elseif (3 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Extra/Dynamic files + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFiles() + { + if ($this->component->isArray('files') || + $this->config->get('google_chart', false)) + { + $this->addGoogleChartFiles(); + } + } + + /** + * Add Google Chart Files + * + * @return void + * @since 3.2.0 + */ + private function addGoogleChartFiles() + { + if ($this->config->get('google_chart', false)) + { + // move the google chart files + $this->component->appendArray('files', [ + 'file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0 + ]); + $this->component->appendArray('files', [ + 'file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0 + ]); + } + } + + /** + * Add Folders + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFolders(object &$versionData) + { + if (!$this->component->isArray('folders')) + { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('folders') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'folder', 'folderpath'] + ); + + // fix custom path + if (isset($custom['path']) + && StringHelper::check($custom['path'])) + { + $custom['path'] = trim((string) $custom['path'], '/'); + } + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path folder + if (!isset($custom['folder']) && isset($custom['folderpath'])) + { + // update the dynamic path + $custom['folderpath'] = $this->dynamicpath->update( + $custom['folderpath'] + ); + + // set the folder path with / if does not have a drive/windows full path + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') + : '/' . trim($custom['folderpath'], '/'); + + // remove the file path + unset($custom['folderpath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we use the correct name + $pathArray = (array) explode('/', (string) $custom['path']); + $lastFolder = end($pathArray); + + // only rename folder if last has folder name + if (isset($custom['rename']) && $custom['rename'] == 1) + { + $custom['path'] = str_replace( + '/' . $lastFolder, '', (string) $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; + } + elseif ('full' === $customPath) + { + // make sure we use the correct name + $folderArray = (array) explode('/', (string) $custom['folder']); + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; + } + else + { + $rename = false; + $newname = ''; + } + + // insure we have no duplicates + $key_pointer = StringHelper::safe( + $custom['folder'] + ) . '_f' . $pointer_tracker; + + $pointer_tracker++; + + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set new folder to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']); + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer}->newName = $newname; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + } + + $this->component->remove('folders'); + } + + /** + * Add Files + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFiles(object &$versionData) + { + if (!$this->component->isArray('files')) { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('files') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'file', 'filepath'] + ); + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path file + if (!isset($custom['file']) && isset($custom['filepath'])) + { + // update the dynamic path + $custom['filepath'] = $this->dynamicpath->update( + $custom['filepath'] + ); + + // set the file path with / if does not have a drive/windows full path + $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); + + // remove the file path + unset($custom['filepath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we have not duplicates + $key_pointer = StringHelper::safe( + $custom['file'] + ) . '_g' . $pointer_tracker; + + $pointer_tracker++; + + // set new file to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']); + + // update the dynamic component name placholders in file names + $custom['path'] = $this->placeholder->update_( + $custom['path'] + ); + + // get the path info + $pathInfo = pathinfo((string) $custom['path']); + if (isset($pathInfo['extension']) && $pathInfo['extension']) + { + $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + } + elseif ('full' === $customPath) + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // get file array + $fileArray = (array) explode('/', (string) $custom['file']); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end($fileArray); + } + else + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = false; + } + + $versionData->move->static->{$key_pointer}->type = 'file'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) + && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + + // check if file should be updated + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) + { + $this->registry->appendArray('files.not.new', $key_pointer); + } + else + { + // update the file content + $this->registry->set('update.file.content.' . $key_pointer, true); + } + } + + $this->component->remove('files'); + } +} + diff --git a/src/69d2b980-a665-48cd-96f8-757bf3810b41/code.power b/src/69d2b980-a665-48cd-96f8-757bf3810b41/code.power new file mode 100644 index 0000000..94e562f --- /dev/null +++ b/src/69d2b980-a665-48cd-96f8-757bf3810b41/code.power @@ -0,0 +1,710 @@ + /** + * The standard folders + * + * @var array + * @since 3.2.0 + */ + protected array $standardFolders = [ + 'site', + 'admin', + 'media' + ]; + + /** + * The standard root files + * + * @var array + * @since 3.2.0 + */ + protected array $standardRootFiles = [ + 'access.xml', + 'config.xml', + 'controller.php', + 'index.html', + 'README.txt' + ]; + + /** + * Compiler Joomla Version Data + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $data = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Component Dynamic Path + * + * @var Dynamicpath + * @since 3.2.0 + **/ + protected Dynamicpath $dynamicpath; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Component|null $component The component class. + * @param Paths|null $paths The compiler paths object. + * @param Dynamicpath|null $dynamicpath The compiler dynamic path object. + * @param Pathfix|null $pathfix The compiler path fixing object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, + ?Component $component = null, ?Paths $paths = null, + ?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->component = $component ?: Compiler::_('Component'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); + + // add component endpoint file to stander list of root files + $this->standardRootFiles[] = $this->component->get('name_code') . '.php'; + } + + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool + { + if (!$this->isSet()) + { + // load the data + $this->data = $this->get(); + + if (!$this->isSet()) + { + return false; + } + } + + return true; + } + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object + { + return $this->data->create; + } + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object + { + return $this->data->move->dynamic; + } + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object + { + return $this->data->move->static; + } + + /** + * Check if Folder is a Standard Folder + * + * @param string $folder The folder name + * + * @return bool true if the folder exists + * @since 3.2.0 + */ + public function standardFolder(string $folder): bool + { + return in_array($folder, $this->standardFolders); + } + + /** + * Check if File is a Standard Root File + * + * @param string $file The file name + * + * @return bool true if the file exists + * @since 3.2.0 + */ + public function standardRootFile(string $file): bool + { + return in_array($file, $this->standardRootFiles); + } + + /** + * Check if Data is Set + * + * @return bool + * @since 3.2.0 + */ + private function isSet(): bool + { + return is_object($this->data) && + isset($this->data->create) && + isset($this->data->move) && + isset($this->data->move->static) && + isset($this->data->move->dynamic); + } + + /** + * get the Joomla Version Data + * + * @return object|null The version data + * @since 3.2.0 + */ + private function get(): ?object + { + // override option + $customSettings = $this->paths->template_path . '/settings_' . + $this->config->component_code_name . '.json'; + + // get the data + $version_data = $this->readJsonFile($customSettings); + + if (is_null($version_data) || !$this->isValidData($version_data)) + { + return null; + } + + $this->loadExtraFolders(); + $this->loadExtraFiles(); + + $this->addFolders($version_data); + $this->addFiles($version_data); + + // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData + $this->event->trigger( + 'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data] + ); + + return $version_data; + } + + /** + * Read the Json file data + * + * @param string $filePath + * + * @return object|null The version data + * @since 3.2.0 + */ + private function readJsonFile(string $filePath): ?object + { + if (FileHelper::exists($filePath)) + { + $jsonContent = FileHelper::getContent($filePath); + } + else + { + $jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json'); + } + + if (JsonHelper::check($jsonContent)) + { + return json_decode((string) $jsonContent); + } + + return null; + } + + /** + * Check if this is valid data + * + * @param object $versionData + * + * @return bool + * @since 3.2.0 + */ + private function isValidData(object $versionData): bool + { + return isset($versionData->create) && + isset($versionData->move) && + isset($versionData->move->static) && + isset($versionData->move->dynamic); + } + + /** + * Add Extra/Dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFolders() + { + if ($this->component->isArray('folders') || + $this->config->get('add_eximport', false) || + $this->config->get('uikit', 0) || + $this->config->get('footable', false)) + { + $this->addImportViewFolder(); + $this->addPhpSpreadsheetFolder(); + $this->addUikitFolder(); + $this->addFooTableFolder(); + } + } + + /** + * Add Import and Export Folder + * + * @return void + * @since 3.2.0 + */ + private function addImportViewFolder() + { + if ($this->config->get('add_eximport', false)) + { + // soon + } + } + + /** + * Add Php Spreadsheet Folder + * + * @return void + * @since 3.2.0 + */ + private function addPhpSpreadsheetFolder() + { + // move the phpspreadsheet Folder (TODO we must move this to a library package) + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', + 'path' => '/libraries/phpspreadsheet/', + 'rename' => 0 + ]); + } + } + + /** + * Add Uikit Folders + * + * @return void + * @since 3.2.0 + */ + private function addUikitFolder() + { + $uikit = $this->config->get('uikit', 0); + if (2 == $uikit || 1 == $uikit) + { + // move the UIKIT Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + if (2 == $uikit || 3 == $uikit) + { + // move the UIKIT-3 Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Foo Table Folder + * + * @return void + * @since 3.2.0 + */ + private function addFooTableFolder() + { + if (!$this->config->get('footable', false)) + { + return; + } + + $footable_version = $this->config->get('footable_version', 2); + + if (2 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + elseif (3 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Extra/Dynamic files + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFiles() + { + if ($this->component->isArray('files') || + $this->config->get('google_chart', false)) + { + $this->addGoogleChartFiles(); + } + } + + /** + * Add Google Chart Files + * + * @return void + * @since 3.2.0 + */ + private function addGoogleChartFiles() + { + if ($this->config->get('google_chart', false)) + { + // move the google chart files + $this->component->appendArray('files', [ + 'file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0 + ]); + $this->component->appendArray('files', [ + 'file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0 + ]); + } + } + + /** + * Add Folders + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFolders(object &$versionData) + { + if (!$this->component->isArray('folders')) + { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('folders') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'folder', 'folderpath'] + ); + + // fix custom path + if (isset($custom['path']) + && StringHelper::check($custom['path'])) + { + $custom['path'] = trim((string) $custom['path'], '/'); + } + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path folder + if (!isset($custom['folder']) && isset($custom['folderpath'])) + { + // update the dynamic path + $custom['folderpath'] = $this->dynamicpath->update( + $custom['folderpath'] + ); + + // set the folder path with / if does not have a drive/windows full path + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') + : '/' . trim($custom['folderpath'], '/'); + + // remove the file path + unset($custom['folderpath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we use the correct name + $pathArray = (array) explode('/', (string) $custom['path']); + $lastFolder = end($pathArray); + + // only rename folder if last has folder name + if (isset($custom['rename']) && $custom['rename'] == 1) + { + $custom['path'] = str_replace( + '/' . $lastFolder, '', (string) $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; + } + elseif ('full' === $customPath) + { + // make sure we use the correct name + $folderArray = (array) explode('/', (string) $custom['folder']); + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; + } + else + { + $rename = false; + $newname = ''; + } + + // insure we have no duplicates + $key_pointer = StringHelper::safe( + $custom['folder'] + ) . '_f' . $pointer_tracker; + + $pointer_tracker++; + + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set new folder to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']); + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer}->newName = $newname; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + } + + $this->component->remove('folders'); + } + + /** + * Add Files + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFiles(object &$versionData) + { + if (!$this->component->isArray('files')) { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('files') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'file', 'filepath'] + ); + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path file + if (!isset($custom['file']) && isset($custom['filepath'])) + { + // update the dynamic path + $custom['filepath'] = $this->dynamicpath->update( + $custom['filepath'] + ); + + // set the file path with / if does not have a drive/windows full path + $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); + + // remove the file path + unset($custom['filepath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we have not duplicates + $key_pointer = StringHelper::safe( + $custom['file'] + ) . '_g' . $pointer_tracker; + + $pointer_tracker++; + + // set new file to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']); + + // update the dynamic component name placholders in file names + $custom['path'] = $this->placeholder->update_( + $custom['path'] + ); + + // get the path info + $pathInfo = pathinfo((string) $custom['path']); + if (isset($pathInfo['extension']) && $pathInfo['extension']) + { + $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + } + elseif ('full' === $customPath) + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // get file array + $fileArray = (array) explode('/', (string) $custom['file']); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end($fileArray); + } + else + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = false; + } + + $versionData->move->static->{$key_pointer}->type = 'file'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) + && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + + // check if file should be updated + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) + { + $this->registry->appendArray('files.not.new', $key_pointer); + } + else + { + // update the file content + $this->registry->set('update.file.content.' . $key_pointer, true); + } + } + + $this->component->remove('files'); + } \ No newline at end of file diff --git a/src/69d2b980-a665-48cd-96f8-757bf3810b41/settings.json b/src/69d2b980-a665-48cd-96f8-757bf3810b41/settings.json new file mode 100644 index 0000000..7ee752a --- /dev/null +++ b/src/69d2b980-a665-48cd-96f8-757bf3810b41/settings.json @@ -0,0 +1,69 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "69d2b980-a665-48cd-96f8-757bf3810b41", + "implements": [ + "5f44e66a-31d0-45ff-92b3-b7372dc57ae9" + ], + "load_selection": null, + "name": "Settings", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.J5.Settings", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection6": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection7": { + "use": "268b85ef-49f3-4c39-8187-bb12e38d19ee", + "as": "default" + }, + "use_selection8": { + "use": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "as": "default" + }, + "use_selection9": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection10": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection11": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.JoomlaFive.Settings", + "description": "Compiler Component (Joomla Version) Settings\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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php index 8aa7dcc..2ec77fe 100644 --- a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php +++ b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php @@ -542,8 +542,8 @@ final class CustomFieldTypeFile $placeholders[Placefix::_('view')] = $this->getViewName(); $placeholders[Placefix::_('views')] = $this->getViewsName(); - // Gymnastics to help with transition to Joomla 4 - if ($this->config->get('joomla_version', 3) == 4) + // Gymnastics to help with transition to Joomla 4 and above + if ($this->config->get('joomla_version', 3) != 3) { $placeholders['JFactory::getUser()'] = 'Factory::getApplication()->getIdentity()'; $placeholders['Factory::getUser()'] = 'Factory::getApplication()->getIdentity()'; @@ -551,6 +551,7 @@ final class CustomFieldTypeFile $placeholders['JHtml::'] = 'Html::'; $placeholders['JText::'] = 'Text::'; $placeholders['JComponentHelper::'] = 'ComponentHelper::'; + $placeholders['\JComponentHelper::'] = 'ComponentHelper::'; } $this->placeholders = $placeholders; @@ -644,21 +645,48 @@ final class CustomFieldTypeFile $core_fields = $this->corefield->get(); $extends = $this->extends; - + $found = null; foreach ($core_fields as $core_field) { $field = strtolower((string) $core_field); if ($extends === $field) { - $this->fieldmap[$extends] = $core_field; - - return $core_field; + $found = $core_field; + break; } } - $this->fieldmap[$extends] = StringHelper::safe($extends, 'F'); + $extends = $found ?? StringHelper::safe($extends, 'F'); - return $this->fieldmap[$extends]; + if ($this->config->get('joomla_version', 3) != 3) + { + $fix = strtolower($extends); + + if ('checkboxes' === $fix) + { + $extends = 'CheckboxesField'; + } + elseif ('list' === $fix) + { + $extends = 'FormField'; + } + elseif ('radio' === $fix) + { + $extends = 'RadioField'; + } + elseif ('combo' === $fix) + { + $extends = 'ComboField'; + } + elseif (strpos($extends, 'Field') === false) + { + $extends = StringHelper::safe($extends, 'F') . 'Field'; + } + } + + $this->fieldmap[$this->extends] = $extends; + + return $extends; } /** @@ -718,8 +746,11 @@ final class CustomFieldTypeFile $this->setButtonOptionErrorMessages(); } - $target = ['admin' => 'customfield']; - $this->structure->build($target, 'fieldcustom', $this->baseType); + $targets = [['admin' => 'customfield'], ['site' => 'customfield']]; + foreach ($targets as $target) + { + $this->structure->build($target, 'fieldcustom', $this->baseType); + } $this->prepareCustomFieldHeader(); $this->prepareCustomFieldBody(); @@ -740,10 +771,13 @@ final class CustomFieldTypeFile $contents_key = $this->contentsKey; // Build the custom field type file - $target = ['admin' => 'customfield']; - $this->structure->build( - $target, 'field' . $this->extends, $this->baseType - ); + $targets = [['admin' => 'customfield'], ['site' => 'customfield']]; + foreach ($targets as $target) + { + $this->structure->build( + $target, 'field' . $this->extends, $this->baseType + ); + } $php_code = $this->loadPhpScript('php'); diff --git a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power index 0e06710..80b3540 100644 --- a/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power +++ b/src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.power @@ -496,8 +496,8 @@ $placeholders[Placefix::_('view')] = $this->getViewName(); $placeholders[Placefix::_('views')] = $this->getViewsName(); - // Gymnastics to help with transition to Joomla 4 - if ($this->config->get('joomla_version', 3) == 4) + // Gymnastics to help with transition to Joomla 4 and above + if ($this->config->get('joomla_version', 3) != 3) { $placeholders['JFactory::getUser()'] = 'Factory::getApplication()->getIdentity()'; $placeholders['Factory::getUser()'] = 'Factory::getApplication()->getIdentity()'; @@ -505,6 +505,7 @@ $placeholders['JHtml::'] = 'Html::'; $placeholders['JText::'] = 'Text::'; $placeholders['JComponentHelper::'] = 'ComponentHelper::'; + $placeholders['\JComponentHelper::'] = 'ComponentHelper::'; } $this->placeholders = $placeholders; @@ -598,21 +599,48 @@ $core_fields = $this->corefield->get(); $extends = $this->extends; - + $found = null; foreach ($core_fields as $core_field) { $field = strtolower((string) $core_field); if ($extends === $field) { - $this->fieldmap[$extends] = $core_field; - - return $core_field; + $found = $core_field; + break; } } - $this->fieldmap[$extends] = StringHelper::safe($extends, 'F'); + $extends = $found ?? StringHelper::safe($extends, 'F'); - return $this->fieldmap[$extends]; + if ($this->config->get('joomla_version', 3) != 3) + { + $fix = strtolower($extends); + + if ('checkboxes' === $fix) + { + $extends = 'CheckboxesField'; + } + elseif ('list' === $fix) + { + $extends = 'FormField'; + } + elseif ('radio' === $fix) + { + $extends = 'RadioField'; + } + elseif ('combo' === $fix) + { + $extends = 'ComboField'; + } + elseif (strpos($extends, 'Field') === false) + { + $extends = StringHelper::safe($extends, 'F') . 'Field'; + } + } + + $this->fieldmap[$this->extends] = $extends; + + return $extends; } /** @@ -672,8 +700,11 @@ $this->setButtonOptionErrorMessages(); } - $target = ['admin' => 'customfield']; - $this->structure->build($target, 'fieldcustom', $this->baseType); + $targets = [['admin' => 'customfield'], ['site' => 'customfield']]; + foreach ($targets as $target) + { + $this->structure->build($target, 'fieldcustom', $this->baseType); + } $this->prepareCustomFieldHeader(); $this->prepareCustomFieldBody(); @@ -694,10 +725,13 @@ $contents_key = $this->contentsKey; // Build the custom field type file - $target = ['admin' => 'customfield']; - $this->structure->build( - $target, 'field' . $this->extends, $this->baseType - ); + $targets = [['admin' => 'customfield'], ['site' => 'customfield']]; + foreach ($targets as $target) + { + $this->structure->build( + $target, 'field' . $this->extends, $this->baseType + ); + } $php_code = $this->loadPhpScript('php'); diff --git a/src/73183d13-9b2e-4879-b05a-52298d5b31f7/README.md b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/README.md new file mode 100644 index 0000000..fdafbb0 --- /dev/null +++ b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/README.md @@ -0,0 +1,94 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class InstallScript (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFive** +```uml +@startuml +class InstallScript << (F,LightGreen) >> #RoyalBlue { + # object $extension + # array $methods + # array $types + # array $construct + # array $install + # array $update + # array $uninstall + # bool $preflightActive + # bool $postflightActive + + get(object $extension) : string + # rest() : void + # build() : string + # head() : string + # construct() : string + # main(string $name) : string + # flight(string $name) : string +} + +note right of InstallScript::get + get install script + + since: 3.2.0 + 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 + + since: 3.2.0 + return: string +end note + +note right of InstallScript::head + get install script head + + since: 3.2.0 + return: string +end note + +note right of InstallScript::construct + get constructor + + since: 3.2.0 + return: string +end note + +note right of InstallScript::main + build main methods + + since: 3.2.0 + return: string +end note + +note right of InstallScript::flight + build flight methods + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.php b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.php new file mode 100644 index 0000000..6b24caf --- /dev/null +++ b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.php @@ -0,0 +1,395 @@ + + * @git 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\Extension\JoomlaFive; + + +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension\InstallInterface; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; + + +/** + * Loading the Extension Installation Script Class + * + * @since 3.2.0 + */ +final class InstallScript implements GetScriptInterface +{ + /** + * The extension + * + * @var InstallInterface|Object + * @since 3.2.0 + */ + protected object $extension; + + /** + * The methods + * + * @var array + * @since 3.2.0 + */ + protected array $methods = ['php_script', 'php_preflight', 'php_postflight', 'php_method']; + + /** + * The types + * + * @var array + * @since 3.2.0 + */ + protected array $types = ['construct', 'install', 'update', 'uninstall', 'discover_install']; + + /** + * The construct bucket + * + * @var array + * @since 3.2.0 + */ + protected array $construct = []; + + /** + * The install bucket + * + * @var array + * @since 3.2.0 + */ + protected array $install = []; + + /** + * The update bucket + * + * @var array + * @since 3.2.0 + */ + protected array $update = []; + + /** + * The uninstall bucket + * + * @var array + * @since 3.2.0 + */ + protected array $uninstall = []; + + /** + * The preflight switch + * + * @var bool + * @since 3.2.0 + */ + protected bool $preflightActive = false; + + /** + * The preflight bucket + * + * @var array + * @since 3.2.0 + */ + protected array $preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * The postflight switch + * + * @var bool + * @since 3.2.0 + */ + protected bool $postflightActive = false; + + /** + * The postflight bucket + * + * @var array + * @since 3.2.0 + */ + protected array $postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * get install script + * + * @param Object $extension The extension object + * + * @return string + * @since 3.2.0 + */ + public function get(object $extension): string + { + // purge the object + $this->rest(); + + // loop over methods and types + foreach ($this->methods as $method) + { + foreach ($this->types as $type) + { + if (isset($extension->{'add_' . $method . '_' . $type}) + && $extension->{'add_' . $method . '_' . $type} == 1 + && StringHelper::check( + $extension->{$method . '_' . $type} + )) + { + // add to the main methods + if ('php_method' === $method || 'php_script' === $method) + { + $this->{$type}[] = $extension->{$method . '_' . $type}; + } + else + { + // get the flight key + $flight = str_replace('php_', '', (string) $method); + // load the script to our bucket + $this->{$flight . 'Bucket'}[$type][] = $extension->{$method . '_' . $type}; + // show that the method is active + $this->{$flight . 'Active'} = true; + } + } + } + } + + $this->extension = $extension; + + // return the class + 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 + * + * @return string + * @since 3.2.0 + */ + protected function build(): string + { + // start build + $script = $this->head(); + + // load constructor if set + $script .= $this->construct(); + + // load install method if set + $script .= $this->main('install'); + + // load update method if set + $script .= $this->main('update'); + + // load uninstall method if set + $script .= $this->main('uninstall'); + + // load preflight method if set + $script .= $this->flight('preflight'); + + // load postflight method if set + $script .= $this->flight('postflight'); + + // close the class + $script .= PHP_EOL . '}' . PHP_EOL; + + return $script; + } + + /** + * get install script head + * + * @return string + * @since 3.2.0 + */ + protected function head(): string + { + // get the extension + $extension = $this->extension; + + // start build + $script = PHP_EOL . 'use Joomla\CMS\Factory;'; + $script .= PHP_EOL . 'use Joomla\CMS\Language\Text;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL; + $script .= PHP_EOL . '/**'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; + $script .= PHP_EOL . ' *'; + $script .= PHP_EOL . ' * @package ' . $extension->class_name; + $script .= PHP_EOL . ' */'; + $script .= PHP_EOL . 'class ' . $extension->installer_class_name; + $script .= PHP_EOL . '{'; + + return $script; + } + + /** + * get constructor + * + * @return string + * @since 3.2.0 + */ + protected function construct(): string + { + // return empty string if not set + if (!ArrayHelper::check($this->construct)) + { + return ''; + } + + // the __construct script + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Constructor'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) + . 'public function __construct($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build main methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function main(string $name): string + { + // return empty string if not set + if (!ArrayHelper::check($this->{$name})) + { + return ''; + } + // load the install method + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . " * Called on $name"; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); + // return true + if ('uninstall' !== $name) + { + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + } + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build flight methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function flight(string $name): string + { + // return empty string if not set + if (empty($this->{$name . 'Active'})) + { + return ''; + } + + // the pre/post function types + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($route, $adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + . ' get application'; + $script .= PHP_EOL . Indent::_(2) + . '$app = Factory::getApplication();' . PHP_EOL; + + // add the default version check (TODO) must make this dynamic + if ('preflight' === $name) + { + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + .' the default for both install and update'; + $script .= PHP_EOL . Indent::_(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . Indent::_(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . Indent::_(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . Indent::_(3) . 'return false;'; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + + // now add the scripts + foreach ($this->{$name . 'Bucket'} as $route => $_script) + { + if (ArrayHelper::check($_script)) + { + // set the if and script + $script .= PHP_EOL . Indent::_(2) . "if ('" . $route + . "' === \$route)"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + } + + // return true + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } +} + diff --git a/src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.power b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.power new file mode 100644 index 0000000..391c370 --- /dev/null +++ b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/code.power @@ -0,0 +1,364 @@ + /** + * The extension + * + * @var InstallInterface|Object + * @since 3.2.0 + */ + protected object $extension; + + /** + * The methods + * + * @var array + * @since 3.2.0 + */ + protected array $methods = ['php_script', 'php_preflight', 'php_postflight', 'php_method']; + + /** + * The types + * + * @var array + * @since 3.2.0 + */ + protected array $types = ['construct', 'install', 'update', 'uninstall', 'discover_install']; + + /** + * The construct bucket + * + * @var array + * @since 3.2.0 + */ + protected array $construct = []; + + /** + * The install bucket + * + * @var array + * @since 3.2.0 + */ + protected array $install = []; + + /** + * The update bucket + * + * @var array + * @since 3.2.0 + */ + protected array $update = []; + + /** + * The uninstall bucket + * + * @var array + * @since 3.2.0 + */ + protected array $uninstall = []; + + /** + * The preflight switch + * + * @var bool + * @since 3.2.0 + */ + protected bool $preflightActive = false; + + /** + * The preflight bucket + * + * @var array + * @since 3.2.0 + */ + protected array $preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * The postflight switch + * + * @var bool + * @since 3.2.0 + */ + protected bool $postflightActive = false; + + /** + * The postflight bucket + * + * @var array + * @since 3.2.0 + */ + protected array $postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * get install script + * + * @param Object $extension The extension object + * + * @return string + * @since 3.2.0 + */ + public function get(object $extension): string + { + // purge the object + $this->rest(); + + // loop over methods and types + foreach ($this->methods as $method) + { + foreach ($this->types as $type) + { + if (isset($extension->{'add_' . $method . '_' . $type}) + && $extension->{'add_' . $method . '_' . $type} == 1 + && StringHelper::check( + $extension->{$method . '_' . $type} + )) + { + // add to the main methods + if ('php_method' === $method || 'php_script' === $method) + { + $this->{$type}[] = $extension->{$method . '_' . $type}; + } + else + { + // get the flight key + $flight = str_replace('php_', '', (string) $method); + // load the script to our bucket + $this->{$flight . 'Bucket'}[$type][] = $extension->{$method . '_' . $type}; + // show that the method is active + $this->{$flight . 'Active'} = true; + } + } + } + } + + $this->extension = $extension; + + // return the class + 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 + * + * @return string + * @since 3.2.0 + */ + protected function build(): string + { + // start build + $script = $this->head(); + + // load constructor if set + $script .= $this->construct(); + + // load install method if set + $script .= $this->main('install'); + + // load update method if set + $script .= $this->main('update'); + + // load uninstall method if set + $script .= $this->main('uninstall'); + + // load preflight method if set + $script .= $this->flight('preflight'); + + // load postflight method if set + $script .= $this->flight('postflight'); + + // close the class + $script .= PHP_EOL . '}' . PHP_EOL; + + return $script; + } + + /** + * get install script head + * + * @return string + * @since 3.2.0 + */ + protected function head(): string + { + // get the extension + $extension = $this->extension; + + // start build + $script = PHP_EOL . 'use Joomla\CMS\Factory;'; + $script .= PHP_EOL . 'use Joomla\CMS\Language\Text;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;'; + $script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL; + $script .= PHP_EOL . '/**'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; + $script .= PHP_EOL . ' *'; + $script .= PHP_EOL . ' * @package ' . $extension->class_name; + $script .= PHP_EOL . ' */'; + $script .= PHP_EOL . 'class ' . $extension->installer_class_name; + $script .= PHP_EOL . '{'; + + return $script; + } + + /** + * get constructor + * + * @return string + * @since 3.2.0 + */ + protected function construct(): string + { + // return empty string if not set + if (!ArrayHelper::check($this->construct)) + { + return ''; + } + + // the __construct script + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Constructor'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) + . 'public function __construct($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build main methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function main(string $name): string + { + // return empty string if not set + if (!ArrayHelper::check($this->{$name})) + { + return ''; + } + // load the install method + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . " * Called on $name"; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); + // return true + if ('uninstall' !== $name) + { + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + } + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build flight methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function flight(string $name): string + { + // return empty string if not set + if (empty($this->{$name . 'Active'})) + { + return ''; + } + + // the pre/post function types + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($route, $adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + . ' get application'; + $script .= PHP_EOL . Indent::_(2) + . '$app = Factory::getApplication();' . PHP_EOL; + + // add the default version check (TODO) must make this dynamic + if ('preflight' === $name) + { + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + .' the default for both install and update'; + $script .= PHP_EOL . Indent::_(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . Indent::_(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . Indent::_(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . Indent::_(3) . 'return false;'; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + + // now add the scripts + foreach ($this->{$name . 'Bucket'} as $route => $_script) + { + if (ArrayHelper::check($_script)) + { + // set the if and script + $script .= PHP_EOL . Indent::_(2) . "if ('" . $route + . "' === \$route)"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + } + + // return true + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } \ No newline at end of file diff --git a/src/73183d13-9b2e-4879-b05a-52298d5b31f7/settings.json b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/settings.json new file mode 100644 index 0000000..3d6cf93 --- /dev/null +++ b/src/73183d13-9b2e-4879-b05a-52298d5b31f7/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "73183d13-9b2e-4879-b05a-52298d5b31f7", + "implements": [ + "2e6731ba-3a03-4836-b2c2-4e50e38cb890" + ], + "load_selection": null, + "name": "InstallScript", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Extension.J5.InstallScript", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "1aefb8f5-486f-4f00-adf9-696340b3254e", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection3": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection4": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Extension.JoomlaFive.InstallScript", + "description": "Loading the Extension Installation Script 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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/77224dc6-8024-47eb-896e-18ec3aa23420/README.md b/src/77224dc6-8024-47eb-896e-18ec3aa23420/README.md new file mode 100644 index 0000000..6da00ea --- /dev/null +++ b/src/77224dc6-8024-47eb-896e-18ec3aa23420/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Event (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFive** +```uml +@startuml +class Event #Gold { + # $activePlugins + # $dispatcher + + __construct(?Registry $params = null) + + trigger(string $event, mixed $data = null) : void +} + +note right of Event::__construct + Constructor + + since: 3.2.0 +end note + +note right of Event::trigger + Trigger an event + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/77224dc6-8024-47eb-896e-18ec3aa23420/code.php b/src/77224dc6-8024-47eb-896e-18ec3aa23420/code.php new file mode 100644 index 0000000..232fb62 --- /dev/null +++ b/src/77224dc6-8024-47eb-896e-18ec3aa23420/code.php @@ -0,0 +1,101 @@ + + * @git 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\JoomlaFive; + + +use Joomla\Registry\Registry; +use Joomla\CMS\Plugin\PluginHelper; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; + + +/** + * Compiler Events + * + * @since 3.2.0 + */ +class Event implements EventInterface +{ + /** + * 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 + * + * @param Registry|null $params The component parameters + * + * @since 3.2.0 + */ + public function __construct(?Registry $params = null) + { + // Set the params + $params = $params ?: Helper::getParams('com_componentbuilder'); + // get active plugins + if (($plugins = $params->get('compiler_plugin', false)) + !== false) + { + foreach ($plugins as $plugin) + { + // get possible plugins + if (PluginHelper::isEnabled('extension', $plugin)) + { + // Import the appropriate plugin group. + PluginHelper::importPlugin('extension', $plugin); + // activate events + $this->activePlugins = true; + } + } + } + + $this->dispatcher = Factory::getApplication(); + } + + /** + * Trigger an event + * + * @param string $event The event to trigger + * @param mixed $data The values to pass to the event/plugin + * + * @return void + * @throws \Exception + * @since 3.2.0 + */ + public function trigger(string $event, $data = null) + { + // only execute if plugins were loaded (active) + if ($this->activePlugins) + { + try + { + // Trigger this compiler event. + $results = $this->dispatcher->triggerEvent($event, $data ?? []); + } + catch (\Exception $e) + { + throw new \Exception("Error processing event '$event': " . $e->getMessage()); + } + } + } +} + diff --git a/src/77224dc6-8024-47eb-896e-18ec3aa23420/code.power b/src/77224dc6-8024-47eb-896e-18ec3aa23420/code.power new file mode 100644 index 0000000..4527c51 --- /dev/null +++ b/src/77224dc6-8024-47eb-896e-18ec3aa23420/code.power @@ -0,0 +1,72 @@ + /** + * 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 + * + * @param Registry|null $params The component parameters + * + * @since 3.2.0 + */ + public function __construct(?Registry $params = null) + { + // Set the params + $params = $params ?: Helper::getParams('com_componentbuilder'); + // get active plugins + if (($plugins = $params->get('compiler_plugin', false)) + !== false) + { + foreach ($plugins as $plugin) + { + // get possible plugins + if (PluginHelper::isEnabled('extension', $plugin)) + { + // Import the appropriate plugin group. + PluginHelper::importPlugin('extension', $plugin); + // activate events + $this->activePlugins = true; + } + } + } + + $this->dispatcher = Factory::getApplication(); + } + + /** + * Trigger an event + * + * @param string $event The event to trigger + * @param mixed $data The values to pass to the event/plugin + * + * @return void + * @throws \Exception + * @since 3.2.0 + */ + public function trigger(string $event, $data = null) + { + // only execute if plugins were loaded (active) + if ($this->activePlugins) + { + try + { + // Trigger this compiler event. + $results = $this->dispatcher->triggerEvent($event, $data ?? []); + } + catch (\Exception $e) + { + throw new \Exception("Error processing event '$event': " . $e->getMessage()); + } + } + } \ No newline at end of file diff --git a/src/77224dc6-8024-47eb-896e-18ec3aa23420/settings.json b/src/77224dc6-8024-47eb-896e-18ec3aa23420/settings.json new file mode 100644 index 0000000..f20beb3 --- /dev/null +++ b/src/77224dc6-8024-47eb-896e-18ec3aa23420/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "77224dc6-8024-47eb-896e-18ec3aa23420", + "implements": [ + "20ed72b0-fcac-4344-aee1-8a65e3bf221d" + ], + "load_selection": null, + "name": "Event", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.J5.Event", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFive.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 \r\n * @git 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;\r\nuse Joomla\\CMS\\Plugin\\PluginHelper;", + "composer": "" +} \ No newline at end of file diff --git a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php index a215cdb..72eaaa8 100644 --- a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php +++ b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.php @@ -463,6 +463,7 @@ final class FieldsetXML implements Fieldsetinterface 'label' => $lang_view . '_VERSION_LABEL', 'description' => $lang_view . '_VERSION_DESC', 'size' => 6, + 'default' => 1, 'readonly' => "true", 'filter' => 'unset' ]; diff --git a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power index 183e0c0..42adce5 100644 --- a/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power +++ b/src/79739667-72c6-4576-9830-7b1eb92e4791/code.power @@ -425,6 +425,7 @@ 'label' => $lang_view . '_VERSION_LABEL', 'description' => $lang_view . '_VERSION_DESC', 'size' => 6, + 'default' => 1, 'readonly' => "true", 'filter' => 'unset' ]; diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php index 855dcf5..b48b73b 100644 --- a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.php @@ -411,12 +411,13 @@ final class Header implements HeaderInterface case 'site.view': case 'site.views': $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; break; case 'form.custom.field': $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; $headers[] = "jimport('joomla.form.helper');"; - $headers[] = "JFormHelper::loadFieldClass('###JFORM_extends###');"; + $headers[] = "\JFormHelper::loadFieldClass('###JFORM_extends###');"; break; default: diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power index 0b60752..8b3e599 100644 --- a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/code.power @@ -375,12 +375,13 @@ case 'site.view': case 'site.views': $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; break; case 'form.custom.field': $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; $headers[] = "jimport('joomla.form.helper');"; - $headers[] = "JFormHelper::loadFieldClass('###JFORM_extends###');"; + $headers[] = "\JFormHelper::loadFieldClass('###JFORM_extends###');"; break; default: diff --git a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json index 8c2e22e..5a17244 100644 --- a/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json +++ b/src/7b56a097-9979-477b-b18a-c9dfc2f1e13b/settings.json @@ -9,7 +9,7 @@ "load_selection": null, "name": "Header", "power_version": "1.0.0", - "system_name": "JCB.Compiler.JoomlaThree.Header", + "system_name": "JCB.Compiler.J3.Header", "type": "final class", "use_selection": { "use_selection0": { diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md index 278c983..efd0701 100644 --- a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class History (Details) +# final class History (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaThree** ```uml @startuml -class History #Gold { +class History << (F,LightGreen) >> #RoyalBlue { # ?object $tmp # Config $config # $db diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php index 6912978..c94a427 100644 --- a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php @@ -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 diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json index a500ac7..c21fd1d 100644 --- a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json @@ -9,8 +9,8 @@ "load_selection": null, "name": "History", "power_version": "1.0.0", - "system_name": "JCB.Compiler.JoomlaThree.History", - "type": "class", + "system_name": "JCB.Compiler.J3.History", + "type": "final class", "use_selection": { "use_selection0": { "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md index 76ac58b..15329df 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md @@ -16,6 +16,7 @@ class Component #Gold { + getCompilerComponent(Container $container) : CompilerComponent + getJ3Settings(Container $container) : J3Settings + getJ4Settings(Container $container) : J4Settings + + getJ5Settings(Container $container) : J5Settings + getDashboard(Container $container) : Dashboard + getPlaceholder(Container $container) : Placeholder + getData(Container $container) : Data @@ -53,49 +54,56 @@ note left of Component::getJ4Settings return: J4Settings end note -note right of Component::getDashboard +note right of Component::getJ5Settings + Get The Settings Class. + + since: 3.2.0 + return: J5Settings +end note + +note left of Component::getDashboard Get The Dashboard Class. since: 3.2.0 return: Dashboard end note -note left of Component::getPlaceholder +note right of Component::getPlaceholder Get The Placeholder Class. since: 3.2.0 return: Placeholder end note -note right of Component::getData +note left of Component::getData Get The Data Class. since: 3.2.0 return: Data end note -note left of Component::getStructure +note right of Component::getStructure Get The Structure Class. since: 3.2.0 return: Structure end note -note right of Component::getStructuresingle +note left of Component::getStructuresingle Get The Structuresingle Class. since: 3.2.0 return: Structuresingle end note -note left of Component::getStructuremultiple +note right of Component::getStructuremultiple Get The Structuremultiple Class. since: 3.2.0 return: Structuremultiple end note -note right of Component::getSettings +note left of Component::getSettings Get The Settings Class. since: 3.2.0 diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php index 76d79d6..093d0b6 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent; use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree\Settings as J3Settings; use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour\Settings as J4Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFive\Settings as J5Settings; use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard; use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Component\Data; @@ -60,6 +61,9 @@ class Component implements ServiceProviderInterface $container->alias(J4Settings::class, 'Component.J4.Settings') ->share('Component.J4.Settings', [$this, 'getJ4Settings'], true); + $container->alias(J5Settings::class, 'Component.J5.Settings') + ->share('Component.J5.Settings', [$this, 'getJ5Settings'], true); + $container->alias(Dashboard::class, 'Component.Dashboard') ->share('Component.Dashboard', [$this, 'getDashboard'], true); @@ -141,6 +145,28 @@ class Component implements ServiceProviderInterface ); } + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J5Settings + * @since 3.2.0 + */ + public function getJ5Settings(Container $container): J5Settings + { + return new J5Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + /** * Get The Dashboard Class. * @@ -202,7 +228,8 @@ class Component implements ServiceProviderInterface $container->get('Model.Customadminviews'), $container->get('Model.Updateserver'), $container->get('Model.Joomlamodules'), - $container->get('Model.Joomlaplugins') + $container->get('Model.Joomlaplugins'), + $container->get('Model.Router') ); } diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power index b4214e3..0e007f9 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.power @@ -25,6 +25,9 @@ $container->alias(J4Settings::class, 'Component.J4.Settings') ->share('Component.J4.Settings', [$this, 'getJ4Settings'], true); + $container->alias(J5Settings::class, 'Component.J5.Settings') + ->share('Component.J5.Settings', [$this, 'getJ5Settings'], true); + $container->alias(Dashboard::class, 'Component.Dashboard') ->share('Component.Dashboard', [$this, 'getDashboard'], true); @@ -106,6 +109,28 @@ ); } + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J5Settings + * @since 3.2.0 + */ + public function getJ5Settings(Container $container): J5Settings + { + return new J5Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + /** * Get The Dashboard Class. * @@ -167,7 +192,8 @@ $container->get('Model.Customadminviews'), $container->get('Model.Updateserver'), $container->get('Model.Joomlamodules'), - $container->get('Model.Joomlaplugins') + $container->get('Model.Joomlaplugins'), + $container->get('Model.Router') ); } diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json index 00849c5..f007023 100644 --- a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json @@ -24,6 +24,10 @@ "use": "e7fff971-b031-42bf-8009-ef554e30854d", "as": "J4Settings" }, + "use_selection10": { + "use": "69d2b980-a665-48cd-96f8-757bf3810b41", + "as": "J5Settings" + }, "use_selection3": { "use": "cfe62a32-8818-4bfb-8751-2f1e109b5336", "as": "default" diff --git a/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/README.md b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/README.md new file mode 100644 index 0000000..c0e8b63 --- /dev/null +++ b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class History (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFive** +```uml +@startuml +class History << (F,LightGreen) >> #RoyalBlue { + # ?object $tmp + # Config $config + # $db + + __construct(?Config $config = null) + + get(string $type, int $id) : ?object + # set(object $object, int $action) : bool +} + +note right of History::__construct + Constructor + + since: 3.2.0 +end note + +note right of History::get + Get Item History object + + since: 3.2.0 + return: ?object +end note + +note right of History::set + Set Item History Watch +0 = remove watch +1 = add watch + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.php b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.php new file mode 100644 index 0000000..1a0c2f8 --- /dev/null +++ b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.php @@ -0,0 +1,211 @@ + + * @git 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\JoomlaFive; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; + + +/** + * Compiler History + * + * @since 3.2.0 + */ +final class History implements HistoryInterface +{ + /** + * History Item Object + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $tmp; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Database object to query local DB + * + * @since 3.2.0 + */ + protected $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = Factory::getDbo(); + } + + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object + { + // quick class object to store old history object + $this->tmp = null; + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__history AS h'); + $query->where( + $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); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // new version of this item found + // so we need to mark it as the last compiled version + $newActive = $this->db->loadObject(); + // set the new version watch + $this->set($newActive, 1); + } + // Get last compiled verion + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__history AS h'); + $query->where( + $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%')); + // make sure it does not return the active version + if (isset($newActive) && isset($newActive->version_id)) + { + $query->where('h.version_id != ' . (int) $newActive->version_id); + } + $query->order('h.save_date DESC'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // the old active version was found + // so we may need to do an SQL update + // and unmark the old compiled version + $oldActives = $this->db->loadObjectList(); + foreach ($oldActives as $oldActive) + { + // remove old version watch + $this->set($oldActive, 0); + } + } + + // return the last used history record or null. + return $this->tmp; + } + + /** + * Set Item History Watch + * + * @param Object $object The history object + * @param int $action The action to take + * 0 = remove watch + * 1 = add watch + * + * @return bool + * @since 3.2.0 + */ + protected function set(object $object, int $action): bool + { + // check the note + if (JsonHelper::check($object->version_note)) + { + $version_note = json_decode((string) $object->version_note, true); + } + else + { + $version_note = array('component' => []); + } + // set watch + switch ($action) + { + case 0: + // remove watch + if (isset($version_note['component']) + && ($key = array_search( + $this->config->component_id, $version_note['component'] + )) !== false) + { + // last version that was used to build/compile + $this->tmp = json_decode((string) $object->version_data); + // remove it from this component + unset($version_note['component'][$key]); + } + else + { + // since it was not found, no need to update anything + return true; + } + break; + case 1: + // add watch + if (!in_array($this->config->component_id, $version_note['component'])) + { + $version_note['component'][] = $this->config->component_id; + } + else + { + // since it is there already, no need to update anything + return true; + } + break; + } + // check if we need to still keep this locked + if (isset($version_note['component']) + && ArrayHelper::check($version_note['component'])) + { + // insure component ids are only added once per item + $version_note['component'] = array_unique( + $version_note['component'] + ); + // we may change this, little risky (but since JCB does not have history notes it should be okay for now) + $object->version_note = json_encode($version_note); + $object->keep_forever = '1'; + } + else + { + $object->version_note = ''; + $object->keep_forever = '0'; + } + + // run the update + return $this->db->updateObject('#__history', $object, 'version_id'); + } +} + diff --git a/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.power b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.power new file mode 100644 index 0000000..ba11d03 --- /dev/null +++ b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/code.power @@ -0,0 +1,180 @@ + /** + * History Item Object + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $tmp; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Database object to query local DB + * + * @since 3.2.0 + */ + protected $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = Factory::getDbo(); + } + + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object + { + // quick class object to store old history object + $this->tmp = null; + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__history AS h'); + $query->where( + $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); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // new version of this item found + // so we need to mark it as the last compiled version + $newActive = $this->db->loadObject(); + // set the new version watch + $this->set($newActive, 1); + } + // Get last compiled verion + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__history AS h'); + $query->where( + $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%')); + // make sure it does not return the active version + if (isset($newActive) && isset($newActive->version_id)) + { + $query->where('h.version_id != ' . (int) $newActive->version_id); + } + $query->order('h.save_date DESC'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // the old active version was found + // so we may need to do an SQL update + // and unmark the old compiled version + $oldActives = $this->db->loadObjectList(); + foreach ($oldActives as $oldActive) + { + // remove old version watch + $this->set($oldActive, 0); + } + } + + // return the last used history record or null. + return $this->tmp; + } + + /** + * Set Item History Watch + * + * @param Object $object The history object + * @param int $action The action to take + * 0 = remove watch + * 1 = add watch + * + * @return bool + * @since 3.2.0 + */ + protected function set(object $object, int $action): bool + { + // check the note + if (JsonHelper::check($object->version_note)) + { + $version_note = json_decode((string) $object->version_note, true); + } + else + { + $version_note = array('component' => []); + } + // set watch + switch ($action) + { + case 0: + // remove watch + if (isset($version_note['component']) + && ($key = array_search( + $this->config->component_id, $version_note['component'] + )) !== false) + { + // last version that was used to build/compile + $this->tmp = json_decode((string) $object->version_data); + // remove it from this component + unset($version_note['component'][$key]); + } + else + { + // since it was not found, no need to update anything + return true; + } + break; + case 1: + // add watch + if (!in_array($this->config->component_id, $version_note['component'])) + { + $version_note['component'][] = $this->config->component_id; + } + else + { + // since it is there already, no need to update anything + return true; + } + break; + } + // check if we need to still keep this locked + if (isset($version_note['component']) + && ArrayHelper::check($version_note['component'])) + { + // insure component ids are only added once per item + $version_note['component'] = array_unique( + $version_note['component'] + ); + // we may change this, little risky (but since JCB does not have history notes it should be okay for now) + $object->version_note = json_encode($version_note); + $object->keep_forever = '1'; + } + else + { + $object->version_note = ''; + $object->keep_forever = '0'; + } + + // run the update + return $this->db->updateObject('#__history', $object, 'version_id'); + } \ No newline at end of file diff --git a/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/settings.json b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/settings.json new file mode 100644 index 0000000..beb86e7 --- /dev/null +++ b/src/8ab6fe75-ba5a-4316-9ef8-1eccceec813f/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "8ab6fe75-ba5a-4316-9ef8-1eccceec813f", + "implements": [ + "4325745f-da1f-4d4d-a591-3189fe8c06e5" + ], + "load_selection": null, + "name": "History", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.J5.History", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFive.History", + "description": "Compiler History\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 \r\n * @git 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\\Factory;", + "composer": "" +} \ No newline at end of file diff --git a/src/8b56b62d-b960-4823-b9bb-c71675a71b85/README.md b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/README.md new file mode 100644 index 0000000..8d00fcc --- /dev/null +++ b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class CoreRule (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive** +```uml +@startuml +class CoreRule << (F,LightGreen) >> #RoyalBlue { + # array $rules + # string $path + + __construct() + + get(bool $lowercase = false) : array + - set(string $path) : void +} + +note right of CoreRule::__construct + Constructor + + since: 3.2.0 +end note + +note right of CoreRule::get + Get the Array of Existing Validation Rule Names + + since: 3.2.0 + return: array +end note + +note right of CoreRule::set + Set the rules 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) + diff --git a/src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.php b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.php new file mode 100644 index 0000000..9aee380 --- /dev/null +++ b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.php @@ -0,0 +1,125 @@ + + * @git 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\CoreRuleInterface; + + +/** + * Core Joomla Field Rules + * + * @since 3.2.0 + */ +final class CoreRule implements CoreRuleInterface +{ + /** + * Local Core Joomla Rules + * + * @var array + * @since 3.2.0 + **/ + protected array $rules = []; + + /** + * Local Core Joomla Rules Path + * + * @var string + * @since 3.2.0 + **/ + protected string $path; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation rules + $this->path = JPATH_LIBRARIES . '/src/Form/Rule'; + } + + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->rules === []) + { + $this->set($this->path); + } + + // return rules if found + if ($this->rules !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->rules + ); + } + + return $this->rules; + } + + // return empty array + return []; + } + + /** + * Set the rules found in a path + * + * @param string $path The path to load rules 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 + $rules = Folder::files($path, '\.php$', true, true); + + // Process the files to extract rule names + $processedRules = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Rule.php' if it exists or just '.php' otherwise + if (substr($fileName, -8) === 'Rule.php') + { + return str_replace('Rule.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $rules); + + // Merge with existing rules and remove duplicates + $this->rules = array_unique(array_merge($processedRules, $this->rules)); + } +} + diff --git a/src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.power b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.power new file mode 100644 index 0000000..6d176ce --- /dev/null +++ b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/code.power @@ -0,0 +1,97 @@ + /** + * Local Core Joomla Rules + * + * @var array + * @since 3.2.0 + **/ + protected array $rules = []; + + /** + * Local Core Joomla Rules Path + * + * @var string + * @since 3.2.0 + **/ + protected string $path; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation rules + $this->path = JPATH_LIBRARIES . '/src/Form/Rule'; + } + + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if ($this->rules === []) + { + $this->set($this->path); + } + + // return rules if found + if ($this->rules !== []) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->rules + ); + } + + return $this->rules; + } + + // return empty array + return []; + } + + /** + * Set the rules found in a path + * + * @param string $path The path to load rules 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 + $rules = Folder::files($path, '\.php$', true, true); + + // Process the files to extract rule names + $processedRules = array_map(function ($name) { + $fileName = basename($name); + + // Remove 'Rule.php' if it exists or just '.php' otherwise + if (substr($fileName, -8) === 'Rule.php') + { + return str_replace('Rule.php', '', $fileName); + } + else + { + return str_replace('.php', '', $fileName); + } + }, $rules); + + // Merge with existing rules and remove duplicates + $this->rules = array_unique(array_merge($processedRules, $this->rules)); + } \ No newline at end of file diff --git a/src/8b56b62d-b960-4823-b9bb-c71675a71b85/settings.json b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/settings.json new file mode 100644 index 0000000..69cd4c4 --- /dev/null +++ b/src/8b56b62d-b960-4823-b9bb-c71675a71b85/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "8b56b62d-b960-4823-b9bb-c71675a71b85", + "implements": [ + "b9f05dc4-d23a-499a-a826-9749b81818ed" + ], + "load_selection": null, + "name": "CoreRule", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.J5.CoreRule", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaFive.CoreRule", + "description": "Core Joomla Field Rules\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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md b/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md index 8863ea7..f6cef12 100644 --- a/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md +++ b/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md @@ -20,7 +20,7 @@ class Language #Gold { + getTarget(string $target) : array + setTarget(string $target, ?array $content) : void + set(string $target, string $language, ...) : void - # fix(string $string) : string + + fix(string $string) : string } note right of Language::__construct @@ -78,7 +78,10 @@ note right of Language::set end note note left of Language::fix - We need to remove all text breaks from all language strings + Removes all types of line breaks from a given string. +This method is designed to strip out all kinds of new line characters from the input string +to ensure a single-line output. It takes into consideration different operating systems' +line endings, including the combination of Carriage Return and Line Feed. since: 3.2.0 return: string diff --git a/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php b/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php index 8370943..73011bb 100644 --- a/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php +++ b/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php @@ -65,16 +65,13 @@ class Language implements LanguageInterface public function key($string): string { // this is there to insure we don't break already added Language strings - if (StringHelper::safe($string, 'U', '_', false, false) - === $string) + if (StringHelper::safe($string, 'U', '_', false, false) === $string) { return false; } // build language key - $key_lang = $this->config->lang_prefix . '_' . StringHelper::safe( - $string, 'U' - ); + $key_lang = $this->config->lang_prefix . '_' . StringHelper::safe($string, 'U'); // set the language string $this->set($this->config->lang_target, $key_lang, $string); @@ -97,7 +94,7 @@ class Language implements LanguageInterface { return isset($this->content[$target][$language]); } - + return isset($this->content[$target]); } @@ -165,38 +162,42 @@ class Language implements LanguageInterface */ public function set(string $target, string $language, string $string, bool $addPrefix = false) { - if ($addPrefix && empty( - $this->content[$target][$this->config->lang_prefix . '_' . $language] - )) + if ($addPrefix && empty($this->content[$target][$this->config->lang_prefix . '_' . $language])) { $this->content[$target][$this->config->lang_prefix . '_' . $language] = $this->fix($string); } elseif (empty($this->content[$target][$language])) { - $this->content[$target][$language] = $this->fix( - $string - ); + $this->content[$target][$language] = $this->fix($string); } } /** - * We need to remove all text breaks from all language strings + * Removes all types of line breaks from a given string. * - * @param string $string The language string + * This method is designed to strip out all kinds of new line characters from the input string + * to ensure a single-line output. It takes into consideration different operating systems' + * line endings, including the combination of Carriage Return and Line Feed. * - * @return string + * @param string $string The input string possibly containing line breaks. + * + * @return string The modified string with all line breaks removed. * @since 3.2.0 */ - protected function fix(string $string): string + public function fix(string $string): string { if ($this->config->remove_line_breaks) { - return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string)); + // Using a single str_replace call to handle all variations of line breaks. + // The array includes \r\n (CR+LF used in Windows), \n (LF used in Unix/Linux), + // and \r (CR used in old Macs) to cover all bases. + $search = [PHP_EOL, "\r\n", "\n", "\r"]; + $string = str_replace($search, '', $string); } + // Trim the string to remove any leading or trailing whitespace. return trim($string); - } - + } } diff --git a/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.power b/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.power index 383aeed..3a5618b 100644 --- a/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.power +++ b/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.power @@ -37,16 +37,13 @@ public function key($string): string { // this is there to insure we don't break already added Language strings - if (StringHelper::safe($string, 'U', '_', false, false) - === $string) + if (StringHelper::safe($string, 'U', '_', false, false) === $string) { return false; } // build language key - $key_lang = $this->config->lang_prefix . '_' . StringHelper::safe( - $string, 'U' - ); + $key_lang = $this->config->lang_prefix . '_' . StringHelper::safe($string, 'U'); // set the language string $this->set($this->config->lang_target, $key_lang, $string); @@ -69,7 +66,7 @@ { return isset($this->content[$target][$language]); } - + return isset($this->content[$target]); } @@ -137,35 +134,40 @@ */ public function set(string $target, string $language, string $string, bool $addPrefix = false) { - if ($addPrefix && empty( - $this->content[$target][$this->config->lang_prefix . '_' . $language] - )) + if ($addPrefix && empty($this->content[$target][$this->config->lang_prefix . '_' . $language])) { $this->content[$target][$this->config->lang_prefix . '_' . $language] = $this->fix($string); } elseif (empty($this->content[$target][$language])) { - $this->content[$target][$language] = $this->fix( - $string - ); + $this->content[$target][$language] = $this->fix($string); } } /** - * We need to remove all text breaks from all language strings + * Removes all types of line breaks from a given string. * - * @param string $string The language string + * This method is designed to strip out all kinds of new line characters from the input string + * to ensure a single-line output. It takes into consideration different operating systems' + * line endings, including the combination of Carriage Return and Line Feed. * - * @return string + * @param string $string The input string possibly containing line breaks. + * + * @return string The modified string with all line breaks removed. * @since 3.2.0 */ - protected function fix(string $string): string + public function fix(string $string): string { if ($this->config->remove_line_breaks) { - return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string)); + // Using a single str_replace call to handle all variations of line breaks. + // The array includes \r\n (CR+LF used in Windows), \n (LF used in Unix/Linux), + // and \r (CR used in old Macs) to cover all bases. + $search = [PHP_EOL, "\r\n", "\n", "\r"]; + $string = str_replace($search, '', $string); } + // Trim the string to remove any leading or trailing whitespace. return trim($string); - } + } \ No newline at end of file diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md index 072ee00..84cf2e4 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/README.md @@ -31,6 +31,11 @@ class Creator #Gold { + getPermission(Container $container) : Permission + getSiteFieldData(Container $container) : SiteFieldData + getRequest(Container $container) : Request + + getRouter(Container $container) : Router + + getRouterConstructorDefault(Container $container) : RouterConstructorDefault + + getRouterConstructorManual(Container $container) : RouterConstructorManual + + getRouterMethodsDefault(Container $container) : RouterMethodsDefault + + getRouterMethodsManual(Container $container) : RouterMethodsManual + getFieldsetString(Container $container) : FieldsetString + getFieldsetXML(Container $container) : FieldsetXML + getFieldsetDynamic(Container $container) : FieldsetDynamic @@ -182,63 +187,98 @@ note left of Creator::getRequest return: Request end note -note right of Creator::getFieldsetString +note right of Creator::getRouter + Get The Router Class. + + since: 3.2.0 + return: Router +end note + +note left of Creator::getRouterConstructorDefault + Get The RouterConstructorDefault Class. + + since: 3.2.0 + return: RouterConstructorDefault +end note + +note right of Creator::getRouterConstructorManual + Get The RouterConstructorManual Class. + + since: 3.2.0 + return: RouterConstructorManual +end note + +note left of Creator::getRouterMethodsDefault + Get The RouterMethodsDefault Class. + + since: 3.2.0 + return: RouterMethodsDefault +end note + +note right of Creator::getRouterMethodsManual + Get The RouterMethodsManual Class. + + since: 3.2.0 + return: RouterMethodsManual +end note + +note left of Creator::getFieldsetString Get The FieldsetString Class. since: 3.2.0 return: FieldsetString end note -note left of Creator::getFieldsetXML +note right of Creator::getFieldsetXML Get The FieldsetXML Class. since: 3.2.0 return: FieldsetXML end note -note right of Creator::getFieldsetDynamic +note left of Creator::getFieldsetDynamic Get The FieldsetDynamic Class. since: 3.2.0 return: FieldsetDynamic end note -note left of Creator::getFieldXML +note right of Creator::getFieldXML Get The FieldXML Class. since: 3.2.0 return: FieldXML end note -note right of Creator::getFieldString +note left of Creator::getFieldString Get The FieldString Class. since: 3.2.0 return: FieldString end note -note left of Creator::getFieldDynamic +note right of Creator::getFieldDynamic Get The FieldDynamic Class. since: 3.2.0 return: FieldDynamic end note -note right of Creator::getFieldAsString +note left of Creator::getFieldAsString Get The FieldAsString Class. since: 3.2.0 return: FieldAsString end note -note left of Creator::getFieldType +note right of Creator::getFieldType Get The Fieldtypeinterface Class. since: 3.2.0 return: FieldType end note -note right of Creator::getFieldset +note left of Creator::getFieldset Get The Fieldsetinterface Class. since: 3.2.0 diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php index 41bee7a..36aa474 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.php @@ -33,6 +33,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Creator\Layout; use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; use VDM\Joomla\Componentbuilder\Compiler\Creator\SiteFieldData; use VDM\Joomla\Componentbuilder\Compiler\Creator\Request; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Router; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorDefault; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorManual; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsDefault; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsManual; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetString; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetXML; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetDynamic; @@ -118,6 +123,21 @@ class Creator implements ServiceProviderInterface $container->alias(Request::class, 'Compiler.Creator.Request') ->share('Compiler.Creator.Request', [$this, 'getRequest'], true); + $container->alias(Router::class, 'Compiler.Creator.Router') + ->share('Compiler.Creator.Router', [$this, 'getRouter'], true); + + $container->alias(RouterConstructorDefault::class, 'Compiler.Creator.Router.Constructor.Default') + ->share('Compiler.Creator.Router.Constructor.Default', [$this, 'getRouterConstructorDefault'], true); + + $container->alias(RouterConstructorManual::class, 'Compiler.Creator.Router.Constructor.Manual') + ->share('Compiler.Creator.Router.Constructor.Manual', [$this, 'getRouterConstructorManual'], true); + + $container->alias(RouterMethodsDefault::class, 'Compiler.Creator.Router.Methods.Default') + ->share('Compiler.Creator.Router.Methods.Default', [$this, 'getRouterMethodsDefault'], true); + + $container->alias(RouterMethodsManual::class, 'Compiler.Creator.Router.Methods.Manual') + ->share('Compiler.Creator.Router.Methods.Manual', [$this, 'getRouterMethodsManual'], true); + $container->alias(FieldsetString::class, 'Compiler.Creator.Fieldset.String') ->share('Compiler.Creator.Fieldset.String', [$this, 'getFieldsetString'], true); @@ -568,6 +588,87 @@ class Creator implements ServiceProviderInterface ); } + /** + * 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('Customcode.Dispenser'), + $container->get('Compiler.Builder.Request'), + $container->get('Compiler.Builder.Router'), + $container->get('Compiler.Creator.Router.Constructor.Default'), + $container->get('Compiler.Creator.Router.Constructor.Manual'), + $container->get('Compiler.Creator.Router.Methods.Default'), + $container->get('Compiler.Creator.Router.Methods.Manual') + ); + } + + /** + * Get The RouterConstructorDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorDefault + * @since 3.2.0 + */ + public function getRouterConstructorDefault(Container $container): RouterConstructorDefault + { + return new RouterConstructorDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterConstructorManual Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorManual + * @since 3.2.0 + */ + public function getRouterConstructorManual(Container $container): RouterConstructorManual + { + return new RouterConstructorManual( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsDefault + * @since 3.2.0 + */ + public function getRouterMethodsDefault(Container $container): RouterMethodsDefault + { + return new RouterMethodsDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsManual Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsManual + * @since 3.2.0 + */ + public function getRouterMethodsManual(Container $container): RouterMethodsManual + { + return new RouterMethodsManual( + $container->get('Compiler.Builder.Router') + ); + } + /** * Get The FieldsetString Class. * diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power index 3a68e7c..b7b5413 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/code.power @@ -65,6 +65,21 @@ $container->alias(Request::class, 'Compiler.Creator.Request') ->share('Compiler.Creator.Request', [$this, 'getRequest'], true); + $container->alias(Router::class, 'Compiler.Creator.Router') + ->share('Compiler.Creator.Router', [$this, 'getRouter'], true); + + $container->alias(RouterConstructorDefault::class, 'Compiler.Creator.Router.Constructor.Default') + ->share('Compiler.Creator.Router.Constructor.Default', [$this, 'getRouterConstructorDefault'], true); + + $container->alias(RouterConstructorManual::class, 'Compiler.Creator.Router.Constructor.Manual') + ->share('Compiler.Creator.Router.Constructor.Manual', [$this, 'getRouterConstructorManual'], true); + + $container->alias(RouterMethodsDefault::class, 'Compiler.Creator.Router.Methods.Default') + ->share('Compiler.Creator.Router.Methods.Default', [$this, 'getRouterMethodsDefault'], true); + + $container->alias(RouterMethodsManual::class, 'Compiler.Creator.Router.Methods.Manual') + ->share('Compiler.Creator.Router.Methods.Manual', [$this, 'getRouterMethodsManual'], true); + $container->alias(FieldsetString::class, 'Compiler.Creator.Fieldset.String') ->share('Compiler.Creator.Fieldset.String', [$this, 'getFieldsetString'], true); @@ -515,6 +530,87 @@ ); } + /** + * 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('Customcode.Dispenser'), + $container->get('Compiler.Builder.Request'), + $container->get('Compiler.Builder.Router'), + $container->get('Compiler.Creator.Router.Constructor.Default'), + $container->get('Compiler.Creator.Router.Constructor.Manual'), + $container->get('Compiler.Creator.Router.Methods.Default'), + $container->get('Compiler.Creator.Router.Methods.Manual') + ); + } + + /** + * Get The RouterConstructorDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorDefault + * @since 3.2.0 + */ + public function getRouterConstructorDefault(Container $container): RouterConstructorDefault + { + return new RouterConstructorDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterConstructorManual Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorManual + * @since 3.2.0 + */ + public function getRouterConstructorManual(Container $container): RouterConstructorManual + { + return new RouterConstructorManual( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsDefault + * @since 3.2.0 + */ + public function getRouterMethodsDefault(Container $container): RouterMethodsDefault + { + return new RouterMethodsDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsManual Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsManual + * @since 3.2.0 + */ + public function getRouterMethodsManual(Container $container): RouterMethodsManual + { + return new RouterMethodsManual( + $container->get('Compiler.Builder.Router') + ); + } + /** * Get The FieldsetString Class. * diff --git a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json index 9612be6..25f83e7 100644 --- a/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json +++ b/src/8fdd604f-53e7-4a91-9935-afcfd2f6ac1b/settings.json @@ -89,38 +89,58 @@ "as": "default" }, "use_selection19": { - "use": "05448890-e324-41a0-b6db-d804bfc241cc", + "use": "1294a7c7-46fb-4527-a69d-f8db830fd39a", "as": "default" }, "use_selection20": { - "use": "79739667-72c6-4576-9830-7b1eb92e4791", + "use": "e5278bf3-6dfb-42a0-b699-148b5ab8e45f", "as": "default" }, "use_selection21": { - "use": "b5986fab-17ca-4236-8c0c-81ebd2bb82ba", + "use": "ec7bdbf9-8377-446e-9f40-64e23ae96b59", "as": "default" }, "use_selection22": { - "use": "ac691a05-5630-4002-b166-dedec3fb0fcb", + "use": "17c590ed-8a44-485c-9be8-9a144a6b7429", "as": "default" }, "use_selection23": { - "use": "44d039b9-d293-481b-b560-23a6e7a63962", + "use": "6034587d-82a3-4b19-ac58-40507f79122a", "as": "default" }, "use_selection24": { - "use": "4801f8b0-4a4a-4eda-8f0e-cf77f042c35e", + "use": "05448890-e324-41a0-b6db-d804bfc241cc", "as": "default" }, "use_selection25": { - "use": "f48764e0-16c6-459c-8576-af7616f3b720", + "use": "79739667-72c6-4576-9830-7b1eb92e4791", "as": "default" }, "use_selection26": { + "use": "b5986fab-17ca-4236-8c0c-81ebd2bb82ba", + "as": "default" + }, + "use_selection27": { + "use": "ac691a05-5630-4002-b166-dedec3fb0fcb", + "as": "default" + }, + "use_selection28": { + "use": "44d039b9-d293-481b-b560-23a6e7a63962", + "as": "default" + }, + "use_selection29": { + "use": "4801f8b0-4a4a-4eda-8f0e-cf77f042c35e", + "as": "default" + }, + "use_selection30": { + "use": "f48764e0-16c6-459c-8576-af7616f3b720", + "as": "default" + }, + "use_selection31": { "use": "2d27c436-4d8e-4692-8382-d9e97af2231c", "as": "FieldType" }, - "use_selection27": { + "use_selection32": { "use": "d44f3294-6b68-4d85-a617-15fb772b7d14", "as": "Fieldset" } diff --git a/src/92cc3144-1d3d-45b2-b49f-c7d356950033/README.md b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/README.md new file mode 100644 index 0000000..c938937 --- /dev/null +++ b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Customtabs (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive** +```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) + diff --git a/src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.php b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.php new file mode 100644 index 0000000..3a70bea --- /dev/null +++ b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.php @@ -0,0 +1,240 @@ + + * @git 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\JoomlaFive; + + +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) + . ""; + $tmp .= PHP_EOL . $_tab . Indent::_(2) + . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(3) + . '
'; + $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) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(1) + . ""; + + // 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) + . "canDo->get('" + . $tab['view'] . "." . $tab['code'] + . ".viewtab')) : ?>"; + $tmp .= $tab['html']; + $tmp .= PHP_EOL . Indent::_(1) . ""; + // 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); + } +} + diff --git a/src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.power b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.power new file mode 100644 index 0000000..f2424c9 --- /dev/null +++ b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.power @@ -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) + . ""; + $tmp .= PHP_EOL . $_tab . Indent::_(2) + . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(3) + . '
'; + $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) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(1) + . ""; + + // 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) + . "canDo->get('" + . $tab['view'] . "." . $tab['code'] + . ".viewtab')) : ?>"; + $tmp .= $tab['html']; + $tmp .= PHP_EOL . Indent::_(1) . ""; + // 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); + } \ No newline at end of file diff --git a/src/92cc3144-1d3d-45b2-b49f-c7d356950033/settings.json b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/settings.json new file mode 100644 index 0000000..a2cc06b --- /dev/null +++ b/src/92cc3144-1d3d-45b2-b49f-c7d356950033/settings.json @@ -0,0 +1,57 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "92cc3144-1d3d-45b2-b49f-c7d356950033", + "implements": [ + "fcf42c53-0967-4c87-9699-a4d86adfdadf" + ], + "load_selection": null, + "name": "Customtabs", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.J5.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.JoomlaFive.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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/95deb809-5f43-400b-939f-f9ceef720b13/README.md b/src/95deb809-5f43-400b-939f-f9ceef720b13/README.md new file mode 100644 index 0000000..607a80a --- /dev/null +++ b/src/95deb809-5f43-400b-939f-f9ceef720b13/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Header (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFive** +```uml +@startuml +class Header << (F,LightGreen) >> #RoyalBlue { + # Config $config + # Event $event + # Placeholder $placeholder + # Language $language + # UikitComp $uikitcomp + # AdminFilterType $adminfiltertype + # Category $category + # AccessSwitchList $accessswitchlist + # Filter $filter + # Tags $tags + # array $headers + # string $NamespacePrefix + # string $ComponentName + # string $ComponentNamespace + + __construct(Config $config, Event $event, ...) + + get(string $context, string $codeName) : string + # getHeaders(string $context) : array + # setHelperClassHeader(array $headers, string $target_client) : void +} + +note right of Header::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Event $event + Placeholder $placeholder + Language $language + UikitComp $uikitcomp + AdminFilterType $adminfiltertype + Category $category + AccessSwitchList $accessswitchlist + Filter $filter + Tags $tags +end note + +note right of Header::get + Get the headers for a file + + since: 3.2.0 + return: string +end note + +note right of Header::getHeaders + Get the headers for a file + + since: 3.2.0 + return: array +end note + +note right of Header::setHelperClassHeader + set Helper Dynamic Headers + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/95deb809-5f43-400b-939f-f9ceef720b13/code.php b/src/95deb809-5f43-400b-939f-f9ceef720b13/code.php new file mode 100644 index 0000000..5db1071 --- /dev/null +++ b/src/95deb809-5f43-400b-939f-f9ceef720b13/code.php @@ -0,0 +1,583 @@ + + * @git 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\JoomlaFive; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; +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\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface; + + +/** + * Build headers for all Joomla 5 files + * + * @since 3.2.0 + */ +final class Header implements HeaderInterface +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The UikitComp Class. + * + * @var UikitComp + * @since 3.2.0 + */ + protected UikitComp $uikitcomp; + + /** + * The AdminFilterType Class. + * + * @var AdminFilterType + * @since 3.2.0 + */ + protected AdminFilterType $adminfiltertype; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The AccessSwitchList Class. + * + * @var AccessSwitchList + * @since 3.2.0 + */ + protected AccessSwitchList $accessswitchlist; + + /** + * The Filter Class. + * + * @var Filter + * @since 3.2.0 + */ + protected Filter $filter; + + /** + * The Tags Class. + * + * @var Tags + * @since 3.2.0 + */ + protected Tags $tags; + + /** + * The Header Context array + * + * @var array + * @since 3.2.0 + */ + protected array $headers = []; + + /** + * The Namespace Prefix + * + * @var string + * @since 3.2.0 + */ + protected string $NamespacePrefix; + + /** + * The Component Name (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentName; + + /** + * The Component Namespace (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentNamespace; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Language $language The Language Class. + * @param UikitComp $uikitcomp The UikitComp Class. + * @param AdminFilterType $adminfiltertype The AdminFilterType Class. + * @param Category $category The Category Class. + * @param AccessSwitchList $accessswitchlist The AccessSwitchList Class. + * @param Filter $filter The Filter Class. + * @param Tags $tags The Tags Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Placeholder $placeholder, + Language $language, UikitComp $uikitcomp, + AdminFilterType $adminfiltertype, Category $category, + AccessSwitchList $accessswitchlist, Filter $filter, + Tags $tags) + { + $this->config = $config; + $this->event = $event; + $this->placeholder = $placeholder; + $this->language = $language; + $this->uikitcomp = $uikitcomp; + $this->adminfiltertype = $adminfiltertype; + $this->category = $category; + $this->accessswitchlist = $accessswitchlist; + $this->filter = $filter; + $this->tags = $tags; + + // set some global values + $this->NamespacePrefix = $this->placeholder->get('NamespacePrefix'); + $this->ComponentName = $this->placeholder->get('Component'); + $this->ComponentNamespace = $this->placeholder->get('ComponentNamespace'); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string + { + // 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) + { + case 'admin.helper': + case 'site.helper': + $this->setHelperClassHeader($headers, $codeName); + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'custom.admin.view.html': + case 'custom.admin.views.html': + case 'site.admin.view.html': + case 'site.view.html': + case 'site.views.html': + if ((2 == $this->config->uikit || 1 == $this->config->uikit) + && $this->uikitcomp->exists($codeName)) + { + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + } + break; + + 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': + case 'site.admin.view.model': + case 'custom.admin.view.model': + case 'site.view.model': + case 'admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Helper\TagsHelper;'; + break; + + default: + break; + } + + // Trigger Event: jcb_ce_setClassHeader + $this->event->trigger( + 'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers] + ); + + // return the headers + return $this->placeholder->update_(implode(PHP_EOL, $headers)); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * + * @return array The header string to place in the header of the file + * @since 3.2.0 + */ + protected function getHeaders(string $context): array + { + if (isset($this->headers[$context])) + { + return $this->headers[$context]; + } + + // set the defaults + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\Language\Text;'; + + switch ($context) + { + case 'admin.component': + $headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'admin.helper': + case 'site.helper': + $headers[] = 'use Joomla\CMS\Access\Access;'; + $headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Language\Language;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\CMS\Object\CMSObject;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Version;'; + $headers[] = 'use Joomla\Database\DatabaseInterface;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.layout': + case 'site.layout': + case 'custom.admin.layout': + case 'override.layout': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + break; + + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'admin.view.controller': + $headers[] = 'use Joomla\CMS\Form\FormFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Application\CMSApplication;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\Input\Input;'; + case 'site.admin.view.controller': + $headers[] = 'use Joomla\CMS\Versioning\VersionableControllerTrait;'; + case 'site.view.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\FormController;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'site.admin.view.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Form\FormHelper;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + case 'site.view.html': + case 'site.views.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $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;"; + break; + + case 'custom.admin.view.html': + case 'custom.admin.views.html': + $target = 'Administrator'; + if ($this->config->get('build_target', 'admin') === 'site') + { + $target = 'Site'; + } + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $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;"; + break; + + case 'admin.view.model': + case 'site.admin.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Form;'; + $headers[] = 'use Joomla\CMS\Filter\InputFilter;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\UCM\UCMType;'; + $headers[] = 'use Joomla\CMS\Versioning\VersionableModelTrait;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\Input\Input;'; + break; + + case 'admin.views': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'admin.views.controller': + case 'custom.admin.views.controller': + case 'dashboard.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $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 'custom.admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $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;'; + break; + + case 'custom.admin.view.controller': + case 'import.controller': + case 'import.custom.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.model': + case 'site.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Input\Input;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + + break; + case 'import.custom.model': + case 'import.model': + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Filesystem\Folder;'; + $headers[] = 'use Joomla\CMS\Filesystem\Path;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\Installer\InstallerHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + break; + + case 'dashboard.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + break; + + case 'dashboard.view.html': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + 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': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Field\###FORM_EXTENDS###;'; + break; + + default: + break; + } + + $this->headers[$context] = $headers; + + return $headers; + } + + /** + * set Helper Dynamic Headers + * + * @param array $headers The headers array + * @param string $target_client + * + * @return void + * @since 3.2.0 + */ + protected function setHelperClassHeader(&$headers, $target_client) + { + // add only to admin client + if ('admin' === $target_client && $this->config->get('add_eximport', false)) + { + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; + } + } +} + diff --git a/src/95deb809-5f43-400b-939f-f9ceef720b13/code.power b/src/95deb809-5f43-400b-939f-f9ceef720b13/code.power new file mode 100644 index 0000000..c0a8142 --- /dev/null +++ b/src/95deb809-5f43-400b-939f-f9ceef720b13/code.power @@ -0,0 +1,545 @@ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The EventInterface Class. + * + * @var Event + * @since 3.2.0 + */ + protected Event $event; + + /** + * The Placeholder Class. + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The Language Class. + * + * @var Language + * @since 3.2.0 + */ + protected Language $language; + + /** + * The UikitComp Class. + * + * @var UikitComp + * @since 3.2.0 + */ + protected UikitComp $uikitcomp; + + /** + * The AdminFilterType Class. + * + * @var AdminFilterType + * @since 3.2.0 + */ + protected AdminFilterType $adminfiltertype; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The AccessSwitchList Class. + * + * @var AccessSwitchList + * @since 3.2.0 + */ + protected AccessSwitchList $accessswitchlist; + + /** + * The Filter Class. + * + * @var Filter + * @since 3.2.0 + */ + protected Filter $filter; + + /** + * The Tags Class. + * + * @var Tags + * @since 3.2.0 + */ + protected Tags $tags; + + /** + * The Header Context array + * + * @var array + * @since 3.2.0 + */ + protected array $headers = []; + + /** + * The Namespace Prefix + * + * @var string + * @since 3.2.0 + */ + protected string $NamespacePrefix; + + /** + * The Component Name (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentName; + + /** + * The Component Namespace (in code) + * + * @var string + * @since 3.2.0 + */ + protected string $ComponentNamespace; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Event $event The EventInterface Class. + * @param Placeholder $placeholder The Placeholder Class. + * @param Language $language The Language Class. + * @param UikitComp $uikitcomp The UikitComp Class. + * @param AdminFilterType $adminfiltertype The AdminFilterType Class. + * @param Category $category The Category Class. + * @param AccessSwitchList $accessswitchlist The AccessSwitchList Class. + * @param Filter $filter The Filter Class. + * @param Tags $tags The Tags Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Event $event, Placeholder $placeholder, + Language $language, UikitComp $uikitcomp, + AdminFilterType $adminfiltertype, Category $category, + AccessSwitchList $accessswitchlist, Filter $filter, + Tags $tags) + { + $this->config = $config; + $this->event = $event; + $this->placeholder = $placeholder; + $this->language = $language; + $this->uikitcomp = $uikitcomp; + $this->adminfiltertype = $adminfiltertype; + $this->category = $category; + $this->accessswitchlist = $accessswitchlist; + $this->filter = $filter; + $this->tags = $tags; + + // set some global values + $this->NamespacePrefix = $this->placeholder->get('NamespacePrefix'); + $this->ComponentName = $this->placeholder->get('Component'); + $this->ComponentNamespace = $this->placeholder->get('ComponentNamespace'); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * @param string $codeName The view, views, or layout code name + * + * @return string The header string to place in the header of the file + * @since 3.2.0 + */ + public function get(string $context, string $codeName): string + { + // 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) + { + case 'admin.helper': + case 'site.helper': + $this->setHelperClassHeader($headers, $codeName); + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'custom.admin.view.html': + case 'custom.admin.views.html': + case 'site.admin.view.html': + case 'site.view.html': + case 'site.views.html': + if ((2 == $this->config->uikit || 1 == $this->config->uikit) + && $this->uikitcomp->exists($codeName)) + { + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + } + break; + + 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': + case 'site.admin.view.model': + case 'custom.admin.view.model': + case 'site.view.model': + case 'admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Helper\TagsHelper;'; + break; + + default: + break; + } + + // Trigger Event: jcb_ce_setClassHeader + $this->event->trigger( + 'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers] + ); + + // return the headers + return $this->placeholder->update_(implode(PHP_EOL, $headers)); + } + + /** + * Get the headers for a file + * + * @param string $context The name of the context + * + * @return array The header string to place in the header of the file + * @since 3.2.0 + */ + protected function getHeaders(string $context): array + { + if (isset($this->headers[$context])) + { + return $this->headers[$context]; + } + + // set the defaults + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\Language\Text;'; + + switch ($context) + { + case 'admin.component': + $headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + break; + + case 'admin.helper': + case 'site.helper': + $headers[] = 'use Joomla\CMS\Access\Access;'; + $headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Language\Language;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\CMS\Object\CMSObject;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Version;'; + $headers[] = 'use Joomla\Database\DatabaseInterface;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'admin.layout': + case 'site.layout': + case 'custom.admin.layout': + case 'override.layout': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + break; + + case 'admin.view': + case 'custom.admin.view': + case 'custom.admin.views': + case 'site.admin.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'admin.view.controller': + $headers[] = 'use Joomla\CMS\Form\FormFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Application\CMSApplication;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\Input\Input;'; + case 'site.admin.view.controller': + $headers[] = 'use Joomla\CMS\Versioning\VersionableControllerTrait;'; + case 'site.view.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\FormController;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + break; + + case 'admin.view.html': + case 'admin.views.html': + case 'site.admin.view.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Form\FormHelper;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + case 'site.view.html': + case 'site.views.html': + $headers[] = 'use Joomla\CMS\Toolbar\Toolbar;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $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;"; + break; + + case 'custom.admin.view.html': + case 'custom.admin.views.html': + $target = 'Administrator'; + if ($this->config->get('build_target', 'admin') === 'site') + { + $target = 'Site'; + } + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\FileLayout;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $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;"; + break; + + case 'admin.view.model': + case 'site.admin.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Form;'; + $headers[] = 'use Joomla\CMS\Filter\InputFilter;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Table\Table;'; + $headers[] = 'use Joomla\CMS\UCM\UCMType;'; + $headers[] = 'use Joomla\CMS\Versioning\VersionableModelTrait;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Registry\Registry;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\Input\Input;'; + break; + + case 'admin.views': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Layout\LayoutHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + break; + + case 'admin.views.controller': + case 'custom.admin.views.controller': + case 'dashboard.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $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 'custom.admin.views.model': + case 'site.views.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $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;'; + break; + + case 'custom.admin.view.controller': + case 'import.controller': + case 'import.custom.controller': + $headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Session\Session;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + break; + + case 'custom.admin.view.model': + case 'site.view.model': + $headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;'; + $headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;'; + $headers[] = 'use Joomla\CMS\Plugin\PluginHelper;'; + $headers[] = 'use Joomla\CMS\Router\Route;'; + $headers[] = 'use Joomla\CMS\Uri\Uri;'; + $headers[] = 'use Joomla\CMS\User\User;'; + $headers[] = 'use Joomla\Input\Input;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + + break; + case 'import.custom.model': + case 'import.model': + $headers[] = 'use Joomla\CMS\Filesystem\File;'; + $headers[] = 'use Joomla\CMS\Filesystem\Folder;'; + $headers[] = 'use Joomla\CMS\Filesystem\Path;'; + $headers[] = 'use Joomla\CMS\Filter\OutputFilter;'; + $headers[] = 'use Joomla\CMS\Installer\InstallerHelper;'; + $headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;'; + $headers[] = 'use Joomla\String\StringHelper;'; + $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + break; + + case 'dashboard.view': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + break; + + case 'dashboard.view.html': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;'; + $headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;'; + $headers[] = 'use Joomla\CMS\Document\Document;'; + break; + + 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': + $headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;'; + $headers[] = 'use Joomla\CMS\Component\ComponentHelper;'; + $headers[] = 'use Joomla\CMS\Form\Field\###FORM_EXTENDS###;'; + break; + + default: + break; + } + + $this->headers[$context] = $headers; + + return $headers; + } + + /** + * set Helper Dynamic Headers + * + * @param array $headers The headers array + * @param string $target_client + * + * @return void + * @since 3.2.0 + */ + protected function setHelperClassHeader(&$headers, $target_client) + { + // add only to admin client + if ('admin' === $target_client && $this->config->get('add_eximport', false)) + { + $headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;'; + $headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;'; + } + } \ No newline at end of file diff --git a/src/95deb809-5f43-400b-939f-f9ceef720b13/settings.json b/src/95deb809-5f43-400b-939f-f9ceef720b13/settings.json new file mode 100644 index 0000000..595d50a --- /dev/null +++ b/src/95deb809-5f43-400b-939f-f9ceef720b13/settings.json @@ -0,0 +1,69 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "95deb809-5f43-400b-939f-f9ceef720b13", + "implements": [ + "3a777d70-52ad-49ec-9016-6f7438608613" + ], + "load_selection": null, + "name": "Header", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.J5.Header", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "Event" + }, + "use_selection2": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection3": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection4": { + "use": "54ec57f6-2fc3-42e5-975e-1fabeacb845d", + "as": "default" + }, + "use_selection5": { + "use": "9481caa2-6d04-4598-8320-543a93927243", + "as": "default" + }, + "use_selection6": { + "use": "007177eb-d39d-4093-8840-07a38811c502", + "as": "default" + }, + "use_selection7": { + "use": "81212121-ad5c-43c5-b046-f2650864f690", + "as": "default" + }, + "use_selection8": { + "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", + "as": "default" + }, + "use_selection9": { + "use": "8ca30d59-e56a-4cdd-bd8c-d9aad28f5903", + "as": "default" + }, + "use_selection11": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection12": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaFive.Header", + "description": "Build headers for all Joomla 5 files\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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/README.md b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/README.md new file mode 100644 index 0000000..dc08081 --- /dev/null +++ b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class DatabaseUninstall (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder** +> extends: **Registry** +```uml +@startuml +class DatabaseUninstall << (F,LightGreen) >> #RoyalBlue { + # bool $addAsArray +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.php b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.php new file mode 100644 index 0000000..5b4bab5 --- /dev/null +++ b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.php @@ -0,0 +1,42 @@ + + * @git 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\Abstraction\Registry\Traits\IsArray; +use VDM\Joomla\Interfaces\Registryinterface; +use VDM\Joomla\Abstraction\Registry; + + +/** + * Database Uninstall Builder Class + * + * @since 3.2.0 + */ +final class DatabaseUninstall extends Registry implements Registryinterface +{ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; +} + diff --git a/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.power b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.power new file mode 100644 index 0000000..c535c92 --- /dev/null +++ b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/code.power @@ -0,0 +1,14 @@ + /** + * Is an Array + * + * @since 3.2.0 + */ + use IsArray; + + /** + * Base switch to add values as string or array + * + * @var boolean + * @since 3.2.0 + **/ + protected bool $addAsArray = true; \ No newline at end of file diff --git a/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/settings.json b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/settings.json new file mode 100644 index 0000000..8b98088 --- /dev/null +++ b/src/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7", + "guid": "a7fc4913-6b1a-4eea-a168-fceb75fcf6ac", + "implements": [ + "64e291c2-11f1-423d-a44d-837cc12cc017" + ], + "load_selection": null, + "name": "DatabaseUninstall", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.DatabaseUninstall", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "c09e8968-c767-4175-bb3d-8432f206a2c7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.DatabaseUninstall", + "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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md index dad654e..f4d5e37 100644 --- a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md @@ -26,7 +26,7 @@ class Structure #Gold { # getXML(object $plugin) : string # pluginPath(object $plugin) : void # setMainClassFile(object $plugin) : void - # setMainXmlFile(mixed $plugin) : void + # setMainXmlFile(object $plugin) : void # setInstallScript(object $plugin) : void # setReadme(object $plugin) : void # setForms(object $plugin) : void diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php index f61ca6b..99e2bde 100644 --- a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php @@ -325,7 +325,7 @@ class Structure * @return void * @since 3.2.0 */ - protected function setMainXmlFile(mixed $plugin): void + protected function setMainXmlFile(object $plugin): void { $file_details = [ 'path' => $plugin->folder_path . '/' . $plugin->file_name . '.xml', diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power index 1b4d137..4dad4eb 100644 --- a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.power @@ -285,7 +285,7 @@ * @return void * @since 3.2.0 */ - protected function setMainXmlFile(mixed $plugin): void + protected function setMainXmlFile(object $plugin): void { $file_details = [ 'path' => $plugin->folder_path . '/' . $plugin->file_name . '.xml', diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php index 472c70c..e762fed 100644 --- a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php @@ -17,6 +17,7 @@ use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; @@ -117,6 +118,12 @@ final class Placeholder implements PlaceholderInterface $bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')]; $bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix; $bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')]; + $bucket[Placefix::_h('ComponentNamespace')] = NamespaceHelper::safeSegment(StringHelper::safe($config->component_code_name, 'F')); + $bucket[Placefix::_('ComponentNamespace')] = $bucket[Placefix::_h('ComponentNamespace')]; + $bucket[Placefix::_h('NamespacePrefix')] = $config->namespace_prefix; + $bucket[Placefix::_('NamespacePrefix')] = $config->namespace_prefix; + $bucket[Placefix::_h('NAMESPACEPREFIX')] = $config->namespace_prefix; + $bucket[Placefix::_('NAMESPACEPREFIX')] = $config->namespace_prefix; // get the current components overrides if (($_placeholders = GetHelper::var( @@ -130,7 +137,7 @@ final class Placeholder implements PlaceholderInterface { foreach ($_placeholders as $row) { - $bucket[$row['target']] = $row['value']; + $bucket[$row['target']] = str_replace(array_keys($bucket), array_values($bucket), $row['value']); } } } diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power index 65f69ac..8f88867 100644 --- a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.power @@ -85,6 +85,12 @@ $bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')]; $bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix; $bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')]; + $bucket[Placefix::_h('ComponentNamespace')] = NamespaceHelper::safeSegment(StringHelper::safe($config->component_code_name, 'F')); + $bucket[Placefix::_('ComponentNamespace')] = $bucket[Placefix::_h('ComponentNamespace')]; + $bucket[Placefix::_h('NamespacePrefix')] = $config->namespace_prefix; + $bucket[Placefix::_('NamespacePrefix')] = $config->namespace_prefix; + $bucket[Placefix::_h('NAMESPACEPREFIX')] = $config->namespace_prefix; + $bucket[Placefix::_('NAMESPACEPREFIX')] = $config->namespace_prefix; // get the current components overrides if (($_placeholders = GetHelper::var( @@ -98,7 +104,7 @@ { foreach ($_placeholders as $row) { - $bucket[$row['target']] = $row['value']; + $bucket[$row['target']] = str_replace(array_keys($bucket), array_values($bucket), $row['value']); } } } diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json index dd4fcb9..16654f8 100644 --- a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json @@ -29,14 +29,18 @@ "as": "default" }, "use_selection4": { + "use": "ce8cf834-6bac-44fb-941c-861f7e046cc0", + "as": "default" + }, + "use_selection5": { "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", "as": "Compiler" }, - "use_selection5": { + "use_selection6": { "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", "as": "default" }, - "use_selection6": { + "use_selection7": { "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", "as": "default" } diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md b/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md index b103117..8a5e580 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md @@ -16,6 +16,7 @@ class Event #Gold { + getEvent(Container $container) : EventInterface + getJ3Event(Container $container) : J3Event + getJ4Event(Container $container) : J4Event + + getJ5Event(Container $container) : J5Event } note right of Event::register @@ -45,6 +46,13 @@ note right of Event::getJ4Event since: 3.2.0 return: J4Event end note + +note right of Event::getJ5Event + Get the Joomla 5 Event + + since: 3.2.0 + return: J5Event +end note @enduml ``` diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php index 156a293..bc0c7ed 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php @@ -18,6 +18,7 @@ use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Event as J4Event; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\Event as J5Event; /** @@ -51,6 +52,9 @@ class Event implements ServiceProviderInterface $container->alias(J4Event::class, 'J4.Event') ->share('J4.Event', [$this, 'getJ4Event'], true); + $container->alias(J5Event::class, 'J5.Event') + ->share('J5.Event', [$this, 'getJ5Event'], true); + $container->alias(EventInterface::class, 'Event') ->share('Event', [$this, 'getEvent'], true); } @@ -97,6 +101,19 @@ class Event implements ServiceProviderInterface public function getJ4Event(Container $container): J4Event { return new J4Event(); + } + + /** + * Get the Joomla 5 Event + * + * @param Container $container The DI container. + * + * @return J5Event + * @since 3.2.0 + */ + public function getJ5Event(Container $container): J5Event + { + return new J5Event(); } } diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power index 7b78129..3523d55 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.power @@ -22,6 +22,9 @@ $container->alias(J4Event::class, 'J4.Event') ->share('J4.Event', [$this, 'getJ4Event'], true); + $container->alias(J5Event::class, 'J5.Event') + ->share('J5.Event', [$this, 'getJ5Event'], true); + $container->alias(EventInterface::class, 'Event') ->share('Event', [$this, 'getEvent'], true); } @@ -68,4 +71,17 @@ public function getJ4Event(Container $container): J4Event { return new J4Event(); + } + + /** + * Get the Joomla 5 Event + * + * @param Container $container The DI container. + * + * @return J5Event + * @since 3.2.0 + */ + public function getJ5Event(Container $container): J5Event + { + return new J5Event(); } \ No newline at end of file diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json b/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json index ae10668..85cf19b 100644 --- a/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json @@ -23,6 +23,10 @@ "use_selection2": { "use": "4729c2b0-f12b-4397-8d77-055d38bca98b", "as": "J4Event" + }, + "use_selection3": { + "use": "77224dc6-8024-47eb-896e-18ec3aa23420", + "as": "J5Event" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Event", diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md index f3d83ab..fa18b45 100644 --- a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/README.md @@ -14,9 +14,11 @@ class ArchitectureModel #Gold { # $targetVersion + register(Container $container) : void + getModelCanDelete(Container $container) : CanDeleteInterface + + getJ5ModelCanDelete(Container $container) : J5ModelCanDelete + getJ4ModelCanDelete(Container $container) : J4ModelCanDelete + getJ3ModelCanDelete(Container $container) : J3ModelCanDelete + getModelCanEditState(Container $container) : CanEditStateInterface + + getJ5ModelCanEditState(Container $container) : J5ModelCanEditState + getJ4ModelCanEditState(Container $container) : J4ModelCanEditState + getJ3ModelCanEditState(Container $container) : J3ModelCanEditState } @@ -28,14 +30,21 @@ note right of ArchitectureModel::register return: void end note -note right of ArchitectureModel::getModelCanDelete +note left of ArchitectureModel::getModelCanDelete Get The Model CanDelete Class. since: 3.2.0 return: CanDeleteInterface end note -note right of ArchitectureModel::getJ4ModelCanDelete +note right of ArchitectureModel::getJ5ModelCanDelete + Get The Model CanDelete Class. + + since: 3.2.0 + return: J5ModelCanDelete +end note + +note left of ArchitectureModel::getJ4ModelCanDelete Get The Model CanDelete Class. since: 3.2.0 @@ -49,14 +58,21 @@ note right of ArchitectureModel::getJ3ModelCanDelete return: J3ModelCanDelete end note -note right of ArchitectureModel::getModelCanEditState +note left of ArchitectureModel::getModelCanEditState Get The Model Can Edit State Class. since: 3.2.0 return: CanEditStateInterface end note -note right of ArchitectureModel::getJ4ModelCanEditState +note right of ArchitectureModel::getJ5ModelCanEditState + Get The Model Can Edit State Class. + + since: 3.2.0 + return: J5ModelCanEditState +end note + +note left of ArchitectureModel::getJ4ModelCanEditState Get The Model Can Edit State Class. since: 3.2.0 diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php index 5e87d15..b3e6b76 100644 --- a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.php @@ -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\Model\CanDeleteInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model\CanDelete as J5ModelCanDelete; use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanDelete as J4ModelCanDelete; use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanDelete as J3ModelCanDelete; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model\CanEditState as J5ModelCanEditState; use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanEditState as J4ModelCanEditState; use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanEditState as J3ModelCanEditState; @@ -53,6 +55,9 @@ class ArchitectureModel implements ServiceProviderInterface $container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete') ->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true); + $container->alias(J5ModelCanDelete::class, 'Architecture.Model.J5.CanDelete') + ->share('Architecture.Model.J5.CanDelete', [$this, 'getJ5ModelCanDelete'], true); + $container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete') ->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true); @@ -62,6 +67,9 @@ class ArchitectureModel implements ServiceProviderInterface $container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState') ->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true); + $container->alias(J5ModelCanEditState::class, 'Architecture.Model.J5.CanEditState') + ->share('Architecture.Model.J5.CanEditState', [$this, 'getJ5ModelCanEditState'], true); + $container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState') ->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true); } @@ -84,6 +92,22 @@ class ArchitectureModel implements ServiceProviderInterface return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete'); } + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J5ModelCanDelete + * @since 3.2.0 + */ + public function getJ5ModelCanDelete(Container $container): J5ModelCanDelete + { + return new J5ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + /** * Get The Model CanDelete Class. * @@ -134,6 +158,22 @@ class ArchitectureModel implements ServiceProviderInterface return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState'); } + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J5ModelCanEditState + * @since 3.2.0 + */ + public function getJ5ModelCanEditState(Container $container): J5ModelCanEditState + { + return new J5ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + /** * Get The Model Can Edit State Class. * diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power index 458d245..aa1ff9f 100644 --- a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/code.power @@ -22,6 +22,9 @@ $container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete') ->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true); + $container->alias(J5ModelCanDelete::class, 'Architecture.Model.J5.CanDelete') + ->share('Architecture.Model.J5.CanDelete', [$this, 'getJ5ModelCanDelete'], true); + $container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete') ->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true); @@ -31,6 +34,9 @@ $container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState') ->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true); + $container->alias(J5ModelCanEditState::class, 'Architecture.Model.J5.CanEditState') + ->share('Architecture.Model.J5.CanEditState', [$this, 'getJ5ModelCanEditState'], true); + $container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState') ->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true); } @@ -53,6 +59,22 @@ return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete'); } + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J5ModelCanDelete + * @since 3.2.0 + */ + public function getJ5ModelCanDelete(Container $container): J5ModelCanDelete + { + return new J5ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + /** * Get The Model CanDelete Class. * @@ -103,6 +125,22 @@ return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState'); } + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J5ModelCanEditState + * @since 3.2.0 + */ + public function getJ5ModelCanEditState(Container $container): J5ModelCanEditState + { + return new J5ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + /** * Get The Model Can Edit State Class. * diff --git a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json index df5aec9..725a1be 100644 --- a/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json +++ b/src/bbd36fbf-d905-47e8-8e67-9ea6ec734712/settings.json @@ -16,6 +16,10 @@ "use": "e00a7d1d-6d80-41c5-bf13-32d41bc5bf91", "as": "default" }, + "use_selection6": { + "use": "34df20ec-67db-4e7e-be61-fb94d360c408", + "as": "J5ModelCanDelete" + }, "use_selection1": { "use": "2a69a8ab-cea0-4c75-92d5-9495cb740e0f", "as": "J4ModelCanDelete" @@ -28,6 +32,10 @@ "use": "600515b1-493f-4448-96fe-018e54e087c8", "as": "default" }, + "use_selection7": { + "use": "318a98a3-bb6f-42cb-a000-352d4c848b51", + "as": "J5ModelCanEditState" + }, "use_selection4": { "use": "cb2a82a5-aa49-4d46-b765-9b3feb118208", "as": "J4ModelCanEditState" diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md index 272a4ce..1ccf9ce 100644 --- a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class CoreField (Details) +# final class CoreField (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour** ```uml @startuml -class CoreField #Gold { +class CoreField << (F,LightGreen) >> #RoyalBlue { # array $fields # array $paths + __construct() diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php index f0b3803..529142d 100644 --- a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/code.php @@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface; * * @since 3.2.0 */ -class CoreField implements CoreFieldInterface +final class CoreField implements CoreFieldInterface { /** * Local Core Joomla Fields diff --git a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json index 2e363fb..aa0fd6b 100644 --- a/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json +++ b/src/c6818275-cdf7-4fce-a365-90d95a77a71c/settings.json @@ -10,7 +10,7 @@ "name": "CoreField", "power_version": "1.0.0", "system_name": "JCB.Compiler.Field.J4.CoreField", - "type": "class", + "type": "final class", "use_selection": { "use_selection0": { "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md index 91725dd..a88703c 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md @@ -26,10 +26,13 @@ class Field #Gold { + getDatabaseName(Container $container) : DatabaseName + getJ3CoreRule(Container $container) : J3CoreRule + getJ4CoreRule(Container $container) : J4CoreRule + + getJ5CoreRule(Container $container) : J5CoreRule + getJ3CoreField(Container $container) : J3CoreField + getJ4CoreField(Container $container) : J4CoreField + + getJ5CoreField(Container $container) : J5CoreField + getJ3InputButton(Container $container) : J3InputButton + getJ4InputButton(Container $container) : J4InputButton + + getJ5InputButton(Container $container) : J5InputButton + getCoreField(Container $container) : CoreField + getCoreRule(Container $container) : CoreRule + getInputButton(Container $container) : InputButton @@ -126,20 +129,34 @@ note right of Field::getJ4CoreRule return: J4CoreRule end note -note left of Field::getJ3CoreField +note left of Field::getJ5CoreRule + Get The CoreRule Class. + + since: 3.2.0 + return: J5CoreRule +end note + +note right of Field::getJ3CoreField Get The CoreField Class. since: 3.2.0 return: J3CoreField end note -note right of Field::getJ4CoreField +note left of Field::getJ4CoreField Get The CoreField Class. since: 3.2.0 return: J4CoreField end note +note right of Field::getJ5CoreField + Get The CoreField Class. + + since: 3.2.0 + return: J5CoreField +end note + note left of Field::getJ3InputButton Get The J3InputButton Class. @@ -154,21 +171,28 @@ note right of Field::getJ4InputButton return: J4InputButton end note -note left of Field::getCoreField +note left of Field::getJ5InputButton + Get The J5InputButton Class. + + since: 3.2.0 + return: J5InputButton +end note + +note right of Field::getCoreField Get The CoreFieldInterface Class. since: 3.2.0 return: CoreField end note -note right of Field::getCoreRule +note left of Field::getCoreRule Get The CoreRuleInterface Class. since: 3.2.0 return: CoreRule end note -note left of Field::getInputButton +note right of Field::getInputButton Get The InputButton Class. since: 3.2.0 diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php index b2b8a79..01292db 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php @@ -27,10 +27,13 @@ use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode; use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName; use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreRule as J3CoreRule; use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreRule as J4CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\CoreRule as J5CoreRule; use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreField as J3CoreField; use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreField as J4CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\CoreField as J5CoreField; use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\InputButton as J3InputButton; use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\InputButton as J4InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\InputButton as J5InputButton; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton; @@ -105,18 +108,27 @@ class Field implements ServiceProviderInterface $container->alias(J4CoreRule::class, 'J4.Field.Core.Rule') ->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true); + $container->alias(J5CoreRule::class, 'J5.Field.Core.Rule') + ->share('J5.Field.Core.Rule', [$this, 'getJ5CoreRule'], true); + $container->alias(J3CoreField::class, 'J3.Field.Core.Field') ->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true); $container->alias(J4CoreField::class, 'J4.Field.Core.Field') ->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true); + $container->alias(J5CoreField::class, 'J5.Field.Core.Field') + ->share('J5.Field.Core.Field', [$this, 'getJ5CoreField'], true); + $container->alias(J3InputButton::class, 'J3.Field.Input.Button') ->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true); $container->alias(J4InputButton::class, 'J4.Field.Input.Button') ->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true); + $container->alias(J5InputButton::class, 'J5.Field.Input.Button') + ->share('J5.Field.Input.Button', [$this, 'getJ5InputButton'], true); + $container->alias(CoreField::class, 'Field.Core.Field') ->share('Field.Core.Field', [$this, 'getCoreField'], true); @@ -322,6 +334,19 @@ class Field implements ServiceProviderInterface return new J4CoreRule(); } + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J5CoreRule + * @since 3.2.0 + */ + public function getJ5CoreRule(Container $container): J5CoreRule + { + return new J5CoreRule(); + } + /** * Get The CoreField Class. * @@ -348,6 +373,19 @@ class Field implements ServiceProviderInterface return new J4CoreField(); } + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J5CoreField + * @since 3.2.0 + */ + public function getJ5CoreField(Container $container): J5CoreField + { + return new J5CoreField(); + } + /** * Get The J3InputButton Class. * @@ -382,6 +420,23 @@ class Field implements ServiceProviderInterface ); } + /** + * Get The J5InputButton Class. + * + * @param Container $container The DI container. + * + * @return J5InputButton + * @since 3.2.0 + */ + public function getJ5InputButton(Container $container): J5InputButton + { + return new J5InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + /** * Get The CoreFieldInterface Class. * diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power index fc99e07..980d07c 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.power @@ -60,18 +60,27 @@ $container->alias(J4CoreRule::class, 'J4.Field.Core.Rule') ->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true); + $container->alias(J5CoreRule::class, 'J5.Field.Core.Rule') + ->share('J5.Field.Core.Rule', [$this, 'getJ5CoreRule'], true); + $container->alias(J3CoreField::class, 'J3.Field.Core.Field') ->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true); $container->alias(J4CoreField::class, 'J4.Field.Core.Field') ->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true); + $container->alias(J5CoreField::class, 'J5.Field.Core.Field') + ->share('J5.Field.Core.Field', [$this, 'getJ5CoreField'], true); + $container->alias(J3InputButton::class, 'J3.Field.Input.Button') ->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true); $container->alias(J4InputButton::class, 'J4.Field.Input.Button') ->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true); + $container->alias(J5InputButton::class, 'J5.Field.Input.Button') + ->share('J5.Field.Input.Button', [$this, 'getJ5InputButton'], true); + $container->alias(CoreField::class, 'Field.Core.Field') ->share('Field.Core.Field', [$this, 'getCoreField'], true); @@ -277,6 +286,19 @@ return new J4CoreRule(); } + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J5CoreRule + * @since 3.2.0 + */ + public function getJ5CoreRule(Container $container): J5CoreRule + { + return new J5CoreRule(); + } + /** * Get The CoreField Class. * @@ -303,6 +325,19 @@ return new J4CoreField(); } + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J5CoreField + * @since 3.2.0 + */ + public function getJ5CoreField(Container $container): J5CoreField + { + return new J5CoreField(); + } + /** * Get The J3InputButton Class. * @@ -337,6 +372,23 @@ ); } + /** + * Get The J5InputButton Class. + * + * @param Container $container The DI container. + * + * @return J5InputButton + * @since 3.2.0 + */ + public function getJ5InputButton(Container $container): J5InputButton + { + return new J5InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + /** * Get The CoreFieldInterface Class. * diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json index 28dc582..4efb258 100644 --- a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json @@ -60,6 +60,10 @@ "use": "43f46bb2-ab6d-47c7-9fd9-f1745a3576fb", "as": "J4CoreRule" }, + "use_selection19": { + "use": "8b56b62d-b960-4823-b9bb-c71675a71b85", + "as": "J5CoreRule" + }, "use_selection12": { "use": "e6683873-b74e-4b54-8466-69f8a9282033", "as": "J3CoreField" @@ -68,6 +72,10 @@ "use": "c6818275-cdf7-4fce-a365-90d95a77a71c", "as": "J4CoreField" }, + "use_selection20": { + "use": "4c143764-1b84-4b9f-86c5-8de119b26f1a", + "as": "J5CoreField" + }, "use_selection14": { "use": "2bc33733-e900-4a9c-8cb3-c537aa9db785", "as": "J3InputButton" @@ -76,6 +84,10 @@ "use": "1b8a40e9-7847-4341-8a8e-dfdc2d531bbe", "as": "J4InputButton" }, + "use_selection21": { + "use": "163fa7ca-21bd-4e7f-a618-26fe10b870fe", + "as": "J5InputButton" + }, "use_selection16": { "use": "e2f5fddf-cbc8-44ee-836c-7f3fb08d8900", "as": "CoreField" diff --git a/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/README.md b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/README.md new file mode 100644 index 0000000..e22a51f --- /dev/null +++ b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/README.md @@ -0,0 +1,429 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class BuilderAJ (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class BuilderAJ #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 + + getDatabaseUninstall(Container $container) : DatabaseUninstall + + 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 +} + +note right of BuilderAJ::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of BuilderAJ::getAccessSwitch + Get The AccessSwitch Class. + + since: 3.2.0 + return: AccessSwitch +end note + +note right of BuilderAJ::getAccessSwitchList + Get The AccessSwitchList Class. + + since: 3.2.0 + return: AccessSwitchList +end note + +note left of BuilderAJ::getAssetsRules + Get The AssetsRules Class. + + since: 3.2.0 + return: AssetsRules +end note + +note right of BuilderAJ::getAdminFilterType + Get The AdminFilterType Class. + + since: 3.2.0 + return: AdminFilterType +end note + +note left of BuilderAJ::getAlias + Get The Alias Class. + + since: 3.2.0 + return: Alias +end note + +note right of BuilderAJ::getBaseSixFour + Get The BaseSixFour Class. + + since: 3.2.0 + return: BaseSixFour +end note + +note left of BuilderAJ::getCategory + Get The Category Class. + + since: 3.2.0 + return: Category +end note + +note right of BuilderAJ::getCategoryCode + Get The CategoryCode Class. + + since: 3.2.0 + return: CategoryCode +end note + +note left of BuilderAJ::getCategoryOtherName + Get The CategoryOtherName Class. + + since: 3.2.0 + return: CategoryOtherName +end note + +note right of BuilderAJ::getCheckBox + Get The CheckBox Class. + + since: 3.2.0 + return: CheckBox +end note + +note left of BuilderAJ::getComponentFields + Get The ComponentFields Class. + + since: 3.2.0 + return: ComponentFields +end note + +note right of BuilderAJ::getConfigFieldsets + Get The ConfigFieldsets Class. + + since: 3.2.0 + return: ConfigFieldsets +end note + +note left of BuilderAJ::getConfigFieldsetsCustomfield + Get The ConfigFieldsetsCustomfield Class. + + since: 3.2.0 + return: ConfigFieldsetsCustomfield +end note + +note right of BuilderAJ::getContentMulti + Get The ContentMulti Class. + + since: 3.2.0 + return: ContentMulti +end note + +note left of BuilderAJ::getContentOne + Get The ContentOne Class. + + since: 3.2.0 + return: ContentOne +end note + +note right of BuilderAJ::getContributors + Get The Contributors Class. + + since: 3.2.0 + return: Contributors +end note + +note left of BuilderAJ::getCustomAlias + Get The CustomAlias Class. + + since: 3.2.0 + return: CustomAlias +end note + +note right of BuilderAJ::getCustomField + Get The CustomField Class. + + since: 3.2.0 + return: CustomField +end note + +note left of BuilderAJ::getCustomFieldLinks + Get The CustomFieldLinks Class. + + since: 3.2.0 + return: CustomFieldLinks +end note + +note right of BuilderAJ::getCustomList + Get The CustomList Class. + + since: 3.2.0 + return: CustomList +end note + +note left of BuilderAJ::getCustomTabs + Get The CustomTabs Class. + + since: 3.2.0 + return: CustomTabs +end note + +note right of BuilderAJ::getDatabaseKeys + Get The DatabaseKeys Class. + + since: 3.2.0 + return: DatabaseKeys +end note + +note left of BuilderAJ::getDatabaseTables + Get The DatabaseTables Class. + + since: 3.2.0 + return: DatabaseTables +end note + +note right of BuilderAJ::getDatabaseUniqueGuid + Get The DatabaseUniqueGuid Class. + + since: 3.2.0 + return: DatabaseUniqueGuid +end note + +note left of BuilderAJ::getDatabaseUniqueKeys + Get The DatabaseUniqueKeys Class. + + since: 3.2.0 + return: DatabaseUniqueKeys +end note + +note right of BuilderAJ::getDatabaseUninstall + Get The DatabaseUninstall Class. + + since: 3.2.0 + return: DatabaseUninstall +end note + +note left of BuilderAJ::getDoNotEscape + Get The DoNotEscape Class. + + since: 3.2.0 + return: DoNotEscape +end note + +note right of BuilderAJ::getDynamicFields + Get The DynamicFields Class. + + since: 3.2.0 + return: DynamicFields +end note + +note left of BuilderAJ::getExtensionCustomFields + Get The ExtensionCustomFields Class. + + since: 3.2.0 + return: ExtensionCustomFields +end note + +note right of BuilderAJ::getExtensionsParams + Get The ExtensionsParams Class. + + since: 3.2.0 + return: ExtensionsParams +end note + +note left of BuilderAJ::getFieldGroupControl + Get The FieldGroupControl Class. + + since: 3.2.0 + return: FieldGroupControl +end note + +note right of BuilderAJ::getFieldNames + Get The FieldNames Class. + + since: 3.2.0 + return: FieldNames +end note + +note left of BuilderAJ::getFieldRelations + Get The FieldRelations Class. + + since: 3.2.0 + return: FieldRelations +end note + +note right of BuilderAJ::getFilter + Get The Filter Class. + + since: 3.2.0 + return: Filter +end note + +note left of BuilderAJ::getFootableScripts + Get The FootableScripts Class. + + since: 3.2.0 + return: FootableScripts +end note + +note right of BuilderAJ::getFrontendParams + Get The FrontendParams Class. + + since: 3.2.0 + return: FrontendParams +end note + +note left of BuilderAJ::getGetAsLookup + Get The GetAsLookup Class. + + since: 3.2.0 + return: GetAsLookup +end note + +note right of BuilderAJ::getGetModule + Get The GetModule Class. + + since: 3.2.0 + return: GetModule +end note + +note left of BuilderAJ::getGoogleChart + Get The GoogleChart Class. + + since: 3.2.0 + return: GoogleChart +end note + +note right of BuilderAJ::getHasMenuGlobal + Get The HasMenuGlobal Class. + + since: 3.2.0 + return: HasMenuGlobal +end note + +note left of BuilderAJ::getHasPermissions + Get The HasPermissions Class. + + since: 3.2.0 + return: HasPermissions +end note + +note right of BuilderAJ::getHiddenFields + Get The HiddenFields Class. + + since: 3.2.0 + return: HiddenFields +end note + +note left of BuilderAJ::getHistory + Get The History Class. + + since: 3.2.0 + return: History +end note + +note right of BuilderAJ::getIntegerFields + Get The IntegerFields Class. + + since: 3.2.0 + return: IntegerFields +end note + +note left of BuilderAJ::getItemsMethodEximportString + Get The ItemsMethodEximportString Class. + + since: 3.2.0 + return: ItemsMethodEximportString +end note + +note right of BuilderAJ::getItemsMethodListString + Get The ItemsMethodListString Class. + + since: 3.2.0 + return: ItemsMethodListString +end note + +note left of BuilderAJ::getJsonItem + Get The JsonItem Class. + + since: 3.2.0 + return: JsonItem +end note + +note right of BuilderAJ::getJsonItemArray + Get The JsonItemArray Class. + + since: 3.2.0 + return: JsonItemArray +end note + +note left of BuilderAJ::getJsonString + Get The JsonString Class. + + since: 3.2.0 + return: JsonString +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.php b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.php new file mode 100644 index 0000000..61eae65 --- /dev/null +++ b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.php @@ -0,0 +1,870 @@ + + * @git 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\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitch; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; +use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseKeys; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseTables; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueGuid; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUninstall; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FrontendParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasMenuGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\History; +use VDM\Joomla\Componentbuilder\Compiler\Builder\IntegerFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodEximportString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; + + +/** + * Builder A-J Service Provider + * + * @since 3.2.0 + */ +class BuilderAJ implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') + ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); + + $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') + ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); + + $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') + ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); + + $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') + ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); + + $container->alias(Alias::class, 'Compiler.Builder.Alias') + ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); + + $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') + ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); + + $container->alias(Category::class, 'Compiler.Builder.Category') + ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); + + $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') + ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); + + $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') + ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); + + $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') + ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); + + $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') + ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') + ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') + ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') + ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); + + $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') + ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); + + $container->alias(Contributors::class, 'Compiler.Builder.Contributors') + ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); + + $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') + ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); + + $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') + ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); + + $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') + ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); + + $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') + ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); + + $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') + ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); + + $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') + ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); + + $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') + ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); + + $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') + ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); + + $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') + ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); + + $container->alias(DatabaseUninstall::class, 'Compiler.Builder.Database.Uninstall') + ->share('Compiler.Builder.Database.Uninstall', [$this, 'getDatabaseUninstall'], true); + + $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') + ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); + + $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') + ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); + + $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') + ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); + + $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') + ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); + + $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') + ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); + + $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') + ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); + + $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') + ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); + + $container->alias(Filter::class, 'Compiler.Builder.Filter') + ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); + + $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') + ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); + + $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') + ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); + + $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') + ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); + + $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') + ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); + + $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') + ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); + + $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') + ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); + + $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') + ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); + + $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') + ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); + + $container->alias(History::class, 'Compiler.Builder.History') + ->share('Compiler.Builder.History', [$this, 'getHistory'], true); + + $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') + ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); + + $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') + ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); + + $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') + ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); + + $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') + ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); + + $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') + ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); + + $container->alias(JsonString::class, 'Compiler.Builder.Json.String') + ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + } + + /** + * Get The AccessSwitch Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitch + * @since 3.2.0 + */ + public function getAccessSwitch(Container $container): AccessSwitch + { + return new AccessSwitch(); + } + + /** + * Get The AccessSwitchList Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitchList + * @since 3.2.0 + */ + public function getAccessSwitchList(Container $container): AccessSwitchList + { + return new AccessSwitchList(); + } + + /** + * Get The AssetsRules Class. + * + * @param Container $container The DI container. + * + * @return AssetsRules + * @since 3.2.0 + */ + public function getAssetsRules(Container $container): AssetsRules + { + return new AssetsRules(); + } + + /** + * Get The AdminFilterType Class. + * + * @param Container $container The DI container. + * + * @return AdminFilterType + * @since 3.2.0 + */ + public function getAdminFilterType(Container $container): AdminFilterType + { + return new AdminFilterType(); + } + + /** + * Get The Alias Class. + * + * @param Container $container The DI container. + * + * @return Alias + * @since 3.2.0 + */ + public function getAlias(Container $container): Alias + { + return new Alias(); + } + + /** + * Get The BaseSixFour Class. + * + * @param Container $container The DI container. + * + * @return BaseSixFour + * @since 3.2.0 + */ + public function getBaseSixFour(Container $container): BaseSixFour + { + return new BaseSixFour(); + } + + /** + * Get The Category Class. + * + * @param Container $container The DI container. + * + * @return Category + * @since 3.2.0 + */ + public function getCategory(Container $container): Category + { + return new Category(); + } + + /** + * Get The CategoryCode Class. + * + * @param Container $container The DI container. + * + * @return CategoryCode + * @since 3.2.0 + */ + public function getCategoryCode(Container $container): CategoryCode + { + return new CategoryCode(); + } + + /** + * Get The CategoryOtherName Class. + * + * @param Container $container The DI container. + * + * @return CategoryOtherName + * @since 3.2.0 + */ + public function getCategoryOtherName(Container $container): CategoryOtherName + { + return new CategoryOtherName(); + } + + /** + * Get The CheckBox Class. + * + * @param Container $container The DI container. + * + * @return CheckBox + * @since 3.2.0 + */ + public function getCheckBox(Container $container): CheckBox + { + return new CheckBox(); + } + + /** + * Get The ComponentFields Class. + * + * @param Container $container The DI container. + * + * @return ComponentFields + * @since 3.2.0 + */ + public function getComponentFields(Container $container): ComponentFields + { + return new ComponentFields(); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets(); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield(); + } + + /** + * Get The ContentMulti Class. + * + * @param Container $container The DI container. + * + * @return ContentMulti + * @since 3.2.0 + */ + public function getContentMulti(Container $container): ContentMulti + { + return new ContentMulti(); + } + + /** + * Get The ContentOne Class. + * + * @param Container $container The DI container. + * + * @return ContentOne + * @since 3.2.0 + */ + public function getContentOne(Container $container): ContentOne + { + return new ContentOne(); + } + + /** + * Get The Contributors Class. + * + * @param Container $container The DI container. + * + * @return Contributors + * @since 3.2.0 + */ + public function getContributors(Container $container): Contributors + { + return new Contributors(); + } + + /** + * Get The CustomAlias Class. + * + * @param Container $container The DI container. + * + * @return CustomAlias + * @since 3.2.0 + */ + public function getCustomAlias(Container $container): CustomAlias + { + return new CustomAlias(); + } + + /** + * Get The CustomField Class. + * + * @param Container $container The DI container. + * + * @return CustomField + * @since 3.2.0 + */ + public function getCustomField(Container $container): CustomField + { + return new CustomField(); + } + + /** + * Get The CustomFieldLinks Class. + * + * @param Container $container The DI container. + * + * @return CustomFieldLinks + * @since 3.2.0 + */ + public function getCustomFieldLinks(Container $container): CustomFieldLinks + { + return new CustomFieldLinks(); + } + + /** + * Get The CustomList Class. + * + * @param Container $container The DI container. + * + * @return CustomList + * @since 3.2.0 + */ + public function getCustomList(Container $container): CustomList + { + return new CustomList(); + } + + /** + * Get The CustomTabs Class. + * + * @param Container $container The DI container. + * + * @return CustomTabs + * @since 3.2.0 + */ + public function getCustomTabs(Container $container): CustomTabs + { + return new CustomTabs(); + } + + /** + * Get The DatabaseKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseKeys + * @since 3.2.0 + */ + public function getDatabaseKeys(Container $container): DatabaseKeys + { + return new DatabaseKeys(); + } + + /** + * Get The DatabaseTables Class. + * + * @param Container $container The DI container. + * + * @return DatabaseTables + * @since 3.2.0 + */ + public function getDatabaseTables(Container $container): DatabaseTables + { + return new DatabaseTables(); + } + + /** + * Get The DatabaseUniqueGuid Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueGuid + * @since 3.2.0 + */ + public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid + { + return new DatabaseUniqueGuid(); + } + + /** + * Get The DatabaseUniqueKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueKeys + * @since 3.2.0 + */ + public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys + { + return new DatabaseUniqueKeys(); + } + + /** + * Get The DatabaseUninstall Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUninstall + * @since 3.2.0 + */ + public function getDatabaseUninstall(Container $container): DatabaseUninstall + { + return new DatabaseUninstall(); + } + + /** + * Get The DoNotEscape Class. + * + * @param Container $container The DI container. + * + * @return DoNotEscape + * @since 3.2.0 + */ + public function getDoNotEscape(Container $container): DoNotEscape + { + return new DoNotEscape(); + } + + /** + * Get The DynamicFields Class. + * + * @param Container $container The DI container. + * + * @return DynamicFields + * @since 3.2.0 + */ + public function getDynamicFields(Container $container): DynamicFields + { + return new DynamicFields(); + } + + /** + * Get The ExtensionCustomFields Class. + * + * @param Container $container The DI container. + * + * @return ExtensionCustomFields + * @since 3.2.0 + */ + public function getExtensionCustomFields(Container $container): ExtensionCustomFields + { + return new ExtensionCustomFields(); + } + + /** + * Get The ExtensionsParams Class. + * + * @param Container $container The DI container. + * + * @return ExtensionsParams + * @since 3.2.0 + */ + public function getExtensionsParams(Container $container): ExtensionsParams + { + return new ExtensionsParams(); + } + + /** + * Get The FieldGroupControl Class. + * + * @param Container $container The DI container. + * + * @return FieldGroupControl + * @since 3.2.0 + */ + public function getFieldGroupControl(Container $container): FieldGroupControl + { + return new FieldGroupControl(); + } + + /** + * Get The FieldNames Class. + * + * @param Container $container The DI container. + * + * @return FieldNames + * @since 3.2.0 + */ + public function getFieldNames(Container $container): FieldNames + { + return new FieldNames(); + } + + /** + * Get The FieldRelations Class. + * + * @param Container $container The DI container. + * + * @return FieldRelations + * @since 3.2.0 + */ + public function getFieldRelations(Container $container): FieldRelations + { + return new FieldRelations(); + } + + /** + * Get The Filter Class. + * + * @param Container $container The DI container. + * + * @return Filter + * @since 3.2.0 + */ + public function getFilter(Container $container): Filter + { + return new Filter(); + } + + /** + * Get The FootableScripts Class. + * + * @param Container $container The DI container. + * + * @return FootableScripts + * @since 3.2.0 + */ + public function getFootableScripts(Container $container): FootableScripts + { + return new FootableScripts(); + } + + /** + * Get The FrontendParams Class. + * + * @param Container $container The DI container. + * + * @return FrontendParams + * @since 3.2.0 + */ + public function getFrontendParams(Container $container): FrontendParams + { + return new FrontendParams(); + } + + /** + * Get The GetAsLookup Class. + * + * @param Container $container The DI container. + * + * @return GetAsLookup + * @since 3.2.0 + */ + public function getGetAsLookup(Container $container): GetAsLookup + { + return new GetAsLookup(); + } + + /** + * Get The GetModule Class. + * + * @param Container $container The DI container. + * + * @return GetModule + * @since 3.2.0 + */ + public function getGetModule(Container $container): GetModule + { + return new GetModule(); + } + + /** + * Get The GoogleChart Class. + * + * @param Container $container The DI container. + * + * @return GoogleChart + * @since 3.2.0 + */ + public function getGoogleChart(Container $container): GoogleChart + { + return new GoogleChart(); + } + + /** + * Get The HasMenuGlobal Class. + * + * @param Container $container The DI container. + * + * @return HasMenuGlobal + * @since 3.2.0 + */ + public function getHasMenuGlobal(Container $container): HasMenuGlobal + { + return new HasMenuGlobal(); + } + + /** + * Get The HasPermissions Class. + * + * @param Container $container The DI container. + * + * @return HasPermissions + * @since 3.2.0 + */ + public function getHasPermissions(Container $container): HasPermissions + { + return new HasPermissions(); + } + + /** + * Get The HiddenFields Class. + * + * @param Container $container The DI container. + * + * @return HiddenFields + * @since 3.2.0 + */ + public function getHiddenFields(Container $container): HiddenFields + { + return new HiddenFields(); + } + + /** + * Get The History Class. + * + * @param Container $container The DI container. + * + * @return History + * @since 3.2.0 + */ + public function getHistory(Container $container): History + { + return new History(); + } + + /** + * Get The IntegerFields Class. + * + * @param Container $container The DI container. + * + * @return IntegerFields + * @since 3.2.0 + */ + public function getIntegerFields(Container $container): IntegerFields + { + return new IntegerFields(); + } + + /** + * Get The ItemsMethodEximportString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodEximportString + * @since 3.2.0 + */ + public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString + { + return new ItemsMethodEximportString(); + } + + /** + * Get The ItemsMethodListString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodListString + * @since 3.2.0 + */ + public function getItemsMethodListString(Container $container): ItemsMethodListString + { + return new ItemsMethodListString(); + } + + /** + * Get The JsonItem Class. + * + * @param Container $container The DI container. + * + * @return JsonItem + * @since 3.2.0 + */ + public function getJsonItem(Container $container): JsonItem + { + return new JsonItem(); + } + + /** + * Get The JsonItemArray Class. + * + * @param Container $container The DI container. + * + * @return JsonItemArray + * @since 3.2.0 + */ + public function getJsonItemArray(Container $container): JsonItemArray + { + return new JsonItemArray(); + } + + /** + * Get The JsonString Class. + * + * @param Container $container The DI container. + * + * @return JsonString + * @since 3.2.0 + */ + public function getJsonString(Container $container): JsonString + { + return new JsonString(); + } +} + diff --git a/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.power b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.power new file mode 100644 index 0000000..9ec78f8 --- /dev/null +++ b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/code.power @@ -0,0 +1,794 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') + ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); + + $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') + ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); + + $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') + ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); + + $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') + ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); + + $container->alias(Alias::class, 'Compiler.Builder.Alias') + ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); + + $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') + ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); + + $container->alias(Category::class, 'Compiler.Builder.Category') + ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); + + $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') + ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); + + $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') + ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); + + $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') + ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); + + $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') + ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') + ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') + ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') + ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); + + $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') + ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); + + $container->alias(Contributors::class, 'Compiler.Builder.Contributors') + ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); + + $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') + ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); + + $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') + ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); + + $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') + ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); + + $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') + ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); + + $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') + ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); + + $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') + ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); + + $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') + ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); + + $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') + ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); + + $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') + ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); + + $container->alias(DatabaseUninstall::class, 'Compiler.Builder.Database.Uninstall') + ->share('Compiler.Builder.Database.Uninstall', [$this, 'getDatabaseUninstall'], true); + + $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') + ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); + + $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') + ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); + + $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') + ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); + + $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') + ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); + + $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') + ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); + + $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') + ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); + + $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') + ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); + + $container->alias(Filter::class, 'Compiler.Builder.Filter') + ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); + + $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') + ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); + + $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') + ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); + + $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') + ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); + + $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') + ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); + + $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') + ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); + + $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') + ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); + + $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') + ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); + + $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') + ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); + + $container->alias(History::class, 'Compiler.Builder.History') + ->share('Compiler.Builder.History', [$this, 'getHistory'], true); + + $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') + ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); + + $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') + ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); + + $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') + ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); + + $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') + ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); + + $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') + ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); + + $container->alias(JsonString::class, 'Compiler.Builder.Json.String') + ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + } + + /** + * Get The AccessSwitch Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitch + * @since 3.2.0 + */ + public function getAccessSwitch(Container $container): AccessSwitch + { + return new AccessSwitch(); + } + + /** + * Get The AccessSwitchList Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitchList + * @since 3.2.0 + */ + public function getAccessSwitchList(Container $container): AccessSwitchList + { + return new AccessSwitchList(); + } + + /** + * Get The AssetsRules Class. + * + * @param Container $container The DI container. + * + * @return AssetsRules + * @since 3.2.0 + */ + public function getAssetsRules(Container $container): AssetsRules + { + return new AssetsRules(); + } + + /** + * Get The AdminFilterType Class. + * + * @param Container $container The DI container. + * + * @return AdminFilterType + * @since 3.2.0 + */ + public function getAdminFilterType(Container $container): AdminFilterType + { + return new AdminFilterType(); + } + + /** + * Get The Alias Class. + * + * @param Container $container The DI container. + * + * @return Alias + * @since 3.2.0 + */ + public function getAlias(Container $container): Alias + { + return new Alias(); + } + + /** + * Get The BaseSixFour Class. + * + * @param Container $container The DI container. + * + * @return BaseSixFour + * @since 3.2.0 + */ + public function getBaseSixFour(Container $container): BaseSixFour + { + return new BaseSixFour(); + } + + /** + * Get The Category Class. + * + * @param Container $container The DI container. + * + * @return Category + * @since 3.2.0 + */ + public function getCategory(Container $container): Category + { + return new Category(); + } + + /** + * Get The CategoryCode Class. + * + * @param Container $container The DI container. + * + * @return CategoryCode + * @since 3.2.0 + */ + public function getCategoryCode(Container $container): CategoryCode + { + return new CategoryCode(); + } + + /** + * Get The CategoryOtherName Class. + * + * @param Container $container The DI container. + * + * @return CategoryOtherName + * @since 3.2.0 + */ + public function getCategoryOtherName(Container $container): CategoryOtherName + { + return new CategoryOtherName(); + } + + /** + * Get The CheckBox Class. + * + * @param Container $container The DI container. + * + * @return CheckBox + * @since 3.2.0 + */ + public function getCheckBox(Container $container): CheckBox + { + return new CheckBox(); + } + + /** + * Get The ComponentFields Class. + * + * @param Container $container The DI container. + * + * @return ComponentFields + * @since 3.2.0 + */ + public function getComponentFields(Container $container): ComponentFields + { + return new ComponentFields(); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets(); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield(); + } + + /** + * Get The ContentMulti Class. + * + * @param Container $container The DI container. + * + * @return ContentMulti + * @since 3.2.0 + */ + public function getContentMulti(Container $container): ContentMulti + { + return new ContentMulti(); + } + + /** + * Get The ContentOne Class. + * + * @param Container $container The DI container. + * + * @return ContentOne + * @since 3.2.0 + */ + public function getContentOne(Container $container): ContentOne + { + return new ContentOne(); + } + + /** + * Get The Contributors Class. + * + * @param Container $container The DI container. + * + * @return Contributors + * @since 3.2.0 + */ + public function getContributors(Container $container): Contributors + { + return new Contributors(); + } + + /** + * Get The CustomAlias Class. + * + * @param Container $container The DI container. + * + * @return CustomAlias + * @since 3.2.0 + */ + public function getCustomAlias(Container $container): CustomAlias + { + return new CustomAlias(); + } + + /** + * Get The CustomField Class. + * + * @param Container $container The DI container. + * + * @return CustomField + * @since 3.2.0 + */ + public function getCustomField(Container $container): CustomField + { + return new CustomField(); + } + + /** + * Get The CustomFieldLinks Class. + * + * @param Container $container The DI container. + * + * @return CustomFieldLinks + * @since 3.2.0 + */ + public function getCustomFieldLinks(Container $container): CustomFieldLinks + { + return new CustomFieldLinks(); + } + + /** + * Get The CustomList Class. + * + * @param Container $container The DI container. + * + * @return CustomList + * @since 3.2.0 + */ + public function getCustomList(Container $container): CustomList + { + return new CustomList(); + } + + /** + * Get The CustomTabs Class. + * + * @param Container $container The DI container. + * + * @return CustomTabs + * @since 3.2.0 + */ + public function getCustomTabs(Container $container): CustomTabs + { + return new CustomTabs(); + } + + /** + * Get The DatabaseKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseKeys + * @since 3.2.0 + */ + public function getDatabaseKeys(Container $container): DatabaseKeys + { + return new DatabaseKeys(); + } + + /** + * Get The DatabaseTables Class. + * + * @param Container $container The DI container. + * + * @return DatabaseTables + * @since 3.2.0 + */ + public function getDatabaseTables(Container $container): DatabaseTables + { + return new DatabaseTables(); + } + + /** + * Get The DatabaseUniqueGuid Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueGuid + * @since 3.2.0 + */ + public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid + { + return new DatabaseUniqueGuid(); + } + + /** + * Get The DatabaseUniqueKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueKeys + * @since 3.2.0 + */ + public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys + { + return new DatabaseUniqueKeys(); + } + + /** + * Get The DatabaseUninstall Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUninstall + * @since 3.2.0 + */ + public function getDatabaseUninstall(Container $container): DatabaseUninstall + { + return new DatabaseUninstall(); + } + + /** + * Get The DoNotEscape Class. + * + * @param Container $container The DI container. + * + * @return DoNotEscape + * @since 3.2.0 + */ + public function getDoNotEscape(Container $container): DoNotEscape + { + return new DoNotEscape(); + } + + /** + * Get The DynamicFields Class. + * + * @param Container $container The DI container. + * + * @return DynamicFields + * @since 3.2.0 + */ + public function getDynamicFields(Container $container): DynamicFields + { + return new DynamicFields(); + } + + /** + * Get The ExtensionCustomFields Class. + * + * @param Container $container The DI container. + * + * @return ExtensionCustomFields + * @since 3.2.0 + */ + public function getExtensionCustomFields(Container $container): ExtensionCustomFields + { + return new ExtensionCustomFields(); + } + + /** + * Get The ExtensionsParams Class. + * + * @param Container $container The DI container. + * + * @return ExtensionsParams + * @since 3.2.0 + */ + public function getExtensionsParams(Container $container): ExtensionsParams + { + return new ExtensionsParams(); + } + + /** + * Get The FieldGroupControl Class. + * + * @param Container $container The DI container. + * + * @return FieldGroupControl + * @since 3.2.0 + */ + public function getFieldGroupControl(Container $container): FieldGroupControl + { + return new FieldGroupControl(); + } + + /** + * Get The FieldNames Class. + * + * @param Container $container The DI container. + * + * @return FieldNames + * @since 3.2.0 + */ + public function getFieldNames(Container $container): FieldNames + { + return new FieldNames(); + } + + /** + * Get The FieldRelations Class. + * + * @param Container $container The DI container. + * + * @return FieldRelations + * @since 3.2.0 + */ + public function getFieldRelations(Container $container): FieldRelations + { + return new FieldRelations(); + } + + /** + * Get The Filter Class. + * + * @param Container $container The DI container. + * + * @return Filter + * @since 3.2.0 + */ + public function getFilter(Container $container): Filter + { + return new Filter(); + } + + /** + * Get The FootableScripts Class. + * + * @param Container $container The DI container. + * + * @return FootableScripts + * @since 3.2.0 + */ + public function getFootableScripts(Container $container): FootableScripts + { + return new FootableScripts(); + } + + /** + * Get The FrontendParams Class. + * + * @param Container $container The DI container. + * + * @return FrontendParams + * @since 3.2.0 + */ + public function getFrontendParams(Container $container): FrontendParams + { + return new FrontendParams(); + } + + /** + * Get The GetAsLookup Class. + * + * @param Container $container The DI container. + * + * @return GetAsLookup + * @since 3.2.0 + */ + public function getGetAsLookup(Container $container): GetAsLookup + { + return new GetAsLookup(); + } + + /** + * Get The GetModule Class. + * + * @param Container $container The DI container. + * + * @return GetModule + * @since 3.2.0 + */ + public function getGetModule(Container $container): GetModule + { + return new GetModule(); + } + + /** + * Get The GoogleChart Class. + * + * @param Container $container The DI container. + * + * @return GoogleChart + * @since 3.2.0 + */ + public function getGoogleChart(Container $container): GoogleChart + { + return new GoogleChart(); + } + + /** + * Get The HasMenuGlobal Class. + * + * @param Container $container The DI container. + * + * @return HasMenuGlobal + * @since 3.2.0 + */ + public function getHasMenuGlobal(Container $container): HasMenuGlobal + { + return new HasMenuGlobal(); + } + + /** + * Get The HasPermissions Class. + * + * @param Container $container The DI container. + * + * @return HasPermissions + * @since 3.2.0 + */ + public function getHasPermissions(Container $container): HasPermissions + { + return new HasPermissions(); + } + + /** + * Get The HiddenFields Class. + * + * @param Container $container The DI container. + * + * @return HiddenFields + * @since 3.2.0 + */ + public function getHiddenFields(Container $container): HiddenFields + { + return new HiddenFields(); + } + + /** + * Get The History Class. + * + * @param Container $container The DI container. + * + * @return History + * @since 3.2.0 + */ + public function getHistory(Container $container): History + { + return new History(); + } + + /** + * Get The IntegerFields Class. + * + * @param Container $container The DI container. + * + * @return IntegerFields + * @since 3.2.0 + */ + public function getIntegerFields(Container $container): IntegerFields + { + return new IntegerFields(); + } + + /** + * Get The ItemsMethodEximportString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodEximportString + * @since 3.2.0 + */ + public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString + { + return new ItemsMethodEximportString(); + } + + /** + * Get The ItemsMethodListString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodListString + * @since 3.2.0 + */ + public function getItemsMethodListString(Container $container): ItemsMethodListString + { + return new ItemsMethodListString(); + } + + /** + * Get The JsonItem Class. + * + * @param Container $container The DI container. + * + * @return JsonItem + * @since 3.2.0 + */ + public function getJsonItem(Container $container): JsonItem + { + return new JsonItem(); + } + + /** + * Get The JsonItemArray Class. + * + * @param Container $container The DI container. + * + * @return JsonItemArray + * @since 3.2.0 + */ + public function getJsonItemArray(Container $container): JsonItemArray + { + return new JsonItemArray(); + } + + /** + * Get The JsonString Class. + * + * @param Container $container The DI container. + * + * @return JsonString + * @since 3.2.0 + */ + public function getJsonString(Container $container): JsonString + { + return new JsonString(); + } \ No newline at end of file diff --git a/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/settings.json b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/settings.json new file mode 100644 index 0000000..d17dacf --- /dev/null +++ b/src/c7230c8c-ea88-4d8d-8c53-6136133195b7/settings.json @@ -0,0 +1,218 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "c7230c8c-ea88-4d8d-8c53-6136133195b7", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "BuilderAJ", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.BuilderAJ", + "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_selection15": { + "use": "274a78d1-24c2-4486-b560-b86e9ae72872", + "as": "default" + }, + "use_selection16": { + "use": "9d74d613-5ef7-4cf1-9f12-64f0a8e19806", + "as": "default" + }, + "use_selection17": { + "use": "87d1da23-08d6-4fbf-bd0d-b746da240b8a", + "as": "default" + }, + "use_selection18": { + "use": "a4857c60-680c-4e0c-ae8f-9250a7b5e317", + "as": "default" + }, + "use_selection19": { + "use": "202f748a-516b-4782-962e-ac9725c3cac4", + "as": "default" + }, + "use_selection20": { + "use": "9551b683-67b6-4367-bb14-4b016def37e3", + "as": "default" + }, + "use_selection21": { + "use": "0d8db719-39a6-48b4-85a6-2f97e784e588", + "as": "default" + }, + "use_selection22": { + "use": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996", + "as": "default" + }, + "use_selection23": { + "use": "58b7f907-4195-4ca3-886c-17877be59887", + "as": "default" + }, + "use_selection24": { + "use": "ce0899a9-6271-4fc4-800a-697c122bb112", + "as": "default" + }, + "use_selection25": { + "use": "a7fc4913-6b1a-4eea-a168-fceb75fcf6ac", + "as": "default" + }, + "use_selection26": { + "use": "0d9d3294-0bed-4c44-b1a1-e172f62cafb2", + "as": "default" + }, + "use_selection27": { + "use": "1ae9a8e8-59f7-4844-a08d-9a4dce4be076", + "as": "default" + }, + "use_selection28": { + "use": "e9b6b06b-f600-4f9d-984d-79c70ae7ae92", + "as": "default" + }, + "use_selection29": { + "use": "bcf1e767-1566-440d-9f67-5c1bada934fa", + "as": "default" + }, + "use_selection30": { + "use": "d5530adf-c809-45a9-87fc-7cecd3d972d8", + "as": "default" + }, + "use_selection31": { + "use": "961a2a2e-9f95-4b5f-b1c0-62ee783f9c66", + "as": "default" + }, + "use_selection32": { + "use": "a090a472-eb3d-4086-a6d5-4215e1b1851f", + "as": "default" + }, + "use_selection33": { + "use": "e4e65c5b-00ec-439c-96bf-3153c3a73398", + "as": "default" + }, + "use_selection34": { + "use": "dba0776e-e582-4f73-af3e-e7ed17bc34b3", + "as": "default" + }, + "use_selection35": { + "use": "207b5ef3-b3bb-45bf-af14-4572e296d761", + "as": "default" + }, + "use_selection36": { + "use": "8f46f85d-7921-44e9-a40e-dc4f01c5d43a", + "as": "default" + }, + "use_selection37": { + "use": "c7b6f0d5-ec47-4166-915c-e78d49b4fb63", + "as": "default" + }, + "use_selection38": { + "use": "507ab90f-7d64-4697-9815-d96f5d1d1185", + "as": "default" + }, + "use_selection39": { + "use": "6992384f-4f29-489f-a52e-286e03f4593b", + "as": "default" + }, + "use_selection40": { + "use": "e54965e7-34fd-481e-b40c-4da089afec5a", + "as": "default" + }, + "use_selection41": { + "use": "0b45357f-b077-4337-92f3-65c1e19d36cd", + "as": "default" + }, + "use_selection42": { + "use": "2cb33994-052e-42dd-adbc-3ea9f932816f", + "as": "default" + }, + "use_selection43": { + "use": "952423ba-015a-4104-89a4-030695aa4d15", + "as": "default" + }, + "use_selection44": { + "use": "1f086665-c007-4085-b363-3a118659ff1b", + "as": "default" + }, + "use_selection45": { + "use": "972c4de9-6f6f-463b-8eea-cc7cbdb96aba", + "as": "default" + }, + "use_selection46": { + "use": "45652787-9085-4c67-914f-0da25ae62646", + "as": "default" + }, + "use_selection47": { + "use": "6b386f2e-3eb1-4f60-81af-a90c8da1ffeb", + "as": "default" + }, + "use_selection48": { + "use": "bb26cf63-69a5-4c43-b2df-43284c9d907d", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.BuilderAJ", + "description": "Builder A-J 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 \r\n * @git 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;", + "composer": "" +} \ No newline at end of file diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/code.php b/src/cef2815b-f72b-402a-b769-f028f676692d/code.php index dac081e..3f82ff0 100644 --- a/src/cef2815b-f72b-402a-b769-f028f676692d/code.php +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/code.php @@ -17,7 +17,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; use VDM\Joomla\Componentbuilder\Compiler\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; -use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs; use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs; use VDM\Joomla\Componentbuilder\Compiler\Model\Fields; use VDM\Joomla\Componentbuilder\Compiler\Model\Historyadminview as History; diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json b/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json index 322d72f..587efe5 100644 --- a/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json @@ -27,8 +27,8 @@ "as": "default" }, "use_selection4": { - "use": "fa8c1125-d370-4cb6-a7ff-eb32193c198c", - "as": "default" + "use": "fcf42c53-0967-4c87-9699-a4d86adfdadf", + "as": "Customtabs" }, "use_selection5": { "use": "143ac6ea-b64f-4331-9a97-31e3fce2bb69", diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md b/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md index fd6f9db..975642c 100644 --- a/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class InstallScript (Details) +# final class InstallScript (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour** ```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 diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php index e5ce05f..a9acfa5 100644 --- a/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.php @@ -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 * diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power index 8b6fae9..391c370 100644 --- a/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/code.power @@ -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 * diff --git a/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json b/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json index ff4f0fa..1a010e9 100644 --- a/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json +++ b/src/d42e1fac-3c05-4a22-8878-2abd43019811/settings.json @@ -9,8 +9,8 @@ "load_selection": null, "name": "InstallScript", "power_version": "1.0.0", - "system_name": "JCB.Compiler.Extension.JoomlaFour.InstallScript", - "type": "class", + "system_name": "JCB.Compiler.Extension.J4.InstallScript", + "type": "final class", "use_selection": { "use_selection0": { "use": "1aefb8f5-486f-4f00-adf9-696340b3254e", diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php index a807f5d..d244e1d 100644 --- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php @@ -35,7 +35,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Service\Field; use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlamodule; use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlaplugin; use VDM\Joomla\Componentbuilder\Compiler\Service\Utilities; -use VDM\Joomla\Componentbuilder\Compiler\Service\Builder; +use VDM\Joomla\Componentbuilder\Compiler\Service\BuilderAJ; +use VDM\Joomla\Componentbuilder\Compiler\Service\BuilderLZ; use VDM\Joomla\Componentbuilder\Compiler\Service\Creator; use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureController; use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureModel; @@ -165,7 +166,8 @@ abstract class Factory implements FactoryInterface ->registerServiceProvider(new Joomlamodule()) ->registerServiceProvider(new Joomlaplugin()) ->registerServiceProvider(new Utilities()) - ->registerServiceProvider(new Builder()) + ->registerServiceProvider(new BuilderAJ()) + ->registerServiceProvider(new BuilderLZ()) ->registerServiceProvider(new Creator()) ->registerServiceProvider(new ArchitectureController()) ->registerServiceProvider(new ArchitectureModel()) diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power index 7ead49f..0118f3d 100644 --- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power @@ -103,7 +103,8 @@ ->registerServiceProvider(new Joomlamodule()) ->registerServiceProvider(new Joomlaplugin()) ->registerServiceProvider(new Utilities()) - ->registerServiceProvider(new Builder()) + ->registerServiceProvider(new BuilderAJ()) + ->registerServiceProvider(new BuilderLZ()) ->registerServiceProvider(new Creator()) ->registerServiceProvider(new ArchitectureController()) ->registerServiceProvider(new ArchitectureModel()) diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json index d4fdf1f..a047fa8 100644 --- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json @@ -100,6 +100,10 @@ "use": "516f93b8-5fff-41c6-aeaf-2d93180a12cc", "as": "default" }, + "use_selection37": { + "use": "c7230c8c-ea88-4d8d-8c53-6136133195b7", + "as": "default" + }, "use_selection22": { "use": "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7", "as": "default" @@ -108,55 +112,55 @@ "use": "8fdd604f-53e7-4a91-9935-afcfd2f6ac1b", "as": "default" }, - "use_selection36": { + "use_selection24": { "use": "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60", "as": "default" }, - "use_selection24": { + "use_selection25": { "use": "bbd36fbf-d905-47e8-8e67-9ea6ec734712", "as": "default" }, - "use_selection25": { + "use_selection26": { "use": "71acf8d6-32b8-4173-8277-eb9cda29fd64", "as": "default" }, - "use_selection26": { + "use_selection27": { "use": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c", "as": "GiteaUtilities" }, - "use_selection27": { + "use_selection28": { "use": "f4d00907-c94a-49b7-8727-d64c1fa74cf5", "as": "GiteaSettings" }, - "use_selection28": { + "use_selection29": { "use": "3d25ea99-4f33-489a-934c-0e42027e6114", "as": "GiteaOrg" }, - "use_selection29": { + "use_selection30": { "use": "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e", "as": "GiteaUser" }, - "use_selection30": { + "use_selection31": { "use": "0bb2b72f-ebcd-46fe-844b-ac5fe715c230", "as": "GiteaRepo" }, - "use_selection31": { + "use_selection32": { "use": "808da4eb-b467-46cf-a767-e7e714f46b5a", "as": "GiteaPackage" }, - "use_selection32": { + "use_selection33": { "use": "44396eb8-e14c-47d9-9bdc-8205c0fd2bba", "as": "GiteaIssue" }, - "use_selection33": { + "use_selection34": { "use": "be57f70f-1214-4d69-8d33-7cd4e312ff70", "as": "GiteNotifi" }, - "use_selection34": { + "use_selection35": { "use": "012af7d0-3436-4cae-b856-be49bdc39a3e", "as": "GiteaMisc" }, - "use_selection35": { + "use_selection36": { "use": "ddced4c5-667d-4559-873d-d716c17fd85b", "as": "GiteaAdmin" } diff --git a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php index b03acb7..845ce40 100644 --- a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php +++ b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php @@ -178,7 +178,6 @@ class Power implements ServiceProviderInterface $container->get('Power'), $container->get('Compiler.Builder.Content.One'), $container->get('Compiler.Builder.Content.Multi'), - $container->get('Power.Autoloader'), $container->get('Power.Parser'), $container->get('Power.Repo.Readme'), $container->get('Power.Repos.Readme'), diff --git a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.power b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.power index 0f8c4a4..4bd4d29 100644 --- a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.power +++ b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.power @@ -138,7 +138,6 @@ $container->get('Power'), $container->get('Compiler.Builder.Content.One'), $container->get('Compiler.Builder.Content.Multi'), - $container->get('Power.Autoloader'), $container->get('Power.Parser'), $container->get('Power.Repo.Readme'), $container->get('Power.Repos.Readme'), diff --git a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php index 211abf2..687450c 100644 --- a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php +++ b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php @@ -45,7 +45,7 @@ final class Component extends BaseRegistry * * @since 3.2.0 */ - public function __get(string $path) + public function __get($path) { // check if it has been set if (($value = $this->get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') diff --git a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.power b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.power index 0a0eef9..fe2da8a 100644 --- a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.power +++ b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.power @@ -19,7 +19,7 @@ * * @since 3.2.0 */ - public function __get(string $path) + public function __get($path) { // check if it has been set if (($value = $this->get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') diff --git a/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/README.md b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/README.md new file mode 100644 index 0000000..5e780c7 --- /dev/null +++ b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class RouterConstructorDefault (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class RouterConstructorDefault << (F,LightGreen) >> #RoyalBlue { + # Router $router + + __construct(Router $router) + + get() : string +} + +note right of RouterConstructorDefault::__construct + Constructor. + + since: 3.2.0 +end note + +note right of RouterConstructorDefault::get + Get Construct Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.php b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.php new file mode 100644 index 0000000..709fc9e --- /dev/null +++ b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.php @@ -0,0 +1,77 @@ + + * @git 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 Constructor Default Creator Class + * + * @since 3.2.0 + */ +final class RouterConstructorDefault +{ + /** + * 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 Construct Code + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + $views = $this->router->get('views'); + if ($views !== null) + { + $code = []; + foreach ($views as $view) + { + $code[] = ''; + $code[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Add the ({$view->view}:view) router configuration"; + $code[] = Indent::_(2) . "\${$view->view} = new RouterViewConfiguration('{$view->view}');"; + // add key only if we have one see: ...Compiler\Creator\Router->updateKeys(); + if (!empty($view->key) && !empty($view->alias)) + { + $code[] = Indent::_(2) . "\${$view->view}->setKey('{$view->key}');"; + } + $code[] = Indent::_(2) . "\$this->registerView(\${$view->view});"; + } + return PHP_EOL . implode(PHP_EOL, $code); + } + return ''; + } +} + diff --git a/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.power b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.power new file mode 100644 index 0000000..1db406d --- /dev/null +++ b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/code.power @@ -0,0 +1,49 @@ + /** + * 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 Construct Code + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + $views = $this->router->get('views'); + if ($views !== null) + { + $code = []; + foreach ($views as $view) + { + $code[] = ''; + $code[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Add the ({$view->view}:view) router configuration"; + $code[] = Indent::_(2) . "\${$view->view} = new RouterViewConfiguration('{$view->view}');"; + // add key only if we have one see: ...Compiler\Creator\Router->updateKeys(); + if (!empty($view->key) && !empty($view->alias)) + { + $code[] = Indent::_(2) . "\${$view->view}->setKey('{$view->key}');"; + } + $code[] = Indent::_(2) . "\$this->registerView(\${$view->view});"; + } + return PHP_EOL . implode(PHP_EOL, $code); + } + return ''; + } \ No newline at end of file diff --git a/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/settings.json b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/settings.json new file mode 100644 index 0000000..5e4ce59 --- /dev/null +++ b/src/e5278bf3-6dfb-42a0-b699-148b5ab8e45f/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "e5278bf3-6dfb-42a0-b699-148b5ab8e45f", + "implements": null, + "load_selection": null, + "name": "RouterConstructorDefault", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.RouterConstructorDefault", + "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.RouterConstructorDefault", + "description": "Router Constructor 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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md b/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md index 2e6d4f9..9cb3ae4 100644 --- a/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class CoreField (Details) +# final class CoreField (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree** ```uml @startuml -class CoreField #Gold { +class CoreField << (F,LightGreen) >> #RoyalBlue { # array $fields # array $paths + __construct() diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php b/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php index f27af16..4b3a42f 100644 --- a/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/code.php @@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface; * * @since 3.2.0 */ -class CoreField implements CoreFieldInterface +final class CoreField implements CoreFieldInterface { /** * Local Core Joomla Fields diff --git a/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json b/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json index 7ee7ad6..ac3944b 100644 --- a/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json +++ b/src/e6683873-b74e-4b54-8466-69f8a9282033/settings.json @@ -10,7 +10,7 @@ "name": "CoreField", "power_version": "1.0.0", "system_name": "JCB.Compiler.Field.J3.CoreField", - "type": "class", + "type": "final class", "use_selection": { "use_selection0": { "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", diff --git a/src/e85175fd-e297-46df-a497-27f7a37190fd/README.md b/src/e85175fd-e297-46df-a497-27f7a37190fd/README.md new file mode 100644 index 0000000..08250e7 --- /dev/null +++ b/src/e85175fd-e297-46df-a497-27f7a37190fd/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class AllowEdit (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller** +```uml +@startuml +class AllowEdit << (F,LightGreen) >> #RoyalBlue { + # String $component + # Permission $permission + # Dispenser $dispenser + # Category $category + # CategoryOtherName $categoryothername + + __construct(Config $config, Permission $permission, ...) + + get(string $nameSingleCode, string $nameListCode) : string +} + +note right of AllowEdit::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Permission $permission + Dispenser $dispenser + Category $category + CategoryOtherName $categoryothername +end note + +note right of AllowEdit::get + Get Allow Edit Function Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e85175fd-e297-46df-a497-27f7a37190fd/code.php b/src/e85175fd-e297-46df-a497-27f7a37190fd/code.php new file mode 100644 index 0000000..39a2d36 --- /dev/null +++ b/src/e85175fd-e297-46df-a497-27f7a37190fd/code.php @@ -0,0 +1,300 @@ + + * @git 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\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface; + + +/** + * Controller Allow Edit Class for Joomla 5 + * + * @since 3.2.0 + */ +final class AllowEdit implements AllowEditInterface +{ + /** + * 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; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The CategoryOtherName Class. + * + * @var CategoryOtherName + * @since 3.2.0 + */ + protected CategoryOtherName $categoryothername; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Category $category The Category Class. + * @param CategoryOtherName $categoryothername The CategoryOtherName Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser, Category $category, + CategoryOtherName $categoryothername) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + $this->category = $category; + $this->categoryothername = $categoryothername; + } + + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $allow = []; + + // prepare custom permission script + $customAllow = $this->dispenser->get( + 'php_allowedit', $nameSingleCode, '', null, true + ); + + if ($this->category->exists("{$nameListCode}")) + { + // check if category has another name + $otherViews = $this->categoryothername-> + get($nameListCode . '.views', $nameListCode); + $otherView = $this->categoryothername-> + get($nameListCode . '.view', $nameSingleCode); + // setup the category script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->globalExist($otherView, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "." . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $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($otherView, 'core.edit') . "', 'com_" . $this->component . "." + . $otherView . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "." + . $otherView . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then do the test."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($otherView, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + else + { + // setup the category script + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->actionExist($nameSingleCode, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "." + . $nameSingleCode + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $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') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then allow."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + + return implode(PHP_EOL, $allow); + } +} + diff --git a/src/e85175fd-e297-46df-a497-27f7a37190fd/code.power b/src/e85175fd-e297-46df-a497-27f7a37190fd/code.power new file mode 100644 index 0000000..7236a2c --- /dev/null +++ b/src/e85175fd-e297-46df-a497-27f7a37190fd/code.power @@ -0,0 +1,267 @@ + /** + * 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; + + /** + * The Category Class. + * + * @var Category + * @since 3.2.0 + */ + protected Category $category; + + /** + * The CategoryOtherName Class. + * + * @var CategoryOtherName + * @since 3.2.0 + */ + protected CategoryOtherName $categoryothername; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Permission $permission The Permission Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Category $category The Category Class. + * @param CategoryOtherName $categoryothername The CategoryOtherName Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Permission $permission, + Dispenser $dispenser, Category $category, + CategoryOtherName $categoryothername) + { + $this->component = $config->component_code_name; + $this->permission = $permission; + $this->dispenser = $dispenser; + $this->category = $category; + $this->categoryothername = $categoryothername; + } + + /** + * Get Allow Edit Function Code + * + * @param string $nameSingleCode The single code name of the view. + * @param string $nameListCode The list code name of the view. + * + * @since 3.2.0 + * @return string The allow edit method code + */ + public function get(string $nameSingleCode, string $nameListCode): string + { + $allow = []; + + // prepare custom permission script + $customAllow = $this->dispenser->get( + 'php_allowedit', $nameSingleCode, '', null, true + ); + + if ($this->category->exists("{$nameListCode}")) + { + // check if category has another name + $otherViews = $this->categoryothername-> + get($nameListCode . '.views', $nameListCode); + $otherView = $this->categoryothername-> + get($nameListCode . '.view', $nameSingleCode); + // setup the category script + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->globalExist($otherView, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "." . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.access') + . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $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($otherView, 'core.edit') . "', 'com_" . $this->component . "." + . $otherView . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "." + . $otherView . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then do the test."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($otherView, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + else + { + // setup the category script + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get user object."; + $allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " get record id."; + $allow[] = Indent::_(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + // load custom permission script + $allow[] = $customAllow; + // check if the item has permissions. + if ($this->permission->actionExist($nameSingleCode, 'core.access')) + { + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Access check."; + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "." + . $nameSingleCode + . ".' . (int) \$recordId) && \$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; + } + $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') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . (int) \$recordId);"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(4) . "if (\$user->authorise('" + . $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "." + . $nameSingleCode . ".' . \$recordId))"; + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " Now test the owner is the user."; + $allow[] = Indent::_(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) + . " Need to do a lookup from the model."; + $allow[] = Indent::_(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) + . " If the owner matches 'me' then allow."; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; + // check if the item has permissions. + $allow[] = Indent::_(6) . "if (\$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; + if ($this->permission->globalExist($nameSingleCode, 'core.edit')) + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) . "return \$user->authorise('" + . $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);"; + } + else + { + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = Indent::_(2) + . "return parent::allowEdit(\$data, \$key);"; + } + } + + return implode(PHP_EOL, $allow); + } \ No newline at end of file diff --git a/src/e85175fd-e297-46df-a497-27f7a37190fd/settings.json b/src/e85175fd-e297-46df-a497-27f7a37190fd/settings.json new file mode 100644 index 0000000..d882767 --- /dev/null +++ b/src/e85175fd-e297-46df-a497-27f7a37190fd/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "e85175fd-e297-46df-a497-27f7a37190fd", + "implements": [ + "992a842f-1ba9-4a5c-b214-042459ffe038" + ], + "load_selection": null, + "name": "AllowEdit", + "power_version": "1.0.0", + "system_name": "JCB.Architecture.J5.Controller.AllowEdit", + "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": "007177eb-d39d-4093-8840-07a38811c502", + "as": "default" + }, + "use_selection4": { + "use": "a1e551a9-8369-48c9-a076-4e5beb65e0df", + "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.Architecture.JoomlaFive.Controller.AllowEdit", + "description": "Controller Allow Edit 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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/README.md b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/README.md new file mode 100644 index 0000000..5b23c5f --- /dev/null +++ b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class RouterConstructorManual (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator** +```uml +@startuml +class RouterConstructorManual << (F,LightGreen) >> #RoyalBlue { + # Router $router + + __construct(Router $router) + + get() : string +} + +note right of RouterConstructorManual::__construct + Constructor. + + since: 3.2.0 +end note + +note right of RouterConstructorManual::get + Get Construct Code (SOON) + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.php b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.php new file mode 100644 index 0000000..e2a47a0 --- /dev/null +++ b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.php @@ -0,0 +1,77 @@ + + * @git 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 Constructor Default Creator Class + * + * @since 3.2.0 + */ +final class RouterConstructorManual +{ + /** + * 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 Construct Code (SOON) + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + $views = $this->router->get('views'); + if ($views !== null) + { + $code = []; + foreach ($views as $view) + { + $code[] = ''; + $code[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Add the ({$view->view}:view) router configuration"; + $code[] = Indent::_(2) . "\${$view->view} = new RouterViewConfiguration('{$view->view}');"; + // add key only if we have one see: ...Compiler\Creator\Router->updateKeys(); + if (!empty($view->key) && !empty($view->alias)) + { + $code[] = Indent::_(2) . "\${$view->view}->setKey('{$view->key}');"; + } + $code[] = Indent::_(2) . "\$this->registerView(\${$view->view});"; + } + return PHP_EOL . implode(PHP_EOL, $code); + } + return ''; + } +} + diff --git a/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.power b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.power new file mode 100644 index 0000000..5eb15df --- /dev/null +++ b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/code.power @@ -0,0 +1,49 @@ + /** + * 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 Construct Code (SOON) + * + * @return string + * @since 3.2.0 + */ + public function get(): string + { + $views = $this->router->get('views'); + if ($views !== null) + { + $code = []; + foreach ($views as $view) + { + $code[] = ''; + $code[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Add the ({$view->view}:view) router configuration"; + $code[] = Indent::_(2) . "\${$view->view} = new RouterViewConfiguration('{$view->view}');"; + // add key only if we have one see: ...Compiler\Creator\Router->updateKeys(); + if (!empty($view->key) && !empty($view->alias)) + { + $code[] = Indent::_(2) . "\${$view->view}->setKey('{$view->key}');"; + } + $code[] = Indent::_(2) . "\$this->registerView(\${$view->view});"; + } + return PHP_EOL . implode(PHP_EOL, $code); + } + return ''; + } \ No newline at end of file diff --git a/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/settings.json b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/settings.json new file mode 100644 index 0000000..c6cb4ed --- /dev/null +++ b/src/ec7bdbf9-8377-446e-9f40-64e23ae96b59/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "ec7bdbf9-8377-446e-9f40-64e23ae96b59", + "implements": null, + "load_selection": null, + "name": "RouterConstructorManual", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Creator.RouterConstructorManual", + "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.RouterConstructorManual", + "description": "Router Constructor 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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md index 8ab77a4..82bfba9 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md @@ -15,6 +15,7 @@ class Extension #Gold { + register(Container $container) : void + getJ3ExtensionInstallScript(Container $container) : J3InstallScript + getJ4ExtensionInstallScript(Container $container) : J4InstallScript + + getJ5ExtensionInstallScript(Container $container) : J5InstallScript + getExtensionInstallScript(Container $container) : GetScriptInterface } @@ -39,6 +40,13 @@ note right of Extension::getJ4ExtensionInstallScript return: J4InstallScript end note +note right of Extension::getJ5ExtensionInstallScript + Get the Joomla 5 Extension Install Script + + since: 3.2.0 + return: J5InstallScript +end note + note right of Extension::getExtensionInstallScript Get the Joomla Extension Install Script diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php index 4eadc98..1c2c5e7 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript; use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour\InstallScript as J4InstallScript; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFive\InstallScript as J5InstallScript; /** @@ -52,6 +53,9 @@ class Extension implements ServiceProviderInterface $container->alias(J4InstallScript::class, 'J4.Extension.InstallScript') ->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true); + + $container->alias(J5InstallScript::class, 'J5.Extension.InstallScript') + ->share('J5.Extension.InstallScript', [$this, 'getJ5ExtensionInstallScript'], true); } /** @@ -80,6 +84,19 @@ class Extension implements ServiceProviderInterface return new J4InstallScript(); } + /** + * Get the Joomla 5 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J5InstallScript + * @since 3.2.0 + */ + public function getJ5ExtensionInstallScript(Container $container): J5InstallScript + { + return new J5InstallScript(); + } + /** * Get the Joomla Extension Install Script * diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power index 4be5e01..1b88492 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.power @@ -24,6 +24,9 @@ $container->alias(J4InstallScript::class, 'J4.Extension.InstallScript') ->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true); + + $container->alias(J5InstallScript::class, 'J5.Extension.InstallScript') + ->share('J5.Extension.InstallScript', [$this, 'getJ5ExtensionInstallScript'], true); } /** @@ -52,6 +55,19 @@ return new J4InstallScript(); } + /** + * Get the Joomla 5 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J5InstallScript + * @since 3.2.0 + */ + public function getJ5ExtensionInstallScript(Container $container): J5InstallScript + { + return new J5InstallScript(); + } + /** * Get the Joomla Extension Install Script * diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json index 026cc76..0e89123 100644 --- a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json @@ -23,6 +23,10 @@ "use_selection2": { "use": "d42e1fac-3c05-4a22-8878-2abd43019811", "as": "J4InstallScript" + }, + "use_selection3": { + "use": "73183d13-9b2e-4879-b05a-52298d5b31f7", + "as": "J5InstallScript" } }, "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Extension", diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md index 7aad8cf..165cfbc 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md @@ -31,6 +31,7 @@ class Data << (F,LightGreen) >> #RoyalBlue { # Updateserver $updateserver # Joomlamodules $modules # Joomlaplugins $plugins + # Router $router # $db + __construct(?Config $config = null, ?EventInterface $event = null, ...) + get() : ?object @@ -62,6 +63,7 @@ note right of Data::__construct ?Updateserver $updateserver = null ?Joomlamodules $modules = null ?Joomlaplugins $plugins = null + ?Router $router = null end note note right of Data::get diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php index ef6f6bc..541af4c 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php @@ -34,6 +34,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Customadminviews; use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlamodules; use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlaplugins; +use VDM\Joomla\Componentbuilder\Compiler\Model\Router; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\ArrayHelper; @@ -207,6 +208,14 @@ final class Data */ protected Joomlaplugins $plugins; + /** + * The modelling Joomla Site Router + * + * @var Router + * @since 3.2.0 + */ + protected Router $router; + /** * Database object to query local DB * @@ -237,7 +246,7 @@ final class Data * @param Updateserver|null $updateserver The modelling update server object. * @param Joomlamodules|null $modules The modelling modules object. * @param Joomlaplugins|null $plugins The modelling plugins object. - * @param \JDatabaseDriver|null $db The database object. + * @param Router|null $router The modelling router object. * * @since 3.2.0 */ @@ -248,7 +257,7 @@ final class Data ?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null, ?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null, ?Customadminviews $customadminviews = null, ?Updateserver $updateserver = null, - ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null) + ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null, ?Router $router = null) { $this->config = $config ?: Compiler::_('Config'); $this->event = $event ?: Compiler::_('Event'); @@ -270,6 +279,7 @@ final class Data $this->updateserver = $updateserver ?: Compiler::_('Model.Updateserver'); $this->modules = $modules ?: Compiler::_('Model.Joomlamodules'); $this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins'); + $this->router = $router ?: Compiler::_('Model.Router'); $this->db = Factory::getDbo(); } @@ -285,27 +295,34 @@ final class Data $query = $this->db->getQuery(true); // selection - $selection = array( - 'b.addadmin_views' => 'addadmin_views', - 'b.id' => 'addadmin_views_id', - 'h.addconfig' => 'addconfig', - 'd.addcustom_admin_views' => 'addcustom_admin_views', - 'g.addcustommenus' => 'addcustommenus', - 'j.addfiles' => 'addfiles', - 'j.addfolders' => 'addfolders', - 'j.addfilesfullpath' => 'addfilesfullpath', - 'j.addfoldersfullpath' => 'addfoldersfullpath', - 'c.addsite_views' => 'addsite_views', - 'l.addjoomla_plugins' => 'addjoomla_plugins', - 'k.addjoomla_modules' => 'addjoomla_modules', - 'i.dashboard_tab' => 'dashboard_tab', - 'i.php_dashboard_methods' => 'php_dashboard_methods', - 'i.params' => 'dashboard_params', - 'i.id' => 'component_dashboard_id', - 'f.sql_tweak' => 'sql_tweak', - 'e.version_update' => 'version_update', - 'e.id' => 'version_update_id' - ); + $selection = [ + 'b.addadmin_views' => 'addadmin_views', + 'b.id' => 'addadmin_views_id', + 'h.addconfig' => 'addconfig', + 'd.addcustom_admin_views' => 'addcustom_admin_views', + 'g.addcustommenus' => 'addcustommenus', + 'j.addfiles' => 'addfiles', + 'j.addfolders' => 'addfolders', + 'j.addfilesfullpath' => 'addfilesfullpath', + 'j.addfoldersfullpath' => 'addfoldersfullpath', + 'c.addsite_views' => 'addsite_views', + 'l.addjoomla_plugins' => 'addjoomla_plugins', + 'k.addjoomla_modules' => 'addjoomla_modules', + 'i.dashboard_tab' => 'dashboard_tab', + 'i.php_dashboard_methods' => 'php_dashboard_methods', + 'i.params' => 'dashboard_params', + 'i.id' => 'component_dashboard_id', + 'f.sql_tweak' => 'sql_tweak', + 'e.version_update' => 'version_update', + 'e.id' => 'version_update_id', + 'm.mode_constructor_before_parent' => 'router_mode_constructor_before_parent', + 'm.mode_constructor_after_parent' => 'router_mode_constructor_after_parent', + 'm.mode_methods' => 'router_mode_methods', + 'm.constructor_before_parent_code' => 'router_constructor_before_parent_code', + 'm.constructor_before_parent_manual' => 'router_constructor_before_parent_manual', + 'm.constructor_after_parent_code' => 'router_constructor_after_parent_code', + 'm.methods_code' => 'router_methods_code' + ]; $query->select('a.*'); $query->select( $this->db->quoteName( @@ -317,7 +334,7 @@ final class Data $query->from('#__componentbuilder_joomla_component AS a'); // jointer-map - $joiners = array( + $joiners = [ 'b' => 'component_admin_views', 'c' => 'component_site_views', 'd' => 'component_custom_admin_views', @@ -327,9 +344,10 @@ final class Data 'h' => 'component_config', 'i' => 'component_dashboard', 'j' => 'component_files_folders', + 'k' => 'component_modules', 'l' => 'component_plugins', - 'k' => 'component_modules' - ); + 'm' => 'component_router' + ]; // load the joins foreach ($joiners as $as => $join) @@ -382,7 +400,7 @@ final class Data // ensure version naming is correct $this->config->set('component_version', preg_replace( - '/[^0-9.]+/', '', (string) $component->component_version + '/^v/i', '', (string) $component->component_version ) ); @@ -855,6 +873,9 @@ final class Data // set all plugins $this->plugins->set($component); + // set the site router + $this->router->set($component); + // Trigger Event: jcb_ce_onAfterModelComponentData $this->event->trigger( 'jcb_ce_onAfterModelComponentData', @@ -863,7 +884,6 @@ final class Data // return found component data return $component; - } - + } } diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power index 2a10c3b..b89346c 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.power @@ -158,6 +158,14 @@ */ protected Joomlaplugins $plugins; + /** + * The modelling Joomla Site Router + * + * @var Router + * @since 3.2.0 + */ + protected Router $router; + /** * Database object to query local DB * @@ -188,7 +196,7 @@ * @param Updateserver|null $updateserver The modelling update server object. * @param Joomlamodules|null $modules The modelling modules object. * @param Joomlaplugins|null $plugins The modelling plugins object. - * @param \JDatabaseDriver|null $db The database object. + * @param Router|null $router The modelling router object. * * @since 3.2.0 */ @@ -199,7 +207,7 @@ ?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null, ?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null, ?Customadminviews $customadminviews = null, ?Updateserver $updateserver = null, - ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null) + ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null, ?Router $router = null) { $this->config = $config ?: Compiler::_('Config'); $this->event = $event ?: Compiler::_('Event'); @@ -221,6 +229,7 @@ $this->updateserver = $updateserver ?: Compiler::_('Model.Updateserver'); $this->modules = $modules ?: Compiler::_('Model.Joomlamodules'); $this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins'); + $this->router = $router ?: Compiler::_('Model.Router'); $this->db = Factory::getDbo(); } @@ -236,27 +245,34 @@ $query = $this->db->getQuery(true); // selection - $selection = array( - 'b.addadmin_views' => 'addadmin_views', - 'b.id' => 'addadmin_views_id', - 'h.addconfig' => 'addconfig', - 'd.addcustom_admin_views' => 'addcustom_admin_views', - 'g.addcustommenus' => 'addcustommenus', - 'j.addfiles' => 'addfiles', - 'j.addfolders' => 'addfolders', - 'j.addfilesfullpath' => 'addfilesfullpath', - 'j.addfoldersfullpath' => 'addfoldersfullpath', - 'c.addsite_views' => 'addsite_views', - 'l.addjoomla_plugins' => 'addjoomla_plugins', - 'k.addjoomla_modules' => 'addjoomla_modules', - 'i.dashboard_tab' => 'dashboard_tab', - 'i.php_dashboard_methods' => 'php_dashboard_methods', - 'i.params' => 'dashboard_params', - 'i.id' => 'component_dashboard_id', - 'f.sql_tweak' => 'sql_tweak', - 'e.version_update' => 'version_update', - 'e.id' => 'version_update_id' - ); + $selection = [ + 'b.addadmin_views' => 'addadmin_views', + 'b.id' => 'addadmin_views_id', + 'h.addconfig' => 'addconfig', + 'd.addcustom_admin_views' => 'addcustom_admin_views', + 'g.addcustommenus' => 'addcustommenus', + 'j.addfiles' => 'addfiles', + 'j.addfolders' => 'addfolders', + 'j.addfilesfullpath' => 'addfilesfullpath', + 'j.addfoldersfullpath' => 'addfoldersfullpath', + 'c.addsite_views' => 'addsite_views', + 'l.addjoomla_plugins' => 'addjoomla_plugins', + 'k.addjoomla_modules' => 'addjoomla_modules', + 'i.dashboard_tab' => 'dashboard_tab', + 'i.php_dashboard_methods' => 'php_dashboard_methods', + 'i.params' => 'dashboard_params', + 'i.id' => 'component_dashboard_id', + 'f.sql_tweak' => 'sql_tweak', + 'e.version_update' => 'version_update', + 'e.id' => 'version_update_id', + 'm.mode_constructor_before_parent' => 'router_mode_constructor_before_parent', + 'm.mode_constructor_after_parent' => 'router_mode_constructor_after_parent', + 'm.mode_methods' => 'router_mode_methods', + 'm.constructor_before_parent_code' => 'router_constructor_before_parent_code', + 'm.constructor_before_parent_manual' => 'router_constructor_before_parent_manual', + 'm.constructor_after_parent_code' => 'router_constructor_after_parent_code', + 'm.methods_code' => 'router_methods_code' + ]; $query->select('a.*'); $query->select( $this->db->quoteName( @@ -268,7 +284,7 @@ $query->from('#__componentbuilder_joomla_component AS a'); // jointer-map - $joiners = array( + $joiners = [ 'b' => 'component_admin_views', 'c' => 'component_site_views', 'd' => 'component_custom_admin_views', @@ -278,9 +294,10 @@ 'h' => 'component_config', 'i' => 'component_dashboard', 'j' => 'component_files_folders', + 'k' => 'component_modules', 'l' => 'component_plugins', - 'k' => 'component_modules' - ); + 'm' => 'component_router' + ]; // load the joins foreach ($joiners as $as => $join) @@ -333,7 +350,7 @@ // ensure version naming is correct $this->config->set('component_version', preg_replace( - '/[^0-9.]+/', '', (string) $component->component_version + '/^v/i', '', (string) $component->component_version ) ); @@ -806,6 +823,9 @@ // set all plugins $this->plugins->set($component); + // set the site router + $this->router->set($component); + // Trigger Event: jcb_ce_onAfterModelComponentData $this->event->trigger( 'jcb_ce_onAfterModelComponentData', @@ -814,4 +834,4 @@ // return found component data return $component; - } + } \ No newline at end of file diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json index 073d5f7..f69d462 100644 --- a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json @@ -95,18 +95,22 @@ "as": "default" }, "use_selection21": { - "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "use": "402239e6-ceec-4ee0-af62-22d462417bf6", "as": "default" }, "use_selection22": { - "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", "as": "default" }, "use_selection23": { - "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", "as": "default" }, "use_selection24": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection25": { "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", "as": "default" } diff --git a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php index 5e0b85d..ed919e2 100644 --- a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php +++ b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php @@ -196,9 +196,7 @@ class Dispenser implements DispenserInterface $script .= $note; } // load the actual script - $script .= $prefix . str_replace( - array_keys($this->placeholder->active), - array_values($this->placeholder->active), + $script .= $prefix . $this->placeholder->update_( (string) $this->hub[$first][$second] ) . $suffix; // clear some memory diff --git a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.power b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.power index 39a4d58..ebfd838 100644 --- a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.power +++ b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.power @@ -165,9 +165,7 @@ $script .= $note; } // load the actual script - $script .= $prefix . str_replace( - array_keys($this->placeholder->active), - array_values($this->placeholder->active), + $script .= $prefix . $this->placeholder->update_( (string) $this->hub[$first][$second] ) . $suffix; // clear some memory diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php index 3e905ee..9868f0e 100644 --- a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php @@ -350,7 +350,8 @@ class Config extends BaseConfig { return [ 3 => ['folder_key' => 3, 'xml_version' => '3.10'], - 4 => ['folder_key' => 4, 'xml_version' => '4.0'] + 4 => ['folder_key' => 4, 'xml_version' => '4.0'], + 5 => ['folder_key' => 4, 'xml_version' => '5.0'] // for now we build 4 and 5 from same templates ;) ]; } diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power index adbe70e..42aa364 100644 --- a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.power @@ -316,7 +316,8 @@ { return [ 3 => ['folder_key' => 3, 'xml_version' => '3.10'], - 4 => ['folder_key' => 4, 'xml_version' => '4.0'] + 4 => ['folder_key' => 4, 'xml_version' => '4.0'], + 5 => ['folder_key' => 4, 'xml_version' => '5.0'] // for now we build 4 and 5 from same templates ;) ]; } diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md index 2e1b236..7a07a69 100644 --- a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class Customtabs (Details) -> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +# final class Customtabs (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree** ```uml @startuml -class Customtabs #Gold { +class Customtabs << (F,LightGreen) >> #RoyalBlue { # Config $config # BuilderCustomTabs $buildercustomtabs # Language $language diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php index 1df302c..d49e422 100644 --- a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php @@ -9,7 +9,7 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder\Compiler\Model; +namespace VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree; use VDM\Joomla\Componentbuilder\Compiler\Config; @@ -21,6 +21,7 @@ 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; /** @@ -28,7 +29,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; * * @since 3.2.0 */ -class Customtabs +final class Customtabs implements CustomtabsInterface { /** * The Config Class. diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json index f21b878..d604223 100644 --- a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json @@ -3,12 +3,14 @@ "add_licensing_template": "2", "extends": "0", "guid": "fa8c1125-d370-4cb6-a7ff-eb32193c198c", - "implements": null, + "implements": [ + "fcf42c53-0967-4c87-9699-a4d86adfdadf" + ], "load_selection": null, "name": "Customtabs", "power_version": "1.0.0", - "system_name": "JCB.Compiler.Model.Customtabs", - "type": "class", + "system_name": "JCB.Compiler.Model.J3.Customtabs", + "type": "final class", "use_selection": { "use_selection0": { "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", @@ -47,7 +49,7 @@ "as": "default" } }, - "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Customtabs", + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.JoomlaThree.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 \r\n * @git 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": "", diff --git a/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/README.md b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/README.md new file mode 100644 index 0000000..abf3c8c --- /dev/null +++ b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CustomtabsInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model** +```uml +@startuml +interface CustomtabsInterface #Lavender { + + set(object $item) : void +} + +note right of CustomtabsInterface::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) + diff --git a/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.php b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.php new file mode 100644 index 0000000..3252aee --- /dev/null +++ b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.php @@ -0,0 +1,32 @@ + + * @git 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\Interfaces\Model; + + +/** + * Model Custom Tabs Interface + * + * @since 3.2.0 + */ +interface CustomtabsInterface +{ + /** + * Set custom tabs + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item); +} + diff --git a/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.power b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.power new file mode 100644 index 0000000..bfdc718 --- /dev/null +++ b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.power @@ -0,0 +1,9 @@ + /** + * Set custom tabs + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item); \ No newline at end of file diff --git a/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/settings.json b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/settings.json new file mode 100644 index 0000000..cae1bd2 --- /dev/null +++ b/src/fcf42c53-0967-4c87-9699-a4d86adfdadf/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "fcf42c53-0967-4c87-9699-a4d86adfdadf", + "implements": null, + "load_selection": null, + "name": "CustomtabsInterface", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.CustomtabsInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Model.CustomtabsInterface", + "description": "Model Custom Tabs Interface\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 \r\n * @git 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": "" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json index 6f8952f..594efd4 100644 --- a/super-powers.json +++ b/super-powers.json @@ -1,4 +1,15 @@ { + "005fce79-1b62-4a93-8d5e-8c89fee1afc6": { + "name": "AllowAdd", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFive\\Controller", + "code": "src\/005fce79-1b62-4a93-8d5e-8c89fee1afc6\/code.php", + "power": "src\/005fce79-1b62-4a93-8d5e-8c89fee1afc6\/code.power", + "settings": "src\/005fce79-1b62-4a93-8d5e-8c89fee1afc6\/settings.json", + "path": "src\/005fce79-1b62-4a93-8d5e-8c89fee1afc6", + "spk": "Super__005fce79_1b62_4a93_8d5e_8c89fee1afc6__Power", + "guid": "005fce79-1b62-4a93-8d5e-8c89fee1afc6" + }, "007177eb-d39d-4093-8840-07a38811c502": { "name": "Category", "type": "final class", @@ -230,6 +241,17 @@ "spk": "Super__1133c2d7_ba7e_4c95_8cde_01f084d04682__Power", "guid": "1133c2d7-ba7e-4c95-8cde-01f084d04682" }, + "1294a7c7-46fb-4527-a69d-f8db830fd39a": { + "name": "Router", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/1294a7c7-46fb-4527-a69d-f8db830fd39a\/code.php", + "power": "src\/1294a7c7-46fb-4527-a69d-f8db830fd39a\/code.power", + "settings": "src\/1294a7c7-46fb-4527-a69d-f8db830fd39a\/settings.json", + "path": "src\/1294a7c7-46fb-4527-a69d-f8db830fd39a", + "spk": "Super__1294a7c7_46fb_4527_a69d_f8db830fd39a__Power", + "guid": "1294a7c7-46fb-4527-a69d-f8db830fd39a" + }, "12df35ad-2d44-4c4c-a7d5-a3350932a520": { "name": "Groups", "type": "final class", @@ -274,6 +296,17 @@ "spk": "Super__15b4addf_bf6b_4691_9c92_858c7de9c2c1__Power", "guid": "15b4addf-bf6b-4691-9c92-858c7de9c2c1" }, + "163fa7ca-21bd-4e7f-a618-26fe10b870fe": { + "name": "InputButton", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFive", + "code": "src\/163fa7ca-21bd-4e7f-a618-26fe10b870fe\/code.php", + "power": "src\/163fa7ca-21bd-4e7f-a618-26fe10b870fe\/code.power", + "settings": "src\/163fa7ca-21bd-4e7f-a618-26fe10b870fe\/settings.json", + "path": "src\/163fa7ca-21bd-4e7f-a618-26fe10b870fe", + "spk": "Super__163fa7ca_21bd_4e7f_a618_26fe10b870fe__Power", + "guid": "163fa7ca-21bd-4e7f-a618-26fe10b870fe" + }, "17a728e9-d6cf-4060-9efb-241b0ff2f981": { "name": "Historycomponent", "type": "class", @@ -296,6 +329,17 @@ "spk": "Super__17bf80af_3609_4f36_a520_be1a339c278b__Power", "guid": "17bf80af-3609-4f36-a520-be1a339c278b" }, + "17c590ed-8a44-485c-9be8-9a144a6b7429": { + "name": "RouterMethodsDefault", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/17c590ed-8a44-485c-9be8-9a144a6b7429\/code.php", + "power": "src\/17c590ed-8a44-485c-9be8-9a144a6b7429\/code.power", + "settings": "src\/17c590ed-8a44-485c-9be8-9a144a6b7429\/settings.json", + "path": "src\/17c590ed-8a44-485c-9be8-9a144a6b7429", + "spk": "Super__17c590ed_8a44_485c_9be8_9a144a6b7429__Power", + "guid": "17c590ed-8a44-485c-9be8-9a144a6b7429" + }, "17fa7789-a7d1-465e-b733-8c8d53f5ca1b": { "name": "SiteMainGet", "type": "final class", @@ -375,7 +419,7 @@ }, "1d929017-a5de-4e0f-9b5a-838934857e26": { "name": "InstallScript", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Extension\\JoomlaThree", "code": "src\/1d929017-a5de-4e0f-9b5a-838934857e26\/code.php", "power": "src\/1d929017-a5de-4e0f-9b5a-838934857e26\/code.power", @@ -529,7 +573,7 @@ }, "24da9672-e47f-4bb1-b6c0-0ebfc17f0957": { "name": "CoreRule", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaThree", "code": "src\/24da9672-e47f-4bb1-b6c0-0ebfc17f0957\/code.php", "power": "src\/24da9672-e47f-4bb1-b6c0-0ebfc17f0957\/code.power", @@ -562,7 +606,7 @@ }, "25c7ca86-6088-4f5f-b9fe-13504779c6ba": { "name": "History", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFour", "code": "src\/25c7ca86-6088-4f5f-b9fe-13504779c6ba\/code.php", "power": "src\/25c7ca86-6088-4f5f-b9fe-13504779c6ba\/code.power", @@ -660,7 +704,7 @@ "guid": "2bc33733-e900-4a9c-8cb3-c537aa9db785" }, "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7": { - "name": "Builder", + "name": "BuilderLZ", "type": "class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", "code": "src\/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7\/code.php", @@ -758,6 +802,17 @@ "spk": "Super__313b43c4_98c3_4f62_9177_2d73ec8eba31__Power", "guid": "313b43c4-98c3-4f62-9177-2d73ec8eba31" }, + "318a98a3-bb6f-42cb-a000-352d4c848b51": { + "name": "CanEditState", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFive\\Model", + "code": "src\/318a98a3-bb6f-42cb-a000-352d4c848b51\/code.php", + "power": "src\/318a98a3-bb6f-42cb-a000-352d4c848b51\/code.power", + "settings": "src\/318a98a3-bb6f-42cb-a000-352d4c848b51\/settings.json", + "path": "src\/318a98a3-bb6f-42cb-a000-352d4c848b51", + "spk": "Super__318a98a3_bb6f_42cb_a000_352d4c848b51__Power", + "guid": "318a98a3-bb6f-42cb-a000-352d4c848b51" + }, "31c8127c-0d42-4e09-be81-7cf243c5b30f": { "name": "ConfigFieldsetsGooglechart", "type": "final class", @@ -835,6 +890,17 @@ "spk": "Super__3468b447_a929_4c28_84a1_f2c3a27e3127__Power", "guid": "3468b447-a929-4c28-84a1-f2c3a27e3127" }, + "34df20ec-67db-4e7e-be61-fb94d360c408": { + "name": "CanDelete", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFive\\Model", + "code": "src\/34df20ec-67db-4e7e-be61-fb94d360c408\/code.php", + "power": "src\/34df20ec-67db-4e7e-be61-fb94d360c408\/code.power", + "settings": "src\/34df20ec-67db-4e7e-be61-fb94d360c408\/settings.json", + "path": "src\/34df20ec-67db-4e7e-be61-fb94d360c408", + "spk": "Super__34df20ec_67db_4e7e_be61_fb94d360c408__Power", + "guid": "34df20ec-67db-4e7e-be61-fb94d360c408" + }, "35191b0c-f7f3-44d6-8ec1-c816b997bd4e": { "name": "Mysqlsettings", "type": "class", @@ -945,6 +1011,17 @@ "spk": "Super__3f83fe11_1ef6_4020_bd73_f3bb58cefe3a__Power", "guid": "3f83fe11-1ef6-4020-bd73-f3bb58cefe3a" }, + "402239e6-ceec-4ee0-af62-22d462417bf6": { + "name": "Router", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/402239e6-ceec-4ee0-af62-22d462417bf6\/code.php", + "power": "src\/402239e6-ceec-4ee0-af62-22d462417bf6\/code.power", + "settings": "src\/402239e6-ceec-4ee0-af62-22d462417bf6\/settings.json", + "path": "src\/402239e6-ceec-4ee0-af62-22d462417bf6", + "spk": "Super__402239e6_ceec_4ee0_af62_22d462417bf6__Power", + "guid": "402239e6-ceec-4ee0-af62-22d462417bf6" + }, "425b1107-933d-4436-87ac-63540ec101c5": { "name": "AllowAdd", "type": "final class", @@ -956,6 +1033,17 @@ "spk": "Super__425b1107_933d_4436_87ac_63540ec101c5__Power", "guid": "425b1107-933d-4436-87ac-63540ec101c5" }, + "42648fb4-dfdc-4986-a180-69e5726a25c4": { + "name": "Customtabs", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model\\JoomlaFour", + "code": "src\/42648fb4-dfdc-4986-a180-69e5726a25c4\/code.php", + "power": "src\/42648fb4-dfdc-4986-a180-69e5726a25c4\/code.power", + "settings": "src\/42648fb4-dfdc-4986-a180-69e5726a25c4\/settings.json", + "path": "src\/42648fb4-dfdc-4986-a180-69e5726a25c4", + "spk": "Super__42648fb4_dfdc_4986_a180_69e5726a25c4__Power", + "guid": "42648fb4-dfdc-4986-a180-69e5726a25c4" + }, "4325745f-da1f-4d4d-a591-3189fe8c06e5": { "name": "HistoryInterface", "type": "interface", @@ -969,7 +1057,7 @@ }, "43f46bb2-ab6d-47c7-9fd9-f1745a3576fb": { "name": "CoreRule", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFour", "code": "src\/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb\/code.php", "power": "src\/43f46bb2-ab6d-47c7-9fd9-f1745a3576fb\/code.power", @@ -1024,7 +1112,7 @@ }, "4729c2b0-f12b-4397-8d77-055d38bca98b": { "name": "Event", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFour", "code": "src\/4729c2b0-f12b-4397-8d77-055d38bca98b\/code.php", "power": "src\/4729c2b0-f12b-4397-8d77-055d38bca98b\/code.power", @@ -1066,6 +1154,17 @@ "spk": "Super__489da602_27c7_418c_bf59_1d45ad42bdcc__Power", "guid": "489da602-27c7-418c-bf59-1d45ad42bdcc" }, + "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5": { + "name": "Router", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5\/code.php", + "power": "src\/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5\/code.power", + "settings": "src\/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5\/settings.json", + "path": "src\/4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5", + "spk": "Super__4a4cf7a3_d0f9_439e_96fb_82d7a4ae0cf5__Power", + "guid": "4a4cf7a3-d0f9-439e-96fb-82d7a4ae0cf5" + }, "4a857023-2d96-4649-9ed5-910d0329854d": { "name": "Lists", "type": "final class", @@ -1090,7 +1189,7 @@ }, "4b86f62e-ce41-4325-a11a-08148807d0df": { "name": "Event", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaThree", "code": "src\/4b86f62e-ce41-4325-a11a-08148807d0df\/code.php", "power": "src\/4b86f62e-ce41-4325-a11a-08148807d0df\/code.power", @@ -1099,6 +1198,17 @@ "spk": "Super__4b86f62e_ce41_4325_a11a_08148807d0df__Power", "guid": "4b86f62e-ce41-4325-a11a-08148807d0df" }, + "4c143764-1b84-4b9f-86c5-8de119b26f1a": { + "name": "CoreField", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFive", + "code": "src\/4c143764-1b84-4b9f-86c5-8de119b26f1a\/code.php", + "power": "src\/4c143764-1b84-4b9f-86c5-8de119b26f1a\/code.power", + "settings": "src\/4c143764-1b84-4b9f-86c5-8de119b26f1a\/settings.json", + "path": "src\/4c143764-1b84-4b9f-86c5-8de119b26f1a", + "spk": "Super__4c143764_1b84_4b9f_86c5_8de119b26f1a__Power", + "guid": "4c143764-1b84-4b9f-86c5-8de119b26f1a" + }, "4e6ff11d-bebf-42f5-8fd7-b2f882857222": { "name": "Line", "type": "abstract class", @@ -1407,6 +1517,17 @@ "spk": "Super__600515b1_493f_4448_96fe_018e54e087c8__Power", "guid": "600515b1-493f-4448-96fe-018e54e087c8" }, + "6034587d-82a3-4b19-ac58-40507f79122a": { + "name": "RouterMethodsManual", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/6034587d-82a3-4b19-ac58-40507f79122a\/code.php", + "power": "src\/6034587d-82a3-4b19-ac58-40507f79122a\/code.power", + "settings": "src\/6034587d-82a3-4b19-ac58-40507f79122a\/settings.json", + "path": "src\/6034587d-82a3-4b19-ac58-40507f79122a", + "spk": "Super__6034587d_82a3_4b19_ac58_40507f79122a__Power", + "guid": "6034587d-82a3-4b19-ac58-40507f79122a" + }, "63782f74-7b03-4745-aa40-0adf8ed4e704": { "name": "History", "type": "class", @@ -1473,6 +1594,17 @@ "spk": "Super__6992384f_4f29_489f_a52e_286e03f4593b__Power", "guid": "6992384f-4f29-489f-a52e-286e03f4593b" }, + "69d2b980-a665-48cd-96f8-757bf3810b41": { + "name": "Settings", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component\\JoomlaFive", + "code": "src\/69d2b980-a665-48cd-96f8-757bf3810b41\/code.php", + "power": "src\/69d2b980-a665-48cd-96f8-757bf3810b41\/code.power", + "settings": "src\/69d2b980-a665-48cd-96f8-757bf3810b41\/settings.json", + "path": "src\/69d2b980-a665-48cd-96f8-757bf3810b41", + "spk": "Super__69d2b980_a665_48cd_96f8_757bf3810b41__Power", + "guid": "69d2b980-a665-48cd-96f8-757bf3810b41" + }, "6a1dddb3-a955-425e-b713-8ef81f256035": { "name": "Title", "type": "final class", @@ -1605,6 +1737,17 @@ "spk": "Super__7243aaf6_b76c_4391_8698_50abbfc98fbe__Power", "guid": "7243aaf6-b76c-4391-8698-50abbfc98fbe" }, + "73183d13-9b2e-4879-b05a-52298d5b31f7": { + "name": "InstallScript", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Extension\\JoomlaFive", + "code": "src\/73183d13-9b2e-4879-b05a-52298d5b31f7\/code.php", + "power": "src\/73183d13-9b2e-4879-b05a-52298d5b31f7\/code.power", + "settings": "src\/73183d13-9b2e-4879-b05a-52298d5b31f7\/settings.json", + "path": "src\/73183d13-9b2e-4879-b05a-52298d5b31f7", + "spk": "Super__73183d13_9b2e_4879_b05a_52298d5b31f7__Power", + "guid": "73183d13-9b2e-4879-b05a-52298d5b31f7" + }, "7415fdb4-5719-40b7-b01f-05588e968b47": { "name": "LayoutData", "type": "final class", @@ -1660,6 +1803,17 @@ "spk": "Super__766a9524_37df_4604_91a7_b98a6150ee26__Power", "guid": "766a9524-37df-4604-91a7-b98a6150ee26" }, + "77224dc6-8024-47eb-896e-18ec3aa23420": { + "name": "Event", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFive", + "code": "src\/77224dc6-8024-47eb-896e-18ec3aa23420\/code.php", + "power": "src\/77224dc6-8024-47eb-896e-18ec3aa23420\/code.power", + "settings": "src\/77224dc6-8024-47eb-896e-18ec3aa23420\/settings.json", + "path": "src\/77224dc6-8024-47eb-896e-18ec3aa23420", + "spk": "Super__77224dc6_8024_47eb_896e_18ec3aa23420__Power", + "guid": "77224dc6-8024-47eb-896e-18ec3aa23420" + }, "79739667-72c6-4576-9830-7b1eb92e4791": { "name": "FieldsetXML", "type": "final class", @@ -1838,7 +1992,7 @@ }, "87db51b9-1126-4c21-858b-53dbd3a68b61": { "name": "History", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaThree", "code": "src\/87db51b9-1126-4c21-858b-53dbd3a68b61\/code.php", "power": "src\/87db51b9-1126-4c21-858b-53dbd3a68b61\/code.power", @@ -1880,6 +2034,28 @@ "spk": "Super__8a63e87b_b39b_4a15_8044_9b2a2f4fb61c__Power", "guid": "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c" }, + "8ab6fe75-ba5a-4316-9ef8-1eccceec813f": { + "name": "History", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFive", + "code": "src\/8ab6fe75-ba5a-4316-9ef8-1eccceec813f\/code.php", + "power": "src\/8ab6fe75-ba5a-4316-9ef8-1eccceec813f\/code.power", + "settings": "src\/8ab6fe75-ba5a-4316-9ef8-1eccceec813f\/settings.json", + "path": "src\/8ab6fe75-ba5a-4316-9ef8-1eccceec813f", + "spk": "Super__8ab6fe75_ba5a_4316_9ef8_1eccceec813f__Power", + "guid": "8ab6fe75-ba5a-4316-9ef8-1eccceec813f" + }, + "8b56b62d-b960-4823-b9bb-c71675a71b85": { + "name": "CoreRule", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFive", + "code": "src\/8b56b62d-b960-4823-b9bb-c71675a71b85\/code.php", + "power": "src\/8b56b62d-b960-4823-b9bb-c71675a71b85\/code.power", + "settings": "src\/8b56b62d-b960-4823-b9bb-c71675a71b85\/settings.json", + "path": "src\/8b56b62d-b960-4823-b9bb-c71675a71b85", + "spk": "Super__8b56b62d_b960_4823_b9bb_c71675a71b85__Power", + "guid": "8b56b62d-b960-4823-b9bb-c71675a71b85" + }, "8bf026e7-9ae0-423c-b74b-5bc16c54acf7": { "name": "CustomButtonPermissions", "type": "final class", @@ -1979,6 +2155,17 @@ "spk": "Super__9127e428_5dee_46cb_b3a9_ab5b91ea6df3__Power", "guid": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3" }, + "92cc3144-1d3d-45b2-b49f-c7d356950033": { + "name": "Customtabs", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model\\JoomlaFive", + "code": "src\/92cc3144-1d3d-45b2-b49f-c7d356950033\/code.php", + "power": "src\/92cc3144-1d3d-45b2-b49f-c7d356950033\/code.power", + "settings": "src\/92cc3144-1d3d-45b2-b49f-c7d356950033\/settings.json", + "path": "src\/92cc3144-1d3d-45b2-b49f-c7d356950033", + "spk": "Super__92cc3144_1d3d_45b2_b49f_c7d356950033__Power", + "guid": "92cc3144-1d3d-45b2-b49f-c7d356950033" + }, "9387215f-a965-4421-acf3-5e8f9d11382f": { "name": "Name", "type": "class", @@ -2056,6 +2243,17 @@ "spk": "Super__95d0e03f_24fd_4412_bc2e_f0899fcc3205__Power", "guid": "95d0e03f-24fd-4412-bc2e-f0899fcc3205" }, + "95deb809-5f43-400b-939f-f9ceef720b13": { + "name": "Header", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaFive", + "code": "src\/95deb809-5f43-400b-939f-f9ceef720b13\/code.php", + "power": "src\/95deb809-5f43-400b-939f-f9ceef720b13\/code.power", + "settings": "src\/95deb809-5f43-400b-939f-f9ceef720b13\/settings.json", + "path": "src\/95deb809-5f43-400b-939f-f9ceef720b13", + "spk": "Super__95deb809_5f43_400b_939f_f9ceef720b13__Power", + "guid": "95deb809-5f43-400b-939f-f9ceef720b13" + }, "961a2a2e-9f95-4b5f-b1c0-62ee783f9c66": { "name": "FieldNames", "type": "final class", @@ -2375,6 +2573,17 @@ "spk": "Super__a74ac3b7_bb79_4639_8f14_54a8021be68b__Power", "guid": "a74ac3b7-bb79-4639-8f14-54a8021be68b" }, + "a7fc4913-6b1a-4eea-a168-fceb75fcf6ac": { + "name": "DatabaseUninstall", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder", + "code": "src\/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac\/code.php", + "power": "src\/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac\/code.power", + "settings": "src\/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac\/settings.json", + "path": "src\/a7fc4913-6b1a-4eea-a168-fceb75fcf6ac", + "spk": "Super__a7fc4913_6b1a_4eea_a168_fceb75fcf6ac__Power", + "guid": "a7fc4913-6b1a-4eea-a168-fceb75fcf6ac" + }, "a85451d3-a5c5-446a-90ae-0cf715a16d94": { "name": "Permission", "type": "final class", @@ -2751,7 +2960,7 @@ }, "c6818275-cdf7-4fce-a365-90d95a77a71c": { "name": "CoreField", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaFour", "code": "src\/c6818275-cdf7-4fce-a365-90d95a77a71c\/code.php", "power": "src\/c6818275-cdf7-4fce-a365-90d95a77a71c\/code.power", @@ -2782,6 +2991,17 @@ "spk": "Super__c6de9da0_1a73_4c73_b355_7fe02efe4c9d__Power", "guid": "c6de9da0-1a73-4c73-b355-7fe02efe4c9d" }, + "c7230c8c-ea88-4d8d-8c53-6136133195b7": { + "name": "BuilderAJ", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/c7230c8c-ea88-4d8d-8c53-6136133195b7\/code.php", + "power": "src\/c7230c8c-ea88-4d8d-8c53-6136133195b7\/code.power", + "settings": "src\/c7230c8c-ea88-4d8d-8c53-6136133195b7\/settings.json", + "path": "src\/c7230c8c-ea88-4d8d-8c53-6136133195b7", + "spk": "Super__c7230c8c_ea88_4d8d_8c53_6136133195b7__Power", + "guid": "c7230c8c-ea88-4d8d-8c53-6136133195b7" + }, "c72692b0-0a0f-412a-b05b-80002cbf886a": { "name": "ClassInjector", "type": "final class", @@ -2993,7 +3213,7 @@ }, "d42e1fac-3c05-4a22-8878-2abd43019811": { "name": "InstallScript", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Extension\\JoomlaFour", "code": "src\/d42e1fac-3c05-4a22-8878-2abd43019811\/code.php", "power": "src\/d42e1fac-3c05-4a22-8878-2abd43019811\/code.power", @@ -3255,6 +3475,17 @@ "spk": "Super__e50cbac5_9c9d_4fd4_aa7a_5e830719ed26__Power", "guid": "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26" }, + "e5278bf3-6dfb-42a0-b699-148b5ab8e45f": { + "name": "RouterConstructorDefault", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/e5278bf3-6dfb-42a0-b699-148b5ab8e45f\/code.php", + "power": "src\/e5278bf3-6dfb-42a0-b699-148b5ab8e45f\/code.power", + "settings": "src\/e5278bf3-6dfb-42a0-b699-148b5ab8e45f\/settings.json", + "path": "src\/e5278bf3-6dfb-42a0-b699-148b5ab8e45f", + "spk": "Super__e5278bf3_6dfb_42a0_b699_148b5ab8e45f__Power", + "guid": "e5278bf3-6dfb-42a0-b699-148b5ab8e45f" + }, "e543c123-b1d9-4a0b-83b2-a9d371da5ff3": { "name": "Update", "type": "final class", @@ -3290,7 +3521,7 @@ }, "e6683873-b74e-4b54-8466-69f8a9282033": { "name": "CoreField", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaThree", "code": "src\/e6683873-b74e-4b54-8466-69f8a9282033\/code.php", "power": "src\/e6683873-b74e-4b54-8466-69f8a9282033\/code.power", @@ -3354,6 +3585,17 @@ "spk": "Super__e7fff971_b031_42bf_8009_ef554e30854d__Power", "guid": "e7fff971-b031-42bf-8009-ef554e30854d" }, + "e85175fd-e297-46df-a497-27f7a37190fd": { + "name": "AllowEdit", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Architecture\\JoomlaFive\\Controller", + "code": "src\/e85175fd-e297-46df-a497-27f7a37190fd\/code.php", + "power": "src\/e85175fd-e297-46df-a497-27f7a37190fd\/code.power", + "settings": "src\/e85175fd-e297-46df-a497-27f7a37190fd\/settings.json", + "path": "src\/e85175fd-e297-46df-a497-27f7a37190fd", + "spk": "Super__e85175fd_e297_46df_a497_27f7a37190fd__Power", + "guid": "e85175fd-e297-46df-a497-27f7a37190fd" + }, "e9b6b06b-f600-4f9d-984d-79c70ae7ae92": { "name": "ExtensionCustomFields", "type": "final class", @@ -3409,6 +3651,17 @@ "spk": "Super__ec0682ee_9166_48f8_951b_9b763792c1d1__Power", "guid": "ec0682ee-9166-48f8-951b-9b763792c1d1" }, + "ec7bdbf9-8377-446e-9f40-64e23ae96b59": { + "name": "RouterConstructorManual", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Creator", + "code": "src\/ec7bdbf9-8377-446e-9f40-64e23ae96b59\/code.php", + "power": "src\/ec7bdbf9-8377-446e-9f40-64e23ae96b59\/code.power", + "settings": "src\/ec7bdbf9-8377-446e-9f40-64e23ae96b59\/settings.json", + "path": "src\/ec7bdbf9-8377-446e-9f40-64e23ae96b59", + "spk": "Super__ec7bdbf9_8377_446e_9f40_64e23ae96b59__Power", + "guid": "ec7bdbf9-8377-446e-9f40-64e23ae96b59" + }, "ed314bd8-c995-4282-bcaa-5e0a68ac401b": { "name": "ConfigFieldsetsCustomfield", "type": "final class", @@ -3598,8 +3851,8 @@ }, "fa8c1125-d370-4cb6-a7ff-eb32193c198c": { "name": "Customtabs", - "type": "class", - "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model\\JoomlaThree", "code": "src\/fa8c1125-d370-4cb6-a7ff-eb32193c198c\/code.php", "power": "src\/fa8c1125-d370-4cb6-a7ff-eb32193c198c\/code.power", "settings": "src\/fa8c1125-d370-4cb6-a7ff-eb32193c198c\/settings.json", @@ -3607,6 +3860,17 @@ "spk": "Super__fa8c1125_d370_4cb6_a7ff_eb32193c198c__Power", "guid": "fa8c1125-d370-4cb6-a7ff-eb32193c198c" }, + "fcf42c53-0967-4c87-9699-a4d86adfdadf": { + "name": "CustomtabsInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Model", + "code": "src\/fcf42c53-0967-4c87-9699-a4d86adfdadf\/code.php", + "power": "src\/fcf42c53-0967-4c87-9699-a4d86adfdadf\/code.power", + "settings": "src\/fcf42c53-0967-4c87-9699-a4d86adfdadf\/settings.json", + "path": "src\/fcf42c53-0967-4c87-9699-a4d86adfdadf", + "spk": "Super__fcf42c53_0967_4c87_9699_a4d86adfdadf__Power", + "guid": "fcf42c53-0967-4c87-9699-a4d86adfdadf" + }, "fd885c23-88dd-440a-9b05-d02a2b2962f9": { "name": "OtherWhere", "type": "final class",