update 2024-01-27
This commit is contained in:
parent
3e3cd1e212
commit
c7492eb08e
87
README.md
87
README.md
@ -64,12 +64,16 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **final class AccessSwitchList** | [Details](src/81212121-ad5c-43c5-b046-f2650864f690) | [Code](src/81212121-ad5c-43c5-b046-f2650864f690/code.php) | [Settings](src/81212121-ad5c-43c5-b046-f2650864f690/settings.json) | Super__81212121_ad5c_43c5_b046_f2650864f690__Power
|
||||
- **final class AdminFilterType** | [Details](src/9481caa2-6d04-4598-8320-543a93927243) | [Code](src/9481caa2-6d04-4598-8320-543a93927243/code.php) | [Settings](src/9481caa2-6d04-4598-8320-543a93927243/settings.json) | Super__9481caa2_6d04_4598_8320_543a93927243__Power
|
||||
- **final class Alias** | [Details](src/fe87df7f-b65f-4778-8875-6122ab6b025f) | [Code](src/fe87df7f-b65f-4778-8875-6122ab6b025f/code.php) | [Settings](src/fe87df7f-b65f-4778-8875-6122ab6b025f/settings.json) | Super__fe87df7f_b65f_4778_8875_6122ab6b025f__Power
|
||||
- **final class AssetsRules** | [Details](src/9b5872d6-c1d8-4602-b443-5844d2c950ee) | [Code](src/9b5872d6-c1d8-4602-b443-5844d2c950ee/code.php) | [Settings](src/9b5872d6-c1d8-4602-b443-5844d2c950ee/settings.json) | Super__9b5872d6_c1d8_4602_b443_5844d2c950ee__Power
|
||||
- **final class BaseSixFour** | [Details](src/b8b474d4-30e3-4b5a-9988-3adb3450998c) | [Code](src/b8b474d4-30e3-4b5a-9988-3adb3450998c/code.php) | [Settings](src/b8b474d4-30e3-4b5a-9988-3adb3450998c/settings.json) | Super__b8b474d4_30e3_4b5a_9988_3adb3450998c__Power
|
||||
- **final class Category** | [Details](src/007177eb-d39d-4093-8840-07a38811c502) | [Code](src/007177eb-d39d-4093-8840-07a38811c502/code.php) | [Settings](src/007177eb-d39d-4093-8840-07a38811c502/settings.json) | Super__007177eb_d39d_4093_8840_07a38811c502__Power
|
||||
- **final class CategoryCode** | [Details](src/b24f5184-7e7c-448d-9475-ff3f998f70c3) | [Code](src/b24f5184-7e7c-448d-9475-ff3f998f70c3/code.php) | [Settings](src/b24f5184-7e7c-448d-9475-ff3f998f70c3/settings.json) | Super__b24f5184_7e7c_448d_9475_ff3f998f70c3__Power
|
||||
- **final class CategoryOtherName** | [Details](src/a1e551a9-8369-48c9-a076-4e5beb65e0df) | [Code](src/a1e551a9-8369-48c9-a076-4e5beb65e0df/code.php) | [Settings](src/a1e551a9-8369-48c9-a076-4e5beb65e0df/settings.json) | Super__a1e551a9_8369_48c9_a076_4e5beb65e0df__Power
|
||||
- **final class CheckBox** | [Details](src/8561f1f6-96c7-4e54-8869-0132116d57ce) | [Code](src/8561f1f6-96c7-4e54-8869-0132116d57ce/code.php) | [Settings](src/8561f1f6-96c7-4e54-8869-0132116d57ce/settings.json) | Super__8561f1f6_96c7_4e54_8869_0132116d57ce__Power
|
||||
- **final class ComponentFields** | [Details](src/3230dd65-6590-4043-9bb8-bebd6d8224b2) | [Code](src/3230dd65-6590-4043-9bb8-bebd6d8224b2/code.php) | [Settings](src/3230dd65-6590-4043-9bb8-bebd6d8224b2/settings.json) | Super__3230dd65_6590_4043_9bb8_bebd6d8224b2__Power
|
||||
- **final class ConfigFieldsets** | [Details](src/0a524af3-f647-4f62-a422-d7d36ebe749b) | [Code](src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php) | [Settings](src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json) | Super__0a524af3_f647_4f62_a422_d7d36ebe749b__Power
|
||||
- **final class ConfigFieldsetsCustomfield** | [Details](src/ed314bd8-c995-4282-bcaa-5e0a68ac401b) | [Code](src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/code.php) | [Settings](src/ed314bd8-c995-4282-bcaa-5e0a68ac401b/settings.json) | Super__ed314bd8_c995_4282_bcaa_5e0a68ac401b__Power
|
||||
- **final class Contributors** | [Details](src/274a78d1-24c2-4486-b560-b86e9ae72872) | [Code](src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php) | [Settings](src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json) | Super__274a78d1_24c2_4486_b560_b86e9ae72872__Power
|
||||
- **final class CustomAlias** | [Details](src/9d74d613-5ef7-4cf1-9f12-64f0a8e19806) | [Code](src/9d74d613-5ef7-4cf1-9f12-64f0a8e19806/code.php) | [Settings](src/9d74d613-5ef7-4cf1-9f12-64f0a8e19806/settings.json) | Super__9d74d613_5ef7_4cf1_9f12_64f0a8e19806__Power
|
||||
- **final class CustomField** | [Details](src/87d1da23-08d6-4fbf-bd0d-b746da240b8a) | [Code](src/87d1da23-08d6-4fbf-bd0d-b746da240b8a/code.php) | [Settings](src/87d1da23-08d6-4fbf-bd0d-b746da240b8a/settings.json) | Super__87d1da23_08d6_4fbf_bd0d_b746da240b8a__Power
|
||||
- **final class CustomFieldLinks** | [Details](src/a4857c60-680c-4e0c-ae8f-9250a7b5e317) | [Code](src/a4857c60-680c-4e0c-ae8f-9250a7b5e317/code.php) | [Settings](src/a4857c60-680c-4e0c-ae8f-9250a7b5e317/settings.json) | Super__a4857c60_680c_4e0c_ae8f_9250a7b5e317__Power
|
||||
@ -82,14 +86,17 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **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
|
||||
- **final class DynamicFields** | [Details](src/1ae9a8e8-59f7-4844-a08d-9a4dce4be076) | [Code](src/1ae9a8e8-59f7-4844-a08d-9a4dce4be076/code.php) | [Settings](src/1ae9a8e8-59f7-4844-a08d-9a4dce4be076/settings.json) | Super__1ae9a8e8_59f7_4844_a08d_9a4dce4be076__Power
|
||||
- **final class ExtensionCustomFields** | [Details](src/e9b6b06b-f600-4f9d-984d-79c70ae7ae92) | [Code](src/e9b6b06b-f600-4f9d-984d-79c70ae7ae92/code.php) | [Settings](src/e9b6b06b-f600-4f9d-984d-79c70ae7ae92/settings.json) | Super__e9b6b06b_f600_4f9d_984d_79c70ae7ae92__Power
|
||||
- **final class ExtensionsParams** | [Details](src/bcf1e767-1566-440d-9f67-5c1bada934fa) | [Code](src/bcf1e767-1566-440d-9f67-5c1bada934fa/code.php) | [Settings](src/bcf1e767-1566-440d-9f67-5c1bada934fa/settings.json) | Super__bcf1e767_1566_440d_9f67_5c1bada934fa__Power
|
||||
- **final class FieldGroupControl** | [Details](src/d5530adf-c809-45a9-87fc-7cecd3d972d8) | [Code](src/d5530adf-c809-45a9-87fc-7cecd3d972d8/code.php) | [Settings](src/d5530adf-c809-45a9-87fc-7cecd3d972d8/settings.json) | Super__d5530adf_c809_45a9_87fc_7cecd3d972d8__Power
|
||||
- **final class FieldNames** | [Details](src/961a2a2e-9f95-4b5f-b1c0-62ee783f9c66) | [Code](src/961a2a2e-9f95-4b5f-b1c0-62ee783f9c66/code.php) | [Settings](src/961a2a2e-9f95-4b5f-b1c0-62ee783f9c66/settings.json) | Super__961a2a2e_9f95_4b5f_b1c0_62ee783f9c66__Power
|
||||
- **final class FieldRelations** | [Details](src/a090a472-eb3d-4086-a6d5-4215e1b1851f) | [Code](src/a090a472-eb3d-4086-a6d5-4215e1b1851f/code.php) | [Settings](src/a090a472-eb3d-4086-a6d5-4215e1b1851f/settings.json) | Super__a090a472_eb3d_4086_a6d5_4215e1b1851f__Power
|
||||
- **final class Filter** | [Details](src/e4e65c5b-00ec-439c-96bf-3153c3a73398) | [Code](src/e4e65c5b-00ec-439c-96bf-3153c3a73398/code.php) | [Settings](src/e4e65c5b-00ec-439c-96bf-3153c3a73398/settings.json) | Super__e4e65c5b_00ec_439c_96bf_3153c3a73398__Power
|
||||
- **final class FootableScripts** | [Details](src/dba0776e-e582-4f73-af3e-e7ed17bc34b3) | [Code](src/dba0776e-e582-4f73-af3e-e7ed17bc34b3/code.php) | [Settings](src/dba0776e-e582-4f73-af3e-e7ed17bc34b3/settings.json) | Super__dba0776e_e582_4f73_af3e_e7ed17bc34b3__Power
|
||||
- **final class FrontendParams** | [Details](src/207b5ef3-b3bb-45bf-af14-4572e296d761) | [Code](src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php) | [Settings](src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json) | Super__207b5ef3_b3bb_45bf_af14_4572e296d761__Power
|
||||
- **final class GetAsLookup** | [Details](src/8f46f85d-7921-44e9-a40e-dc4f01c5d43a) | [Code](src/8f46f85d-7921-44e9-a40e-dc4f01c5d43a/code.php) | [Settings](src/8f46f85d-7921-44e9-a40e-dc4f01c5d43a/settings.json) | Super__8f46f85d_7921_44e9_a40e_dc4f01c5d43a__Power
|
||||
- **final class GetModule** | [Details](src/c7b6f0d5-ec47-4166-915c-e78d49b4fb63) | [Code](src/c7b6f0d5-ec47-4166-915c-e78d49b4fb63/code.php) | [Settings](src/c7b6f0d5-ec47-4166-915c-e78d49b4fb63/settings.json) | Super__c7b6f0d5_ec47_4166_915c_e78d49b4fb63__Power
|
||||
- **final class GoogleChart** | [Details](src/507ab90f-7d64-4697-9815-d96f5d1d1185) | [Code](src/507ab90f-7d64-4697-9815-d96f5d1d1185/code.php) | [Settings](src/507ab90f-7d64-4697-9815-d96f5d1d1185/settings.json) | Super__507ab90f_7d64_4697_9815_d96f5d1d1185__Power
|
||||
- **final class HasMenuGlobal** | [Details](src/6992384f-4f29-489f-a52e-286e03f4593b) | [Code](src/6992384f-4f29-489f-a52e-286e03f4593b/code.php) | [Settings](src/6992384f-4f29-489f-a52e-286e03f4593b/settings.json) | Super__6992384f_4f29_489f_a52e_286e03f4593b__Power
|
||||
- **final class HasPermissions** | [Details](src/e54965e7-34fd-481e-b40c-4da089afec5a) | [Code](src/e54965e7-34fd-481e-b40c-4da089afec5a/code.php) | [Settings](src/e54965e7-34fd-481e-b40c-4da089afec5a/settings.json) | Super__e54965e7_34fd_481e_b40c_4da089afec5a__Power
|
||||
- **final class HiddenFields** | [Details](src/0b45357f-b077-4337-92f3-65c1e19d36cd) | [Code](src/0b45357f-b077-4337-92f3-65c1e19d36cd/code.php) | [Settings](src/0b45357f-b077-4337-92f3-65c1e19d36cd/settings.json) | Super__0b45357f_b077_4337_92f3_65c1e19d36cd__Power
|
||||
- **final class History** | [Details](src/2cb33994-052e-42dd-adbc-3ea9f932816f) | [Code](src/2cb33994-052e-42dd-adbc-3ea9f932816f/code.php) | [Settings](src/2cb33994-052e-42dd-adbc-3ea9f932816f/settings.json) | Super__2cb33994_052e_42dd_adbc_3ea9f932816f__Power
|
||||
@ -99,6 +106,7 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **final class JsonItem** | [Details](src/45652787-9085-4c67-914f-0da25ae62646) | [Code](src/45652787-9085-4c67-914f-0da25ae62646/code.php) | [Settings](src/45652787-9085-4c67-914f-0da25ae62646/settings.json) | Super__45652787_9085_4c67_914f_0da25ae62646__Power
|
||||
- **final class JsonItemArray** | [Details](src/6b386f2e-3eb1-4f60-81af-a90c8da1ffeb) | [Code](src/6b386f2e-3eb1-4f60-81af-a90c8da1ffeb/code.php) | [Settings](src/6b386f2e-3eb1-4f60-81af-a90c8da1ffeb/settings.json) | Super__6b386f2e_3eb1_4f60_81af_a90c8da1ffeb__Power
|
||||
- **final class JsonString** | [Details](src/bb26cf63-69a5-4c43-b2df-43284c9d907d) | [Code](src/bb26cf63-69a5-4c43-b2df-43284c9d907d/code.php) | [Settings](src/bb26cf63-69a5-4c43-b2df-43284c9d907d/settings.json) | Super__bb26cf63_69a5_4c43_b2df_43284c9d907d__Power
|
||||
- **final class LanguageMessages** | [Details](src/44efa649-736d-4656-a0ec-e4f1653a6742) | [Code](src/44efa649-736d-4656-a0ec-e4f1653a6742/code.php) | [Settings](src/44efa649-736d-4656-a0ec-e4f1653a6742/settings.json) | Super__44efa649_736d_4656_a0ec_e4f1653a6742__Power
|
||||
- **final class Layout** | [Details](src/a90a2495-9c26-446c-867e-9ee8f42fb6af) | [Code](src/a90a2495-9c26-446c-867e-9ee8f42fb6af/code.php) | [Settings](src/a90a2495-9c26-446c-867e-9ee8f42fb6af/settings.json) | Super__a90a2495_9c26_446c_867e_9ee8f42fb6af__Power
|
||||
- **final class LayoutData** | [Details](src/7415fdb4-5719-40b7-b01f-05588e968b47) | [Code](src/7415fdb4-5719-40b7-b01f-05588e968b47/code.php) | [Settings](src/7415fdb4-5719-40b7-b01f-05588e968b47/settings.json) | Super__7415fdb4_5719_40b7_b01f_05588e968b47__Power
|
||||
- **final class LibraryManager** | [Details](src/e696927b-e8f4-4cfc-9d25-215db4e3c7a8) | [Code](src/e696927b-e8f4-4cfc-9d25-215db4e3c7a8/code.php) | [Settings](src/e696927b-e8f4-4cfc-9d25-215db4e3c7a8/settings.json) | Super__e696927b_e8f4_4cfc_9d25_215db4e3c7a8__Power
|
||||
@ -127,8 +135,10 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **final class PermissionComponent** | [Details](src/94f4939f-82cc-4196-802b-1346ce5c7f99) | [Code](src/94f4939f-82cc-4196-802b-1346ce5c7f99/code.php) | [Settings](src/94f4939f-82cc-4196-802b-1346ce5c7f99/settings.json) | Super__94f4939f_82cc_4196_802b_1346ce5c7f99__Power
|
||||
- **final class PermissionCore** | [Details](src/5e3d856d-8174-4131-b4e9-9328066438e1) | [Code](src/5e3d856d-8174-4131-b4e9-9328066438e1/code.php) | [Settings](src/5e3d856d-8174-4131-b4e9-9328066438e1/settings.json) | Super__5e3d856d_8174_4131_b4e9_9328066438e1__Power
|
||||
- **final class PermissionDashboard** | [Details](src/e046b530-47fe-406f-b45a-b5eec8cbb238) | [Code](src/e046b530-47fe-406f-b45a-b5eec8cbb238/code.php) | [Settings](src/e046b530-47fe-406f-b45a-b5eec8cbb238/settings.json) | Super__e046b530_47fe_406f_b45a_b5eec8cbb238__Power
|
||||
- **final class PermissionFields** | [Details](src/5133a033-1351-43ec-9692-2907d7b9aacd) | [Code](src/5133a033-1351-43ec-9692-2907d7b9aacd/code.php) | [Settings](src/5133a033-1351-43ec-9692-2907d7b9aacd/settings.json) | Super__5133a033_1351_43ec_9692_2907d7b9aacd__Power
|
||||
- **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 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
|
||||
@ -146,6 +156,7 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **final class TemplateData** | [Details](src/8591f6db-dd3c-4a63-9b3f-574c0ec74ade) | [Code](src/8591f6db-dd3c-4a63-9b3f-574c0ec74ade/code.php) | [Settings](src/8591f6db-dd3c-4a63-9b3f-574c0ec74ade/settings.json) | Super__8591f6db_dd3c_4a63_9b3f_574c0ec74ade__Power
|
||||
- **final class Title** | [Details](src/6a1dddb3-a955-425e-b713-8ef81f256035) | [Code](src/6a1dddb3-a955-425e-b713-8ef81f256035/code.php) | [Settings](src/6a1dddb3-a955-425e-b713-8ef81f256035/settings.json) | Super__6a1dddb3_a955_425e_b713_8ef81f256035__Power
|
||||
- **final class UikitComp** | [Details](src/54ec57f6-2fc3-42e5-975e-1fabeacb845d) | [Code](src/54ec57f6-2fc3-42e5-975e-1fabeacb845d/code.php) | [Settings](src/54ec57f6-2fc3-42e5-975e-1fabeacb845d/settings.json) | Super__54ec57f6_2fc3_42e5_975e_1fabeacb845d__Power
|
||||
- **final class ViewsDefaultOrdering** | [Details](src/f34442df-c84c-44c3-9991-bbf72bffa635) | [Code](src/f34442df-c84c-44c3-9991-bbf72bffa635/code.php) | [Settings](src/f34442df-c84c-44c3-9991-bbf72bffa635/settings.json) | Super__f34442df_c84c_44c3_9991_bbf72bffa635__Power
|
||||
- **class ContentMulti** | [Details](src/5f57ff1a-c196-45b1-a2ac-33766b44fb95) | [Code](src/5f57ff1a-c196-45b1-a2ac-33766b44fb95/code.php) | [Settings](src/5f57ff1a-c196-45b1-a2ac-33766b44fb95/settings.json) | Super__5f57ff1a_c196_45b1_a2ac_33766b44fb95__Power
|
||||
- **class ContentOne** | [Details](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75) | [Code](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/code.php) | [Settings](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/settings.json) | Super__adfbe68a_6d22_43e5_aee8_2787e8c47e75__Power
|
||||
- **class UpdateMysql** | [Details](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9) | [Code](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/code.php) | [Settings](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/settings.json) | Super__2b5c9989_1d4e_4f59_8b95_5cd2f72f82d9__Power
|
||||
@ -154,13 +165,25 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **final class Dashboard** | [Details](src/cfe62a32-8818-4bfb-8751-2f1e109b5336) | [Code](src/cfe62a32-8818-4bfb-8751-2f1e109b5336/code.php) | [Settings](src/cfe62a32-8818-4bfb-8751-2f1e109b5336/settings.json) | Super__cfe62a32_8818_4bfb_8751_2f1e109b5336__Power
|
||||
- **final class Data** | [Details](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753) | [Code](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php) | [Settings](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json) | Super__ef9578e5_4c9d_46bf_866f_3a94bdc7b753__Power
|
||||
- **final class Placeholder** | [Details](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb) | [Code](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php) | [Settings](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json) | Super__aecc17ba_0b0f_4e5c_ae43_71be063a3dcb__Power
|
||||
- **final class Settings** | [Details](src/63dabe82-0f4a-4ade-9851-8518ade23de2) | [Code](src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php) | [Settings](src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json) | Super__63dabe82_0f4a_4ade_9851_8518ade23de2__Power
|
||||
- **final class Structure** | [Details](src/6c89c663-78f5-4078-9fac-7047f2eaaf96) | [Code](src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php) | [Settings](src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json) | Super__6c89c663_78f5_4078_9fac_7047f2eaaf96__Power
|
||||
- **final class Structuremultiple** | [Details](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c) | [Code](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php) | [Settings](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json) | Super__b69a23db_0a62_4840_a9c5_b2d8d63ecc6c__Power
|
||||
- **final class Structuresingle** | [Details](src/673954d3-78d3-445a-b99f-4b40d617c882) | [Code](src/673954d3-78d3-445a-b99f-4b40d617c882/code.php) | [Settings](src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json) | Super__673954d3_78d3_445a_b99f_4b40d617c882__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Creator](#vdm-joomla-componentbuilder-compiler-creator)
|
||||
|
||||
- **final class AccessSections** | [Details](src/15615db0-02b9-454f-a82e-1ab39ae5e6a9) | [Code](src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php) | [Settings](src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json) | Super__15615db0_02b9_454f_a82e_1ab39ae5e6a9__Power
|
||||
- **final class AccessSectionsCategory** | [Details](src/6d179307-b6e5-4f50-962b-5b6360d0759e) | [Code](src/6d179307-b6e5-4f50-962b-5b6360d0759e/code.php) | [Settings](src/6d179307-b6e5-4f50-962b-5b6360d0759e/settings.json) | Super__6d179307_b6e5_4f50_962b_5b6360d0759e__Power
|
||||
- **final class AccessSectionsJoomlaFields** | [Details](src/396f9883-4e50-4b65-a1d5-05bd6c23df30) | [Code](src/396f9883-4e50-4b65-a1d5-05bd6c23df30/code.php) | [Settings](src/396f9883-4e50-4b65-a1d5-05bd6c23df30/settings.json) | Super__396f9883_4e50_4b65_a1d5_05bd6c23df30__Power
|
||||
- **final class Builders** | [Details](src/55278140-80d5-4168-8241-d64515c4b35e) | [Code](src/55278140-80d5-4168-8241-d64515c4b35e/code.php) | [Settings](src/55278140-80d5-4168-8241-d64515c4b35e/settings.json) | Super__55278140_80d5_4168_8241_d64515c4b35e__Power
|
||||
- **final class ConfigFieldsets** | [Details](src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53) | [Code](src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php) | [Settings](src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json) | Super__20cf1825_29d0_4c6c_8fe9_a1e13a4dac53__Power
|
||||
- **final class ConfigFieldsetsCustomfield** | [Details](src/208bc37c-0055-44df-9a34-63d6bfa10765) | [Code](src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php) | [Settings](src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json) | Super__208bc37c_0055_44df_9a34_63d6bfa10765__Power
|
||||
- **final class ConfigFieldsetsEmailHelper** | [Details](src/d80e58b8-8462-47c4-9dcd-380445f1c64a) | [Code](src/d80e58b8-8462-47c4-9dcd-380445f1c64a/code.php) | [Settings](src/d80e58b8-8462-47c4-9dcd-380445f1c64a/settings.json) | Super__d80e58b8_8462_47c4_9dcd_380445f1c64a__Power
|
||||
- **final class ConfigFieldsetsEncryption** | [Details](src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab) | [Code](src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/code.php) | [Settings](src/5e3fc314-646b-4834-8b1a-1a79f3d4d2ab/settings.json) | Super__5e3fc314_646b_4834_8b1a_1a79f3d4d2ab__Power
|
||||
- **final class ConfigFieldsetsGlobal** | [Details](src/0fe3133d-1ff3-4444-9229-4218d8fb338e) | [Code](src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php) | [Settings](src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json) | Super__0fe3133d_1ff3_4444_9229_4218d8fb338e__Power
|
||||
- **final class ConfigFieldsetsGooglechart** | [Details](src/31c8127c-0d42-4e09-be81-7cf243c5b30f) | [Code](src/31c8127c-0d42-4e09-be81-7cf243c5b30f/code.php) | [Settings](src/31c8127c-0d42-4e09-be81-7cf243c5b30f/settings.json) | Super__31c8127c_0d42_4e09_be81_7cf243c5b30f__Power
|
||||
- **final class ConfigFieldsetsGroupControl** | [Details](src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74) | [Code](src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/code.php) | [Settings](src/a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74/settings.json) | Super__a8d9583a_6ddb_4aac_b0d1_4c2d2d1c8c74__Power
|
||||
- **final class ConfigFieldsetsSiteControl** | [Details](src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11) | [Code](src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/code.php) | [Settings](src/aac8502a-dbdf-42b6-a9ba-2c2e941f8b11/settings.json) | Super__aac8502a_dbdf_42b6_a9ba_2c2e941f8b11__Power
|
||||
- **final class ConfigFieldsetsUikit** | [Details](src/84c11075-570a-4907-9be0-9305e0fabe3c) | [Code](src/84c11075-570a-4907-9be0-9305e0fabe3c/code.php) | [Settings](src/84c11075-570a-4907-9be0-9305e0fabe3c/settings.json) | Super__84c11075_570a_4907_9be0_9305e0fabe3c__Power
|
||||
- **final class CustomButtonPermissions** | [Details](src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7) | [Code](src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/code.php) | [Settings](src/8bf026e7-9ae0-423c-b74b-5bc16c54acf7/settings.json) | Super__8bf026e7_9ae0_423c_b74b_5bc16c54acf7__Power
|
||||
- **final class CustomFieldTypeFile** | [Details](src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96) | [Code](src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/code.php) | [Settings](src/6dced3d9-7d10-4ea1-bcf6-a5e6af4b9c96/settings.json) | Super__6dced3d9_7d10_4ea1_bcf6_a5e6af4b9c96__Power
|
||||
- **final class FieldAsString** | [Details](src/f48764e0-16c6-459c-8576-af7616f3b720) | [Code](src/f48764e0-16c6-459c-8576-af7616f3b720/code.php) | [Settings](src/f48764e0-16c6-459c-8576-af7616f3b720/settings.json) | Super__f48764e0_16c6_459c_8576_af7616f3b720__Power
|
||||
- **final class FieldDynamic** | [Details](src/4801f8b0-4a4a-4eda-8f0e-cf77f042c35e) | [Code](src/4801f8b0-4a4a-4eda-8f0e-cf77f042c35e/code.php) | [Settings](src/4801f8b0-4a4a-4eda-8f0e-cf77f042c35e/settings.json) | Super__4801f8b0_4a4a_4eda_8f0e_cf77f042c35e__Power
|
||||
@ -171,6 +194,7 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **final class FieldsetXML** | [Details](src/79739667-72c6-4576-9830-7b1eb92e4791) | [Code](src/79739667-72c6-4576-9830-7b1eb92e4791/code.php) | [Settings](src/79739667-72c6-4576-9830-7b1eb92e4791/settings.json) | Super__79739667_72c6_4576_9830_7b1eb92e4791__Power
|
||||
- **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 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)
|
||||
|
||||
@ -191,25 +215,31 @@ This repository contains an index (see below) of all the approved powers within
|
||||
|
||||
- **final class Attributes** | [Details](src/7f515c18-d019-4d2d-9852-b2dc970985b3) | [Code](src/7f515c18-d019-4d2d-9852-b2dc970985b3/code.php) | [Settings](src/7f515c18-d019-4d2d-9852-b2dc970985b3/settings.json) | Super__7f515c18_d019_4d2d_9852_b2dc970985b3__Power
|
||||
- **final class Groups** | [Details](src/12df35ad-2d44-4c4c-a7d5-a3350932a520) | [Code](src/12df35ad-2d44-4c4c-a7d5-a3350932a520/code.php) | [Settings](src/12df35ad-2d44-4c4c-a7d5-a3350932a520/settings.json) | Super__12df35ad_2d44_4c4c_a7d5_a3350932a520__Power
|
||||
- **final class InputButton** | [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
|
||||
- **class Customcode** | [Details](src/a356d103-74f3-49ca-8e4f-3bd37746f089) | [Code](src/a356d103-74f3-49ca-8e4f-3bd37746f089/code.php) | [Settings](src/a356d103-74f3-49ca-8e4f-3bd37746f089/settings.json) | Super__a356d103_74f3_49ca_8e4f_3bd37746f089__Power
|
||||
- **class Data** | [Details](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee) | [Code](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php) | [Settings](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json) | Super__ce826b66_0f2d_43da_8005_41b8e4cb21ee__Power
|
||||
- **class DatabaseName** | [Details](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6) | [Code](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/code.php) | [Settings](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/settings.json) | Super__99368a6f_2f64_4d4e_ad3a_544d4020ecc6__Power
|
||||
- **class Name** | [Details](src/9387215f-a965-4421-acf3-5e8f9d11382f) | [Code](src/9387215f-a965-4421-acf3-5e8f9d11382f/code.php) | [Settings](src/9387215f-a965-4421-acf3-5e8f9d11382f/settings.json) | Super__9387215f_a965_4421_acf3_5e8f9d11382f__Power
|
||||
- **class Rule** | [Details](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557) | [Code](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php) | [Settings](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json) | Super__c871fb4a_4c33_4302_bb79_a9cd7ef4a557__Power
|
||||
- **class TypeName** | [Details](src/eb33420d-359d-44a5-852e-613aef1feaae) | [Code](src/eb33420d-359d-44a5-852e-613aef1feaae/code.php) | [Settings](src/eb33420d-359d-44a5-852e-613aef1feaae/settings.json) | Super__eb33420d_359d_44a5_852e_613aef1feaae__Power
|
||||
- **class UniqueName** | [Details](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e) | [Code](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/code.php) | [Settings](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/settings.json) | Super__8c018533_e967_4bf2_9bd9_9e92966fcb5e__Power
|
||||
- **class Validation** | [Details](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557) | [Code](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php) | [Settings](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json) | Super__c871fb4a_4c33_4302_bb79_a9cd7ef4a557__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces](#vdm-joomla-componentbuilder-compiler-interfaces)
|
||||
|
||||
- **interface CustomcodeInterface** | [Details](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4) | [Code](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/code.php) | [Settings](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/settings.json) | Super__33bdc535_0ff1_40c8_bb22_b5d44f1731c4__Power
|
||||
- **interface EventInterface** | [Details](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d) | [Code](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php) | [Settings](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/settings.json) | Super__20ed72b0_fcac_4344_aee1_8a65e3bf221d__Power
|
||||
- **interface GetScriptInterface** | [Details](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890) | [Code](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/code.php) | [Settings](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/settings.json) | Super__2e6731ba_3a03_4836_b2c2_4e50e38cb890__Power
|
||||
- **interface HeaderInterface** | [Details](src/3a777d70-52ad-49ec-9016-6f7438608613) | [Code](src/3a777d70-52ad-49ec-9016-6f7438608613/code.php) | [Settings](src/3a777d70-52ad-49ec-9016-6f7438608613/settings.json) | Super__3a777d70_52ad_49ec_9016_6f7438608613__Power
|
||||
- **interface HistoryInterface** | [Details](src/4325745f-da1f-4d4d-a591-3189fe8c06e5) | [Code](src/4325745f-da1f-4d4d-a591-3189fe8c06e5/code.php) | [Settings](src/4325745f-da1f-4d4d-a591-3189fe8c06e5/settings.json) | Super__4325745f_da1f_4d4d_a591_3189fe8c06e5__Power
|
||||
- **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\JoomlaFour](#vdm-joomla-componentbuilder-compiler-joomlafour)
|
||||
|
||||
- **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
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaThree](#vdm-joomla-componentbuilder-compiler-joomlathree)
|
||||
|
||||
- **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
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Joomlamodule](#vdm-joomla-componentbuilder-compiler-joomlamodule)
|
||||
@ -283,6 +313,8 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Service](#vdm-joomla-componentbuilder-compiler-service)
|
||||
|
||||
- **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 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
|
||||
@ -292,6 +324,7 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **class Event** | [Details](src/b94aaedb-6774-4739-a63f-8f87141a85db) | [Code](src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php) | [Settings](src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json) | Super__b94aaedb_6774_4739_a63f_8f87141a85db__Power
|
||||
- **class Extension** | [Details](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d) | [Code](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php) | [Settings](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json) | Super__ed9591cb_0a03_400a_bf47_eaf78ab19b9d__Power
|
||||
- **class Field** | [Details](src/c6c30d66-3106-44eb-9272-b2cf7ec74613) | [Code](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php) | [Settings](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json) | Super__c6c30d66_3106_44eb_9272_b2cf7ec74613__Power
|
||||
- **class Header** | [Details](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d) | [Code](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php) | [Settings](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json) | Super__36d49d4a_8d0e_435f_ab4c_8f247d96fd4d__Power
|
||||
- **class History** | [Details](src/63782f74-7b03-4745-aa40-0adf8ed4e704) | [Code](src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php) | [Settings](src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json) | Super__63782f74_7b03_4745_aa40_0adf8ed4e704__Power
|
||||
- **class Joomlamodule** | [Details](src/295186de-5954-4a65-a4c1-2f79ef305743) | [Code](src/295186de-5954-4a65-a4c1-2f79ef305743/code.php) | [Settings](src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json) | Super__295186de_5954_4a65_a4c1_2f79ef305743__Power
|
||||
- **class Joomlaplugin** | [Details](src/9eba241c-af90-42dd-ae05-92ff4d8391d3) | [Code](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php) | [Settings](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json) | Super__9eba241c_af90_42dd_ae05_92ff4d8391d3__Power
|
||||
@ -312,6 +345,7 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **abstract class Line** | [Details](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222) | [Code](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/code.php) | [Settings](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/settings.json) | Super__4e6ff11d_bebf_42f5_8fd7_b2f882857222__Power
|
||||
- **abstract class Placefix** | [Details](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388) | [Code](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/code.php) | [Settings](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/settings.json) | Super__500f3a7f_c16d_4dd4_81b2_2df6776b5388__Power
|
||||
- **abstract class Unique** | [Details](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e) | [Code](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/code.php) | [Settings](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/settings.json) | Super__f02fb1df_f4b6_4be1_9595_2e72084a5e6e__Power
|
||||
- **final class FileInjector** | [Details](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb) | [Code](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php) | [Settings](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json) | Super__23f2ca33_440a_4941_8e9a_4bc67522c0cb__Power
|
||||
- **final class Xml** | [Details](src/f6ba34a2-0cd7-4dc1-ab67-75e962a5045b) | [Code](src/f6ba34a2-0cd7-4dc1-ab67-75e962a5045b/code.php) | [Settings](src/f6ba34a2-0cd7-4dc1-ab67-75e962a5045b/settings.json) | Super__f6ba34a2_0cd7_4dc1_ab67_75e962a5045b__Power
|
||||
- **class Counter** | [Details](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4) | [Code](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/code.php) | [Settings](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/settings.json) | Super__e6d871a6_bbe7_497d_af01_68f6bb9a87f4__Power
|
||||
- **class Dynamicpath** | [Details](src/268b85ef-49f3-4c39-8187-bb12e38d19ee) | [Code](src/268b85ef-49f3-4c39-8187-bb12e38d19ee/code.php) | [Settings](src/268b85ef-49f3-4c39-8187-bb12e38d19ee/settings.json) | Super__268b85ef_49f3_4c39_8187_bb12e38d19ee__Power
|
||||
@ -344,18 +378,35 @@ 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\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
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree](#vdm-joomla-componentbuilder-compiler-component-joomlathree)
|
||||
|
||||
- **final class Settings** | [Details](src/63dabe82-0f4a-4ade-9851-8518ade23de2) | [Code](src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php) | [Settings](src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json) | Super__63dabe82_0f4a_4ade_9851_8518ade23de2__Power
|
||||
- **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\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
|
||||
- **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
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour](#vdm-joomla-componentbuilder-compiler-field-joomlafour)
|
||||
|
||||
- **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)
|
||||
|
||||
- **class CoreValidation** | [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
|
||||
- **interface SettingsInterface** | [Details](src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9) | [Code](src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/code.php) | [Settings](src/5f44e66a-31d0-45ff-92b3-b7372dc57ae9/settings.json) | Super__5f44e66a_31d0_45ff_92b3_b7372dc57ae9__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Creator](#vdm-joomla-componentbuilder-compiler-interfaces-creator)
|
||||
|
||||
- **interface Fielddynamicinterface** | [Details](src/c902743e-8c6e-4a50-a4a3-8c955ef2960f) | [Code](src/c902743e-8c6e-4a50-a4a3-8c955ef2960f/code.php) | [Settings](src/c902743e-8c6e-4a50-a4a3-8c955ef2960f/settings.json) | Super__c902743e_8c6e_4a50_a4a3_8c955ef2960f__Power
|
||||
@ -373,13 +424,39 @@ This repository contains an index (see below) of all the approved powers within
|
||||
- **interface InstallInterface** | [Details](src/1aefb8f5-486f-4f00-adf9-696340b3254e) | [Code](src/1aefb8f5-486f-4f00-adf9-696340b3254e/code.php) | [Settings](src/1aefb8f5-486f-4f00-adf9-696340b3254e/settings.json) | Super__1aefb8f5_486f_4f00_adf9_696340b3254e__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field](#vdm-joomla-componentbuilder-compiler-interfaces-field)
|
||||
|
||||
- **interface CoreValidationInterface** | [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 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\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\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
|
||||
- **final class AllowEdit** | [Details](src/ddf31f4b-96ba-46e7-8100-f48e1cefe533) | [Code](src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/code.php) | [Settings](src/ddf31f4b-96ba-46e7-8100-f48e1cefe533/settings.json) | Super__ddf31f4b_96ba_46e7_8100_f48e1cefe533__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model](#vdm-joomla-componentbuilder-compiler-architecture-joomlafour-model)
|
||||
|
||||
- **final class CanDelete** | [Details](src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f) | [Code](src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php) | [Settings](src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json) | Super__2a69a8ab_cea0_4c75_92d5_9495cb740e0f__Power
|
||||
- **final class CanEditState** | [Details](src/cb2a82a5-aa49-4d46-b765-9b3feb118208) | [Code](src/cb2a82a5-aa49-4d46-b765-9b3feb118208/code.php) | [Settings](src/cb2a82a5-aa49-4d46-b765-9b3feb118208/settings.json) | Super__cb2a82a5_aa49_4d46_b765_9b3feb118208__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller](#vdm-joomla-componentbuilder-compiler-architecture-joomlathree-controller)
|
||||
|
||||
- **final class AllowAdd** | [Details](src/f21388dc-5ddc-4970-a3c2-55f075024762) | [Code](src/f21388dc-5ddc-4970-a3c2-55f075024762/code.php) | [Settings](src/f21388dc-5ddc-4970-a3c2-55f075024762/settings.json) | Super__f21388dc_5ddc_4970_a3c2_55f075024762__Power
|
||||
- **final class AllowEdit** | [Details](src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f) | [Code](src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/code.php) | [Settings](src/8faaed82-522d-4f78-bd43-0ab3f7c72e5f/settings.json) | Super__8faaed82_522d_4f78_bd43_0ab3f7c72e5f__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model](#vdm-joomla-componentbuilder-compiler-architecture-joomlathree-model)
|
||||
|
||||
- **final class CanDelete** | [Details](src/23766738-d0a4-4d0a-8555-7e4c97c0cddd) | [Code](src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php) | [Settings](src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json) | Super__23766738_d0a4_4d0a_8555_7e4c97c0cddd__Power
|
||||
- **final class CanEditState** | [Details](src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe) | [Code](src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/code.php) | [Settings](src/bce9ac2b-9f46-413f-b046-9e8af3f7dfbe/settings.json) | Super__bce9ac2b_9f46_413f_b046_9e8af3f7dfbe__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller](#vdm-joomla-componentbuilder-compiler-interfaces-architecture-controller)
|
||||
|
||||
- **interface AllowAddInterface** | [Details](src/c9700450-4f44-4455-bc86-6a7660daadee) | [Code](src/c9700450-4f44-4455-bc86-6a7660daadee/code.php) | [Settings](src/c9700450-4f44-4455-bc86-6a7660daadee/settings.json) | Super__c9700450_4f44_4455_bc86_6a7660daadee__Power
|
||||
- **interface AllowEditInterface** | [Details](src/992a842f-1ba9-4a5c-b214-042459ffe038) | [Code](src/992a842f-1ba9-4a5c-b214-042459ffe038/code.php) | [Settings](src/992a842f-1ba9-4a5c-b214-042459ffe038/settings.json) | Super__992a842f_1ba9_4a5c_b214_042459ffe038__Power
|
||||
- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model](#vdm-joomla-componentbuilder-compiler-interfaces-architecture-model)
|
||||
|
||||
- **interface CanDeleteInterface** | [Details](src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91) | [Code](src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/code.php) | [Settings](src/e00a7d1d-6d80-41c5-bf13-32d41bc5bf91/settings.json) | Super__e00a7d1d_6d80_41c5_bf13_32d41bc5bf91__Power
|
||||
- **interface CanEditStateInterface** | [Details](src/600515b1-493f-4448-96fe-018e54e087c8) | [Code](src/600515b1-493f-4448-96fe-018e54e087c8/code.php) | [Settings](src/600515b1-493f-4448-96fe-018e54e087c8/settings.json) | Super__600515b1_493f_4448_96fe_018e54e087c8__Power
|
||||
|
||||
---
|
||||
```
|
||||
|
@ -11,6 +11,7 @@
|
||||
```uml
|
||||
@startuml
|
||||
class Extractor #Gold {
|
||||
# int $currentVersion
|
||||
# array $existing
|
||||
# array $new
|
||||
# array $done
|
||||
@ -24,9 +25,9 @@ class Extractor #Gold {
|
||||
# Reverse $reverse
|
||||
# Placeholder $componentPlaceholder
|
||||
# Pathfix $pathfix
|
||||
# User $user
|
||||
# \JDatabaseDriver $db
|
||||
# CMSApplication $app
|
||||
# $user
|
||||
# $db
|
||||
# $app
|
||||
+ __construct(?Config $config = null, ?Gui $gui = null, ...)
|
||||
+ run() : void
|
||||
# searchFileContent(string $file, $target) : array
|
||||
@ -49,9 +50,6 @@ note right of Extractor::__construct
|
||||
?Reverse $reverse = null
|
||||
?Placeholder $placeholder = null
|
||||
?Pathfix $pathfix = null
|
||||
?User $user = null
|
||||
?\JDatabaseDriver $db = null
|
||||
?CMSApplication $app = null
|
||||
end note
|
||||
|
||||
note left of Extractor::run
|
||||
|
@ -16,7 +16,8 @@ use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\User\User;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Version;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
@ -83,6 +84,14 @@ class Extractor implements ExtractorInterface
|
||||
4 => 'INSERTED<>$$$$]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Current Joomla Version We are IN
|
||||
*
|
||||
* @var int
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected int $currentVersion;
|
||||
|
||||
/**
|
||||
* The custom code in local files that already exist in system
|
||||
*
|
||||
@ -190,26 +199,23 @@ class Extractor implements ExtractorInterface
|
||||
/**
|
||||
* Current User Object
|
||||
*
|
||||
* @var User
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected User $user;
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var CMSApplication
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected CMSApplication $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -220,16 +226,12 @@ class Extractor implements ExtractorInterface
|
||||
* @param Reverse|null $reverse The compiler placeholder reverse object.
|
||||
* @param Placeholder|null $placeholder The compiler component placeholder object.
|
||||
* @param Pathfix|null $pathfix The compiler path fixing object.
|
||||
* @param User|null $user The current User object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null,
|
||||
?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null,
|
||||
?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null)
|
||||
?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
|
||||
@ -237,9 +239,9 @@ class Extractor implements ExtractorInterface
|
||||
$this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse');
|
||||
$this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder');
|
||||
$this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix');
|
||||
$this->user = $user ?: Factory::getUser();
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
$this->user = Factory::getUser();
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
|
||||
// set today's date
|
||||
$this->today = Factory::getDate()->toSql();
|
||||
@ -261,6 +263,9 @@ class Extractor implements ExtractorInterface
|
||||
|
||||
// set the local placeholders
|
||||
$this->placeholders = array_reverse($placeholders, true);
|
||||
|
||||
// set the current version
|
||||
$this->currentVersion = (int) Version::MAJOR_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -613,6 +618,11 @@ class Extractor implements ExtractorInterface
|
||||
1
|
||||
); // 'target'
|
||||
|
||||
$this->new[$pointer[$targetKey]][]
|
||||
= $this->db->quote(
|
||||
$this->currentVersion
|
||||
); // 'joomla_version'
|
||||
|
||||
$this->new[$pointer[$targetKey]][]
|
||||
= $this->db->quote(
|
||||
$commentType
|
||||
@ -766,7 +776,7 @@ class Extractor implements ExtractorInterface
|
||||
$query = $this->db->getQuery(true);
|
||||
$continue = false;
|
||||
// Insert columns.
|
||||
$columns = array('path', 'type', 'target', 'comment_type',
|
||||
$columns = array('path', 'type', 'target', 'joomla_version', 'comment_type',
|
||||
'component', 'published', 'created', 'created_by',
|
||||
'version', 'access', 'hashtarget', 'from_line',
|
||||
'to_line', 'code', 'hashendtarget');
|
||||
|
@ -12,6 +12,14 @@
|
||||
4 => 'INSERTED<>$$$$]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Current Joomla Version We are IN
|
||||
*
|
||||
* @var int
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected int $currentVersion;
|
||||
|
||||
/**
|
||||
* The custom code in local files that already exist in system
|
||||
*
|
||||
@ -119,26 +127,23 @@
|
||||
/**
|
||||
* Current User Object
|
||||
*
|
||||
* @var User
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected User $user;
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var CMSApplication
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected CMSApplication $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -149,16 +154,12 @@
|
||||
* @param Reverse|null $reverse The compiler placeholder reverse object.
|
||||
* @param Placeholder|null $placeholder The compiler component placeholder object.
|
||||
* @param Pathfix|null $pathfix The compiler path fixing object.
|
||||
* @param User|null $user The current User object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null,
|
||||
?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null,
|
||||
?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null)
|
||||
?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
|
||||
@ -166,9 +167,9 @@
|
||||
$this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse');
|
||||
$this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder');
|
||||
$this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix');
|
||||
$this->user = $user ?: Factory::getUser();
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
$this->user = Factory::getUser();
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
|
||||
// set today's date
|
||||
$this->today = Factory::getDate()->toSql();
|
||||
@ -190,6 +191,9 @@
|
||||
|
||||
// set the local placeholders
|
||||
$this->placeholders = array_reverse($placeholders, true);
|
||||
|
||||
// set the current version
|
||||
$this->currentVersion = (int) Version::MAJOR_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -542,6 +546,11 @@
|
||||
1
|
||||
); // 'target'
|
||||
|
||||
$this->new[$pointer[$targetKey]][]
|
||||
= $this->db->quote(
|
||||
$this->currentVersion
|
||||
); // 'joomla_version'
|
||||
|
||||
$this->new[$pointer[$targetKey]][]
|
||||
= $this->db->quote(
|
||||
$commentType
|
||||
@ -695,7 +704,7 @@
|
||||
$query = $this->db->getQuery(true);
|
||||
$continue = false;
|
||||
// Insert columns.
|
||||
$columns = array('path', 'type', 'target', 'comment_type',
|
||||
$columns = array('path', 'type', 'target', 'joomla_version', 'comment_type',
|
||||
'component', 'published', 'created', 'created_by',
|
||||
'version', 'access', 'hashtarget', 'from_line',
|
||||
'to_line', 'code', 'hashendtarget');
|
||||
|
@ -56,6 +56,6 @@
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.Extractor",
|
||||
"description": "Compiler Custom Code Extractor\r\n\r\nThe custom script placeholders - we use the (xxx) to avoid detection it should be (***)\r\n##################################---> PHP\/JS ---####################################\r\n\r\nNew Insert Code = \/xxx[INSERT>$$$$]xxx\/ \/xxx[\/INSERT>$$$$]xxx\/\r\nNew Replace Code = \/xxx[REPLACE>$$$$]xxx\/ \/xxx[\/REPLACE>$$$$]xxx\/\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ when JCB adds it back \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nJCB Add Inserted Code = \/xxx[INSERTED$$$$]xxx\/\/xx23xx\/ \/xxx[\/INSERTED$$$$]xxx\/\r\nJCB Add Replaced Code = \/xxx[REPLACED$$$$]xxx\/\/xx25xx\/ \/xxx[\/REPLACED$$$$]xxx\/\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ changeing existing custom code \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nUpdate Inserted Code = \/xxx[INSERTED>$$$$]xxx\/\/xx23xx\/ \/xxx[\/INSERTED>$$$$]xxx\/\r\nUpdate Replaced Code = \/xxx[REPLACED>$$$$]xxx\/\/xx25xx\/ \/xxx[\/REPLACED>$$$$]xxx\/\r\n\r\nThe custom script placeholders - we use the (==) to avoid detection it should be (--)\r\n###################################---> HTML ---#####################################\r\n\r\nNew Insert Code = !==[INSERT>$$$$]==> !==[\/INSERT>$$$$]==>\r\nNew Replace Code = !==[REPLACE>$$$$]==> !==[\/REPLACE>$$$$]==>\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ when JCB adds it back \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nJCB Add Inserted Code = \r\nJCB Add Replaced Code = \r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ changeing existing custom code \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nUpdate Inserted Code = !==[INSERTED>$$$$]==> !==[\/INSERTED>$$$$]==>\r\nUpdate Replaced Code = !==[REPLACED>$$$$]==> !==[\/REPLACED>$$$$]==>\r\n\r\n\/\/\/\/\/\/\/\/23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\r\nMore info read: https:\/\/git.vdm.dev\/joomla\/Component-Builder\/wiki\/TIPS:-Custom-Code\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\User\\User;\r\nuse Joomla\\CMS\\Filesystem\\Folder;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;",
|
||||
"head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\User\\User;\r\nuse Joomla\\CMS\\Filesystem\\Folder;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Version;",
|
||||
"composer": ""
|
||||
}
|
@ -230,17 +230,13 @@ class Infusion
|
||||
// infuse super powers details if set
|
||||
if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers))
|
||||
{
|
||||
// TODO we need to update the event signatures
|
||||
$context = $this->config->component_context;
|
||||
|
||||
foreach ($this->power->superpowers as $path => $powers)
|
||||
{
|
||||
$key = StringHelper::safe($path);
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeInfuseSuperPowerDetails',
|
||||
array(&$context, &$path, &$key, &$powers)
|
||||
'jcb_ce_onBeforeInfuseSuperPowerDetails', [&$path, &$key, &$powers]
|
||||
);
|
||||
|
||||
// we add and all missing powers
|
||||
@ -260,8 +256,7 @@ class Infusion
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterInfuseSuperPowerDetails',
|
||||
array(&$context, &$path, &$key, &$powers)
|
||||
'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -306,17 +301,13 @@ class Infusion
|
||||
// infuse powers data if set
|
||||
if (ArrayHelper::check($this->power->active))
|
||||
{
|
||||
// TODO we need to update the event signatures
|
||||
$context = $this->config->component_context;
|
||||
|
||||
foreach ($this->power->active as $power)
|
||||
{
|
||||
if (ObjectHelper::check($power))
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeInfusePowerData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeInfusePowerData',
|
||||
array(&$context, &$power)
|
||||
'jcb_ce_onBeforeInfusePowerData', [&$power]
|
||||
);
|
||||
|
||||
// POWERCODE
|
||||
@ -333,8 +324,7 @@ class Infusion
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterInfusePowerData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterInfusePowerData',
|
||||
array(&$context, &$power)
|
||||
'jcb_ce_onAfterInfusePowerData', [&$power]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -195,17 +195,13 @@
|
||||
// infuse super powers details if set
|
||||
if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers))
|
||||
{
|
||||
// TODO we need to update the event signatures
|
||||
$context = $this->config->component_context;
|
||||
|
||||
foreach ($this->power->superpowers as $path => $powers)
|
||||
{
|
||||
$key = StringHelper::safe($path);
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeInfuseSuperPowerDetails',
|
||||
array(&$context, &$path, &$key, &$powers)
|
||||
'jcb_ce_onBeforeInfuseSuperPowerDetails', [&$path, &$key, &$powers]
|
||||
);
|
||||
|
||||
// we add and all missing powers
|
||||
@ -225,8 +221,7 @@
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterInfuseSuperPowerDetails',
|
||||
array(&$context, &$path, &$key, &$powers)
|
||||
'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -271,17 +266,13 @@
|
||||
// infuse powers data if set
|
||||
if (ArrayHelper::check($this->power->active))
|
||||
{
|
||||
// TODO we need to update the event signatures
|
||||
$context = $this->config->component_context;
|
||||
|
||||
foreach ($this->power->active as $power)
|
||||
{
|
||||
if (ObjectHelper::check($power))
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeInfusePowerData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeInfusePowerData',
|
||||
array(&$context, &$power)
|
||||
'jcb_ce_onBeforeInfusePowerData', [&$power]
|
||||
);
|
||||
|
||||
// POWERCODE
|
||||
@ -298,8 +289,7 @@
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterInfusePowerData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterInfusePowerData',
|
||||
array(&$context, &$power)
|
||||
'jcb_ce_onAfterInfusePowerData', [&$power]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ class Paths #Gold {
|
||||
# Placeholder $placeholder
|
||||
# Customcode $customcode
|
||||
# Extractor $extractor
|
||||
# \JDatabaseDriver $db
|
||||
# $db
|
||||
+ __construct(?Config $config = null, ?Placeholder $placeholder = null, ...)
|
||||
# load() : void
|
||||
# getModuleIDs() : mixed
|
||||
@ -37,7 +37,6 @@ note right of Paths::__construct
|
||||
?ComponentPlaceholder $componentPlaceholder = null
|
||||
?Customcode $customcode = null
|
||||
?Extractor $extractor = null
|
||||
?\JDatabaseDriver $db = null
|
||||
end note
|
||||
|
||||
note right of Paths::load
|
||||
|
@ -84,10 +84,9 @@ class Paths
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -97,14 +96,13 @@ class Paths
|
||||
* @param ComponentPlaceholder|null $componentPlaceholder The compiler component placeholder object.
|
||||
* @param Customcode|null $customcode The compiler customcode object.
|
||||
* @param Extractor|null $extractor The compiler language extractor object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Placeholder $placeholder = null,
|
||||
?ComponentPlaceholder $componentPlaceholder = null, ?Customcode $customcode = null,
|
||||
?Extractor $extractor = null, ?\JDatabaseDriver $db = null)
|
||||
?Extractor $extractor = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
@ -112,7 +110,7 @@ class Paths
|
||||
$componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder');
|
||||
$this->customcode = $customcode ?: Compiler::_('Customcode');
|
||||
$this->extractor = $extractor ?: Compiler::_('Language.Extractor');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->db = Factory::getDbo();
|
||||
|
||||
// load the placeholders to local array
|
||||
$this->componentPlaceholder = $componentPlaceholder->get();
|
||||
|
@ -49,10 +49,9 @@
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -62,14 +61,13 @@
|
||||
* @param ComponentPlaceholder|null $componentPlaceholder The compiler component placeholder object.
|
||||
* @param Customcode|null $customcode The compiler customcode object.
|
||||
* @param Extractor|null $extractor The compiler language extractor object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Placeholder $placeholder = null,
|
||||
?ComponentPlaceholder $componentPlaceholder = null, ?Customcode $customcode = null,
|
||||
?Extractor $extractor = null, ?\JDatabaseDriver $db = null)
|
||||
?Extractor $extractor = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
@ -77,7 +75,7 @@
|
||||
$componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder');
|
||||
$this->customcode = $customcode ?: Compiler::_('Customcode');
|
||||
$this->extractor = $extractor ?: Compiler::_('Language.Extractor');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->db = Factory::getDbo();
|
||||
|
||||
// load the placeholders to local array
|
||||
$this->componentPlaceholder = $componentPlaceholder->get();
|
||||
|
@ -231,18 +231,16 @@ final class FieldsetString implements Fieldsetinterface
|
||||
$dynamic_fields = '';
|
||||
// set the custom table key
|
||||
$dbkey = 'g';
|
||||
// for plugin event TODO change event api signatures
|
||||
$placeholders = $this->placeholder->active;
|
||||
$component_context = $this->config->component_context;
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeBuildFields
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeBuildFields',
|
||||
array(&$component_context, &$dynamic_fields, &$read_only,
|
||||
[&$dynamic_fields, &$read_only,
|
||||
&$dbkey, &$view, &$component, &$nameSingleCode,
|
||||
&$nameListCode, &$placeholders, &$lang_view,
|
||||
&$lang_views)
|
||||
&$nameListCode, &$lang_view,
|
||||
&$lang_views]
|
||||
);
|
||||
unset($placeholders);
|
||||
|
||||
// TODO we should add the global and local view switch if field for front end
|
||||
foreach ($view['settings']->fields as $field)
|
||||
{
|
||||
@ -252,17 +250,16 @@ final class FieldsetString implements Fieldsetinterface
|
||||
true
|
||||
);
|
||||
}
|
||||
// for plugin event TODO change event api signatures
|
||||
$placeholders = $this->placeholder->active;
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterBuildFields
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterBuildFields',
|
||||
array(&$component_context, &$dynamic_fields, &$read_only,
|
||||
[&$dynamic_fields, &$read_only,
|
||||
&$dbkey, &$view, &$component, &$nameSingleCode,
|
||||
&$nameListCode, &$placeholders, &$lang_view,
|
||||
&$lang_views)
|
||||
&$nameListCode, &$lang_view,
|
||||
&$lang_views]
|
||||
);
|
||||
unset($placeholders);
|
||||
|
||||
// set the default fields
|
||||
$field_set = array();
|
||||
$field_set[] = '<fieldset name="details">';
|
||||
|
@ -192,18 +192,16 @@
|
||||
$dynamic_fields = '';
|
||||
// set the custom table key
|
||||
$dbkey = 'g';
|
||||
// for plugin event TODO change event api signatures
|
||||
$placeholders = $this->placeholder->active;
|
||||
$component_context = $this->config->component_context;
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeBuildFields
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeBuildFields',
|
||||
array(&$component_context, &$dynamic_fields, &$read_only,
|
||||
[&$dynamic_fields, &$read_only,
|
||||
&$dbkey, &$view, &$component, &$nameSingleCode,
|
||||
&$nameListCode, &$placeholders, &$lang_view,
|
||||
&$lang_views)
|
||||
&$nameListCode, &$lang_view,
|
||||
&$lang_views]
|
||||
);
|
||||
unset($placeholders);
|
||||
|
||||
// TODO we should add the global and local view switch if field for front end
|
||||
foreach ($view['settings']->fields as $field)
|
||||
{
|
||||
@ -213,17 +211,16 @@
|
||||
true
|
||||
);
|
||||
}
|
||||
// for plugin event TODO change event api signatures
|
||||
$placeholders = $this->placeholder->active;
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterBuildFields
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterBuildFields',
|
||||
array(&$component_context, &$dynamic_fields, &$read_only,
|
||||
[&$dynamic_fields, &$read_only,
|
||||
&$dbkey, &$view, &$component, &$nameSingleCode,
|
||||
&$nameListCode, &$placeholders, &$lang_view,
|
||||
&$lang_views)
|
||||
&$nameListCode, &$lang_view,
|
||||
&$lang_views]
|
||||
);
|
||||
unset($placeholders);
|
||||
|
||||
// set the default fields
|
||||
$field_set = array();
|
||||
$field_set[] = '<fieldset name="details">';
|
||||
|
@ -19,7 +19,7 @@ class Data #Gold {
|
||||
# Dispenser $dispenser
|
||||
# Gui $gui
|
||||
# Dynamicget $dynamic
|
||||
# \JDatabaseDriver $db
|
||||
# $db
|
||||
+ __construct(?Config $config = null, ?Registry $registry = null, ...)
|
||||
+ get(array $ids, string $view_code, ...) : ?array
|
||||
}
|
||||
@ -37,7 +37,6 @@ note right of Data::__construct
|
||||
?Dispenser $dispenser = null
|
||||
?Gui $gui = null
|
||||
?Dynamicget $dynamic = null
|
||||
?\JDatabaseDriver $db = null
|
||||
end note
|
||||
|
||||
note right of Data::get
|
||||
|
@ -104,10 +104,9 @@ class Data
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -119,14 +118,13 @@ class Data
|
||||
* @param Dispenser|null $dispenser The compiler customcode dispenser object.
|
||||
* @param Gui|null $gui The compiler customcode gui.
|
||||
* @param Dynamicget|null $dynamic The compiler dynamicget modeller object.
|
||||
* @param \JDatabaseDriver|null $db The database object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Registry $registry = null,
|
||||
?EventInterface $event = null, ?Customcode $customcode = null,
|
||||
?Dispenser $dispenser = null, ?Gui $gui = null,
|
||||
?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null)
|
||||
?Dynamicget $dynamic = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->registry = $registry ?: Compiler::_('Registry');
|
||||
@ -135,7 +133,7 @@ class Data
|
||||
$this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser');
|
||||
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
|
||||
$this->dynamic = $dynamic ?: Compiler::_('Model.Dynamicget');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,9 +155,6 @@ class Data
|
||||
|
||||
$ids = implode(',', $ids);
|
||||
|
||||
// for plugin event TODO change event api signatures
|
||||
$component_context = $this->config->component_context;
|
||||
|
||||
// Create a new query object.
|
||||
$query = $this->db->getQuery(true);
|
||||
$query->select('a.*');
|
||||
@ -176,8 +171,7 @@ class Data
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeModelDynamicGetData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeModelDynamicGetData',
|
||||
array(&$component_context, &$result, &$result->id, &$view_code, &$context)
|
||||
'jcb_ce_onBeforeModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context]
|
||||
);
|
||||
|
||||
// set GUI mapper id
|
||||
@ -310,8 +304,7 @@ class Data
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterModelDynamicGetData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterModelDynamicGetData',
|
||||
array(&$component_context, &$result, &$result->id, &$view_code, &$context)
|
||||
'jcb_ce_onAfterModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -70,10 +70,9 @@
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -85,14 +84,13 @@
|
||||
* @param Dispenser|null $dispenser The compiler customcode dispenser object.
|
||||
* @param Gui|null $gui The compiler customcode gui.
|
||||
* @param Dynamicget|null $dynamic The compiler dynamicget modeller object.
|
||||
* @param \JDatabaseDriver|null $db The database object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Registry $registry = null,
|
||||
?EventInterface $event = null, ?Customcode $customcode = null,
|
||||
?Dispenser $dispenser = null, ?Gui $gui = null,
|
||||
?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null)
|
||||
?Dynamicget $dynamic = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->registry = $registry ?: Compiler::_('Registry');
|
||||
@ -101,7 +99,7 @@
|
||||
$this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser');
|
||||
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
|
||||
$this->dynamic = $dynamic ?: Compiler::_('Model.Dynamicget');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,9 +121,6 @@
|
||||
|
||||
$ids = implode(',', $ids);
|
||||
|
||||
// for plugin event TODO change event api signatures
|
||||
$component_context = $this->config->component_context;
|
||||
|
||||
// Create a new query object.
|
||||
$query = $this->db->getQuery(true);
|
||||
$query->select('a.*');
|
||||
@ -142,8 +137,7 @@
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeModelDynamicGetData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeModelDynamicGetData',
|
||||
array(&$component_context, &$result, &$result->id, &$view_code, &$context)
|
||||
'jcb_ce_onBeforeModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context]
|
||||
);
|
||||
|
||||
// set GUI mapper id
|
||||
@ -276,8 +270,7 @@
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterModelDynamicGetData
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterModelDynamicGetData',
|
||||
array(&$component_context, &$result, &$result->id, &$view_code, &$context)
|
||||
'jcb_ce_onAfterModelDynamicGetData', [&$result, &$result->id, &$view_code, &$context]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -716,8 +716,8 @@ class Structure
|
||||
$bucket[] = Indent::_(2) . "//"
|
||||
. Line::_(__Line__, __Class__) . " Custom CSS";
|
||||
$bucket[] = Indent::_(2)
|
||||
. "\$document->addStyleSheet('" . $targetPath
|
||||
. "/modules/" . $module->folder_name
|
||||
. "Html::_('stylesheet', "
|
||||
. "modules/" . $module->folder_name
|
||||
. "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);";
|
||||
}
|
||||
}
|
||||
@ -771,7 +771,7 @@ class Structure
|
||||
$bucket[] = Indent::_(2) . "//"
|
||||
. Line::_(__Line__, __Class__) . " Custom JS";
|
||||
$bucket[] = Indent::_(2)
|
||||
. "\$document->addScript('" . $targetPath
|
||||
. "Html::_('script', "
|
||||
. "/modules/" . $module->folder_name
|
||||
. "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);";
|
||||
}
|
||||
@ -839,14 +839,30 @@ class Structure
|
||||
if ($add_component_path)
|
||||
{
|
||||
$xml .= PHP_EOL . '<form';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addrulepath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/rules"';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addfieldpath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/fields"';
|
||||
|
||||
if ($this->config->get('joomla_version', 3) == 3)
|
||||
{
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addrulepath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/rules"';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addfieldpath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/fields"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addruleprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Rule"';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
.'addfieldprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Field"';
|
||||
}
|
||||
|
||||
$xml .= PHP_EOL . '>';
|
||||
}
|
||||
else
|
||||
|
@ -675,8 +675,8 @@
|
||||
$bucket[] = Indent::_(2) . "//"
|
||||
. Line::_(__Line__, __Class__) . " Custom CSS";
|
||||
$bucket[] = Indent::_(2)
|
||||
. "\$document->addStyleSheet('" . $targetPath
|
||||
. "/modules/" . $module->folder_name
|
||||
. "Html::_('stylesheet', "
|
||||
. "modules/" . $module->folder_name
|
||||
. "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);";
|
||||
}
|
||||
}
|
||||
@ -730,7 +730,7 @@
|
||||
$bucket[] = Indent::_(2) . "//"
|
||||
. Line::_(__Line__, __Class__) . " Custom JS";
|
||||
$bucket[] = Indent::_(2)
|
||||
. "\$document->addScript('" . $targetPath
|
||||
. "Html::_('script', "
|
||||
. "/modules/" . $module->folder_name
|
||||
. "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);";
|
||||
}
|
||||
@ -798,14 +798,30 @@
|
||||
if ($add_component_path)
|
||||
{
|
||||
$xml .= PHP_EOL . '<form';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addrulepath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/rules"';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addfieldpath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/fields"';
|
||||
|
||||
if ($this->config->get('joomla_version', 3) == 3)
|
||||
{
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addrulepath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/rules"';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addfieldpath="/administrator/components/com_'
|
||||
. $this->config->component_code_name
|
||||
. '/models/fields"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
. 'addruleprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Rule"';
|
||||
$xml .= PHP_EOL . Indent::_(1)
|
||||
.'addfieldprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Field"';
|
||||
}
|
||||
|
||||
$xml .= PHP_EOL . '>';
|
||||
}
|
||||
else
|
||||
|
31
src/0a524af3-f647-4f62-a422-d7d36ebe749b/README.md
Normal file
31
src/0a524af3-f647-4f62-a422-d7d36ebe749b/README.md
Normal file
@ -0,0 +1,31 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class ConfigFieldsets (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder**
|
||||
> extends: **Registry**
|
||||
```uml
|
||||
@startuml
|
||||
class ConfigFieldsets << (F,LightGreen) >> #RoyalBlue {
|
||||
# bool $addAsArray
|
||||
}
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
34
src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php
Normal file
34
src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Config Field Sets Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ConfigFieldsets extends Registry implements Registryinterface
|
||||
{
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
||||
}
|
||||
|
7
src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.power
Normal file
7
src/0a524af3-f647-4f62-a422-d7d36ebe749b/code.power
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Base switch to add values as string or array
|
||||
*
|
||||
* @var boolean
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected bool $addAsArray = true;
|
20
src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json
Normal file
20
src/0a524af3-f647-4f62-a422-d7d36ebe749b/settings.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7",
|
||||
"guid": "0a524af3-f647-4f62-a422-d7d36ebe749b",
|
||||
"implements": [
|
||||
"64e291c2-11f1-423d-a44d-837cc12cc017"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "ConfigFieldsets",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Builder.ConfigFieldsets",
|
||||
"type": "final class",
|
||||
"use_selection": null,
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.ConfigFieldsets",
|
||||
"description": "Config Field Sets Builder Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
65
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/README.md
Normal file
65
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/README.md
Normal file
@ -0,0 +1,65 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class ConfigFieldsetsGlobal (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator**
|
||||
```uml
|
||||
@startuml
|
||||
class ConfigFieldsetsGlobal << (F,LightGreen) >> #RoyalBlue {
|
||||
# Config $config
|
||||
# Language $language
|
||||
# Component $component
|
||||
# Contributors $contributors
|
||||
# ConfigFieldsets $configfieldsets
|
||||
# ExtensionsParams $extensionsparams
|
||||
# Customfield $customfield
|
||||
+ __construct(Config $config, Language $language, ...)
|
||||
+ set(string $lang, string $authorName, ...) : void
|
||||
}
|
||||
|
||||
note right of ConfigFieldsetsGlobal::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
Config $config
|
||||
Language $language
|
||||
Component $component
|
||||
Contributors $contributors
|
||||
ConfigFieldsets $configfieldsets
|
||||
ExtensionsParams $extensionsparams
|
||||
Customfield $customfield
|
||||
end note
|
||||
|
||||
note right of ConfigFieldsetsGlobal::set
|
||||
Set Global Config Fieldsets
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
|
||||
arguments:
|
||||
string $lang
|
||||
string $authorName
|
||||
string $authorEmail
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
634
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php
Normal file
634
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.php
Normal file
@ -0,0 +1,634 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Creator;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Language;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Component;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
|
||||
|
||||
/**
|
||||
* Config Fieldsets Global Creator Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ConfigFieldsetsGlobal
|
||||
{
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Language Class.
|
||||
*
|
||||
* @var Language
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Language $language;
|
||||
|
||||
/**
|
||||
* The Component Class.
|
||||
*
|
||||
* @var Component
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Component $component;
|
||||
|
||||
/**
|
||||
* The Contributors Class.
|
||||
*
|
||||
* @var Contributors
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Contributors $contributors;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsets Class.
|
||||
*
|
||||
* @var ConfigFieldsets
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsets $configfieldsets;
|
||||
|
||||
/**
|
||||
* The ExtensionsParams Class.
|
||||
*
|
||||
* @var ExtensionsParams
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ExtensionsParams $extensionsparams;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var Customfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customfield $customfield;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Language $language The Language Class.
|
||||
* @param Component $component The Component Class.
|
||||
* @param Contributors $contributors The Contributors Class.
|
||||
* @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class.
|
||||
* @param ExtensionsParams $extensionsparams The ExtensionsParams Class.
|
||||
* @param Customfield $customfield The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Language $language, Component $component,
|
||||
Contributors $contributors,
|
||||
ConfigFieldsets $configfieldsets,
|
||||
ExtensionsParams $extensionsparams,
|
||||
Customfield $customfield)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->language = $language;
|
||||
$this->component = $component;
|
||||
$this->contributors = $contributors;
|
||||
$this->configfieldsets = $configfieldsets;
|
||||
$this->extensionsparams = $extensionsparams;
|
||||
$this->customfield = $customfield;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Global Config Fieldsets
|
||||
*
|
||||
* @param string $lang
|
||||
* @param string $authorName
|
||||
* @param string $authorEmail
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function set(string $lang, string $authorName, string $authorEmail): void
|
||||
{
|
||||
// start building field set for config
|
||||
$this->configfieldsets->add('component', '<fieldset');
|
||||
|
||||
if ($this->config->get('joomla_version', 3) == 3)
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addrulepath="/administrator/components/com_' . $this->config->component_code_name
|
||||
. '/models/rules"');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addfieldpath="/administrator/components/com_' . $this->config->component_code_name
|
||||
. '/models/fields"');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addruleprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Rule"');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addfieldprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Field"');
|
||||
}
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'name="global_config"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang
|
||||
. '_GLOBAL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang
|
||||
. '_GLOBAL_DESC">');
|
||||
// setup lang
|
||||
$this->language->set($this->config->lang_target, $lang . '_GLOBAL_LABEL', "Global");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_GLOBAL_DESC', "The Global Parameters"
|
||||
);
|
||||
|
||||
// add auto checkin if required
|
||||
if ($this->config->get('add_checkin', false))
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "<field");
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'name="check_in"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="0"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_CHECK_TIMER_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang
|
||||
. '_CHECK_TIMER_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-5 hours">'
|
||||
. $lang . '_CHECK_TIMER_OPTION_ONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-12 hours">'
|
||||
. $lang . '_CHECK_TIMER_OPTION_TWO</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-1 day">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_THREE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-2 day">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_FOUR</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-1 week">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_FIVE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="0">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_SIX</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerAuthor" hr="true" />');
|
||||
// setup lang
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_LABEL', "Check in timer"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_DESC',
|
||||
"Set the intervals for the auto checkin fuction of tables that checks out the items to an user."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_ONE',
|
||||
"Every five hours"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_TWO',
|
||||
"Every twelve hours"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FOUR',
|
||||
"Every second day"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_SIX', "Never"
|
||||
);
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"check_in":"-1 day"');
|
||||
}
|
||||
|
||||
// set history control
|
||||
if ($this->config->get('set_tag_history', false))
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "<field");
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'name="save_history"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="radio"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'class="btn-group btn-group-yesno"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="1"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . ">");
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. '<option value="1">JYES</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. '<option value="0">JNO</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "<field");
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'name="history_limit"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'filter="integer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="10"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerHistory" hr="true" />');
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"save_history":"1","history_limit":"10"');
|
||||
}
|
||||
// add custom global fields
|
||||
if ($this->customfield->isArray('Global'))
|
||||
{
|
||||
$this->configfieldsets->add('component', implode(
|
||||
"", $this->customfield->get('Global')
|
||||
));
|
||||
$this->customfield->remove('Global');
|
||||
}
|
||||
// set the author details
|
||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="autorTitle"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="spacer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_AUTHOR"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="autorName"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_AUTHOR_NAME_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang
|
||||
. '_AUTHOR_NAME_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorName . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="autorEmail"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="email"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_AUTHOR_EMAIL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang
|
||||
. '_AUTHOR_EMAIL_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorEmail . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
// setup lang
|
||||
$this->language->set($this->config->lang_target, $lang . '_AUTHOR', "Author Info");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_NAME_LABEL', "Author Name"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_NAME_DESC',
|
||||
"The name of the author of this component."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_EMAIL_DESC',
|
||||
"The email address of the author of this component."
|
||||
);
|
||||
|
||||
// set if contributors were added
|
||||
$langCont = $lang . '_CONTRIBUTOR';
|
||||
if ($this->config->get('add_contributors', false)
|
||||
&& $this->component->isArray('contributors'))
|
||||
{
|
||||
foreach (
|
||||
$this->component->get('contributors') as $counter => $contributor
|
||||
)
|
||||
{
|
||||
// make sure we dont use 0
|
||||
$counter++;
|
||||
// get the word for this number
|
||||
$COUNTER = StringHelper::safe($counter, 'U');
|
||||
// set the dynamic values
|
||||
$cbTitle = htmlspecialchars(
|
||||
(string) $contributor['title'], ENT_XML1, 'UTF-8'
|
||||
);
|
||||
$cbName = htmlspecialchars(
|
||||
(string) $contributor['name'], ENT_XML1, 'UTF-8'
|
||||
);
|
||||
$cbEmail = htmlspecialchars(
|
||||
(string) $contributor['email'], ENT_XML1, 'UTF-8'
|
||||
);
|
||||
$cbWebsite = htmlspecialchars(
|
||||
(string) $contributor['website'], ENT_XML1, 'UTF-8'
|
||||
); // StringHelper::html($contributor['website']);
|
||||
// load to the $fieldsets
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerContributor' . $counter
|
||||
. '" hr="true" />');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="contributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="spacer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_' . $COUNTER . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="titleContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_TITLE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_TITLE_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbTitle
|
||||
. '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="nameContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_NAME_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_NAME_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbName
|
||||
. '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="emailContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="email"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_EMAIL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_EMAIL_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbEmail
|
||||
. '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="linkContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="url"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_LINK_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_LINK_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="'
|
||||
. $cbWebsite . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="useContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="'
|
||||
. (int) $contributor['use'] . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_USE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_USE_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_USE_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_USE_EMAIL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_USE_WWW</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="showContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="'
|
||||
. (int) $contributor['show'] . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_SHOW_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_SHOW_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_SHOW_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_SHOW_BACK</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_SHOW_FRONT</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="3">'
|
||||
. $langCont . '_SHOW_ALL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
// add the contributor
|
||||
$this->contributors->add('bom', PHP_EOL . Indent::_(1) . "@"
|
||||
. strtolower((string) $contributor['title']) . Indent::_(2)
|
||||
. $contributor['name'] . ' <' . $contributor['website']
|
||||
. '>');
|
||||
// setup lang
|
||||
$Counter = StringHelper::safe($counter, 'Ww');
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_' . $COUNTER,
|
||||
"Contributor " . $Counter
|
||||
);
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"titleContributor' . $counter
|
||||
. '":"' . $cbTitle . '"');
|
||||
$this->extensionsparams->add('component', '"nameContributor' . $counter
|
||||
. '":"' . $cbName . '"');
|
||||
$this->extensionsparams->add('component', '"emailContributor' . $counter
|
||||
. '":"' . $cbEmail . '"');
|
||||
$this->extensionsparams->add('component', '"linkContributor' . $counter
|
||||
. '":"' . $cbWebsite . '"');
|
||||
$this->extensionsparams->add('component', '"useContributor' . $counter . '":"'
|
||||
. (int) $contributor['use'] . '"');
|
||||
$this->extensionsparams->add('component', '"showContributor' . $counter
|
||||
. '":"' . (int) $contributor['show'] . '"');
|
||||
}
|
||||
}
|
||||
|
||||
// add more contributors if required
|
||||
if (1 == $this->component->get('emptycontributors', 0))
|
||||
{
|
||||
if (isset($counter))
|
||||
{
|
||||
$min = $counter + 1;
|
||||
unset($counter);
|
||||
}
|
||||
else
|
||||
{
|
||||
$min = 1;
|
||||
}
|
||||
$max = $min + $this->component->get('number') - 1;
|
||||
$moreContributerFields = range($min, $max, 1);
|
||||
foreach ($moreContributerFields as $counter)
|
||||
{
|
||||
$COUNTER = StringHelper::safe($counter, 'U');
|
||||
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerContributor' . $counter
|
||||
. '" hr="true" />');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="contributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="spacer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_' . $COUNTER . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="titleContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_TITLE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_TITLE_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="nameContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_NAME_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_NAME_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="emailContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="email"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_EMAIL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_EMAIL_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="linkContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="url"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_LINK_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_LINK_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="useContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="0"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_USE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_USE_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_USE_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_USE_EMAIL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_USE_WWW</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="showContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="0"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_SHOW_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_SHOW_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_SHOW_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_SHOW_BACK</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_SHOW_FRONT</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="3">'
|
||||
. $langCont . '_SHOW_ALL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
// setup lang
|
||||
$Counter = StringHelper::safe($counter, 'Ww');
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_' . $COUNTER,
|
||||
"Contributor " . $Counter
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->config->get('add_contributors', false)
|
||||
|| $this->component->get('emptycontributors', 0) == 1)
|
||||
{
|
||||
// setup lang
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_TITLE_LABEL', "Contributor Job Title"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_TITLE_DESC',
|
||||
"The job title that best describes the contributor's relationship to this component."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_NAME_LABEL', "Contributor Name"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_NAME_DESC',
|
||||
"The name of this contributor."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_EMAIL_LABEL', "Contributor Email"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_EMAIL_DESC',
|
||||
"The email of this contributor."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_LINK_LABEL', "Contributor Website"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_LINK_DESC',
|
||||
"The link to this contributor's website."
|
||||
);
|
||||
$this->language->set($this->config->lang_target, $langCont . '_USE_LABEL', "Use");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_USE_DESC',
|
||||
"How should we link to this contributor."
|
||||
);
|
||||
$this->language->set($this->config->lang_target, $langCont . '_USE_NONE', "None");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_USE_EMAIL', "Email"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_USE_WWW', "Website"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_LABEL', "Show"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_DESC',
|
||||
"Select where you want this contributor's details to show in the component."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_NONE', "Hide"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_BACK', "Back-end"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_FRONT', "Front-end"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_ALL', "Both Front & Back-end"
|
||||
);
|
||||
}
|
||||
|
||||
// close that fieldset
|
||||
$this->configfieldsets->add('component', Indent::_(1) . "</fieldset>");
|
||||
}
|
||||
}
|
||||
|
600
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.power
Normal file
600
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/code.power
Normal file
@ -0,0 +1,600 @@
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Language Class.
|
||||
*
|
||||
* @var Language
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Language $language;
|
||||
|
||||
/**
|
||||
* The Component Class.
|
||||
*
|
||||
* @var Component
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Component $component;
|
||||
|
||||
/**
|
||||
* The Contributors Class.
|
||||
*
|
||||
* @var Contributors
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Contributors $contributors;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsets Class.
|
||||
*
|
||||
* @var ConfigFieldsets
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsets $configfieldsets;
|
||||
|
||||
/**
|
||||
* The ExtensionsParams Class.
|
||||
*
|
||||
* @var ExtensionsParams
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ExtensionsParams $extensionsparams;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var Customfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customfield $customfield;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Language $language The Language Class.
|
||||
* @param Component $component The Component Class.
|
||||
* @param Contributors $contributors The Contributors Class.
|
||||
* @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class.
|
||||
* @param ExtensionsParams $extensionsparams The ExtensionsParams Class.
|
||||
* @param Customfield $customfield The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Language $language, Component $component,
|
||||
Contributors $contributors,
|
||||
ConfigFieldsets $configfieldsets,
|
||||
ExtensionsParams $extensionsparams,
|
||||
Customfield $customfield)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->language = $language;
|
||||
$this->component = $component;
|
||||
$this->contributors = $contributors;
|
||||
$this->configfieldsets = $configfieldsets;
|
||||
$this->extensionsparams = $extensionsparams;
|
||||
$this->customfield = $customfield;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Global Config Fieldsets
|
||||
*
|
||||
* @param string $lang
|
||||
* @param string $authorName
|
||||
* @param string $authorEmail
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function set(string $lang, string $authorName, string $authorEmail): void
|
||||
{
|
||||
// start building field set for config
|
||||
$this->configfieldsets->add('component', '<fieldset');
|
||||
|
||||
if ($this->config->get('joomla_version', 3) == 3)
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addrulepath="/administrator/components/com_' . $this->config->component_code_name
|
||||
. '/models/rules"');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addfieldpath="/administrator/components/com_' . $this->config->component_code_name
|
||||
. '/models/fields"');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addruleprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Rule"');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. 'addfieldprefix="' . $this->config->namespace_prefix
|
||||
. '\Component\\' . StringHelper::safe($this->config->component_code_name, 'F')
|
||||
. '\Administrator\Field"');
|
||||
}
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'name="global_config"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang
|
||||
. '_GLOBAL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'description="' . $lang
|
||||
. '_GLOBAL_DESC">');
|
||||
// setup lang
|
||||
$this->language->set($this->config->lang_target, $lang . '_GLOBAL_LABEL', "Global");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_GLOBAL_DESC', "The Global Parameters"
|
||||
);
|
||||
|
||||
// add auto checkin if required
|
||||
if ($this->config->get('add_checkin', false))
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "<field");
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'name="check_in"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="0"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_CHECK_TIMER_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang
|
||||
. '_CHECK_TIMER_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-5 hours">'
|
||||
. $lang . '_CHECK_TIMER_OPTION_ONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-12 hours">'
|
||||
. $lang . '_CHECK_TIMER_OPTION_TWO</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-1 day">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_THREE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-2 day">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_FOUR</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="-1 week">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_FIVE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option');
|
||||
$this->configfieldsets->add('component', Indent::_(4) . 'value="0">' . $lang
|
||||
. '_CHECK_TIMER_OPTION_SIX</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerAuthor" hr="true" />');
|
||||
// setup lang
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_LABEL', "Check in timer"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_DESC',
|
||||
"Set the intervals for the auto checkin fuction of tables that checks out the items to an user."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_ONE',
|
||||
"Every five hours"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_TWO',
|
||||
"Every twelve hours"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FOUR',
|
||||
"Every second day"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_CHECK_TIMER_OPTION_SIX', "Never"
|
||||
);
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"check_in":"-1 day"');
|
||||
}
|
||||
|
||||
// set history control
|
||||
if ($this->config->get('set_tag_history', false))
|
||||
{
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "<field");
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'name="save_history"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="radio"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'class="btn-group btn-group-yesno"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="1"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . ">");
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. '<option value="1">JYES</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. '<option value="0">JNO</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "<field");
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'name="history_limit"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'filter="integer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3)
|
||||
. 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="10"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerHistory" hr="true" />');
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"save_history":"1","history_limit":"10"');
|
||||
}
|
||||
// add custom global fields
|
||||
if ($this->customfield->isArray('Global'))
|
||||
{
|
||||
$this->configfieldsets->add('component', implode(
|
||||
"", $this->customfield->get('Global')
|
||||
));
|
||||
$this->customfield->remove('Global');
|
||||
}
|
||||
// set the author details
|
||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="autorTitle"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="spacer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_AUTHOR"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="autorName"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_AUTHOR_NAME_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang
|
||||
. '_AUTHOR_NAME_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorName . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="autorEmail"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="email"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $lang
|
||||
. '_AUTHOR_EMAIL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="' . $lang
|
||||
. '_AUTHOR_EMAIL_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $authorEmail . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'readonly="true"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="readonly"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
// setup lang
|
||||
$this->language->set($this->config->lang_target, $lang . '_AUTHOR', "Author Info");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_NAME_LABEL', "Author Name"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_NAME_DESC',
|
||||
"The name of the author of this component."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_AUTHOR_EMAIL_DESC',
|
||||
"The email address of the author of this component."
|
||||
);
|
||||
|
||||
// set if contributors were added
|
||||
$langCont = $lang . '_CONTRIBUTOR';
|
||||
if ($this->config->get('add_contributors', false)
|
||||
&& $this->component->isArray('contributors'))
|
||||
{
|
||||
foreach (
|
||||
$this->component->get('contributors') as $counter => $contributor
|
||||
)
|
||||
{
|
||||
// make sure we dont use 0
|
||||
$counter++;
|
||||
// get the word for this number
|
||||
$COUNTER = StringHelper::safe($counter, 'U');
|
||||
// set the dynamic values
|
||||
$cbTitle = htmlspecialchars(
|
||||
(string) $contributor['title'], ENT_XML1, 'UTF-8'
|
||||
);
|
||||
$cbName = htmlspecialchars(
|
||||
(string) $contributor['name'], ENT_XML1, 'UTF-8'
|
||||
);
|
||||
$cbEmail = htmlspecialchars(
|
||||
(string) $contributor['email'], ENT_XML1, 'UTF-8'
|
||||
);
|
||||
$cbWebsite = htmlspecialchars(
|
||||
(string) $contributor['website'], ENT_XML1, 'UTF-8'
|
||||
); // StringHelper::html($contributor['website']);
|
||||
// load to the $fieldsets
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerContributor' . $counter
|
||||
. '" hr="true" />');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="contributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="spacer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_' . $COUNTER . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="titleContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_TITLE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_TITLE_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbTitle
|
||||
. '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="nameContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_NAME_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_NAME_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbName
|
||||
. '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="emailContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="email"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_EMAIL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_EMAIL_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="' . $cbEmail
|
||||
. '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="linkContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="url"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_LINK_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_LINK_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="'
|
||||
. $cbWebsite . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="useContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="'
|
||||
. (int) $contributor['use'] . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_USE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_USE_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_USE_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_USE_EMAIL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_USE_WWW</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="showContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="'
|
||||
. (int) $contributor['show'] . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_SHOW_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_SHOW_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_SHOW_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_SHOW_BACK</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_SHOW_FRONT</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="3">'
|
||||
. $langCont . '_SHOW_ALL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
// add the contributor
|
||||
$this->contributors->add('bom', PHP_EOL . Indent::_(1) . "@"
|
||||
. strtolower((string) $contributor['title']) . Indent::_(2)
|
||||
. $contributor['name'] . ' <' . $contributor['website']
|
||||
. '>');
|
||||
// setup lang
|
||||
$Counter = StringHelper::safe($counter, 'Ww');
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_' . $COUNTER,
|
||||
"Contributor " . $Counter
|
||||
);
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"titleContributor' . $counter
|
||||
. '":"' . $cbTitle . '"');
|
||||
$this->extensionsparams->add('component', '"nameContributor' . $counter
|
||||
. '":"' . $cbName . '"');
|
||||
$this->extensionsparams->add('component', '"emailContributor' . $counter
|
||||
. '":"' . $cbEmail . '"');
|
||||
$this->extensionsparams->add('component', '"linkContributor' . $counter
|
||||
. '":"' . $cbWebsite . '"');
|
||||
$this->extensionsparams->add('component', '"useContributor' . $counter . '":"'
|
||||
. (int) $contributor['use'] . '"');
|
||||
$this->extensionsparams->add('component', '"showContributor' . $counter
|
||||
. '":"' . (int) $contributor['show'] . '"');
|
||||
}
|
||||
}
|
||||
|
||||
// add more contributors if required
|
||||
if (1 == $this->component->get('emptycontributors', 0))
|
||||
{
|
||||
if (isset($counter))
|
||||
{
|
||||
$min = $counter + 1;
|
||||
unset($counter);
|
||||
}
|
||||
else
|
||||
{
|
||||
$min = 1;
|
||||
}
|
||||
$max = $min + $this->component->get('number') - 1;
|
||||
$moreContributerFields = range($min, $max, 1);
|
||||
foreach ($moreContributerFields as $counter)
|
||||
{
|
||||
$COUNTER = StringHelper::safe($counter, 'U');
|
||||
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field type="spacer" name="spacerContributor' . $counter
|
||||
. '" hr="true" />');
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="contributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="spacer"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'class="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_' . $COUNTER . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="titleContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_TITLE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_TITLE_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="nameContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="text"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_NAME_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_NAME_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="emailContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="email"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_EMAIL_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_EMAIL_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="linkContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="url"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_LINK_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_LINK_DESC"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'size="60"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default=""');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "/>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="useContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="0"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_USE_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_USE_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_USE_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_USE_EMAIL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_USE_WWW</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
$this->configfieldsets->add('component', Indent::_(2)
|
||||
. '<field name="showContributor' . $counter . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="list"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'default="0"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $langCont
|
||||
. '_SHOW_LABEL"');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||
. $langCont . '_SHOW_DESC">');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="0">'
|
||||
. $langCont . '_SHOW_NONE</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="1">'
|
||||
. $langCont . '_SHOW_BACK</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="2">'
|
||||
. $langCont . '_SHOW_FRONT</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(3) . '<option value="3">'
|
||||
. $langCont . '_SHOW_ALL</option>');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . "</field>");
|
||||
// setup lang
|
||||
$Counter = StringHelper::safe($counter, 'Ww');
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_' . $COUNTER,
|
||||
"Contributor " . $Counter
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->config->get('add_contributors', false)
|
||||
|| $this->component->get('emptycontributors', 0) == 1)
|
||||
{
|
||||
// setup lang
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_TITLE_LABEL', "Contributor Job Title"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_TITLE_DESC',
|
||||
"The job title that best describes the contributor's relationship to this component."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_NAME_LABEL', "Contributor Name"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_NAME_DESC',
|
||||
"The name of this contributor."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_EMAIL_LABEL', "Contributor Email"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_EMAIL_DESC',
|
||||
"The email of this contributor."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_LINK_LABEL', "Contributor Website"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_LINK_DESC',
|
||||
"The link to this contributor's website."
|
||||
);
|
||||
$this->language->set($this->config->lang_target, $langCont . '_USE_LABEL', "Use");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_USE_DESC',
|
||||
"How should we link to this contributor."
|
||||
);
|
||||
$this->language->set($this->config->lang_target, $langCont . '_USE_NONE', "None");
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_USE_EMAIL', "Email"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_USE_WWW', "Website"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_LABEL', "Show"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_DESC',
|
||||
"Select where you want this contributor's details to show in the component."
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_NONE', "Hide"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_BACK', "Back-end"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_FRONT', "Front-end"
|
||||
);
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $langCont . '_SHOW_ALL', "Both Front & Back-end"
|
||||
);
|
||||
}
|
||||
|
||||
// close that fieldset
|
||||
$this->configfieldsets->add('component', Indent::_(1) . "</fieldset>");
|
||||
}
|
55
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json
Normal file
55
src/0fe3133d-1ff3-4444-9229-4218d8fb338e/settings.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "0fe3133d-1ff3-4444-9229-4218d8fb338e",
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "ConfigFieldsetsGlobal",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Creator.ConfigFieldsetsGlobal",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "8eee7df5-2775-41a9-9372-c46c5939a252",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "274a78d1-24c2-4486-b560-b86e9ae72872",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use": "0a524af3-f647-4f62-a422-d7d36ebe749b",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection5": {
|
||||
"use": "bcf1e767-1566-440d-9f67-5c1bada934fa",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection6": {
|
||||
"use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b",
|
||||
"as": "Customfield"
|
||||
},
|
||||
"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.Creator.ConfigFieldsetsGlobal",
|
||||
"description": "Config Fieldsets Global Creator Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -11,8 +11,8 @@
|
||||
```uml
|
||||
@startuml
|
||||
class Groups << (F,LightGreen) >> #RoyalBlue {
|
||||
# \JDatabaseDriver $db
|
||||
+ __construct(?\JDatabaseDriver $db = null)
|
||||
# $db
|
||||
+ __construct()
|
||||
+ check(string $type, string $option = 'default') : bool
|
||||
+ types(array $groups = []) : ?array
|
||||
+ typesIds(array $groups = []) : ?array
|
||||
|
@ -71,21 +71,18 @@ final class Groups
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?\JDatabaseDriver $db = null)
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,21 +45,18 @@
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?\JDatabaseDriver $db = null)
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->db = Factory::getDbo();
|
||||
}
|
||||
|
||||
/**
|
||||
|
74
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/README.md
Normal file
74
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/README.md
Normal file
@ -0,0 +1,74 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class AccessSections (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator**
|
||||
```uml
|
||||
@startuml
|
||||
class AccessSections << (F,LightGreen) >> #RoyalBlue {
|
||||
# Config $config
|
||||
# Event $event
|
||||
# Language $language
|
||||
# Component $component
|
||||
# FieldName $fieldname
|
||||
# TypeName $typename
|
||||
# Counter $counter
|
||||
# Permission $permission
|
||||
# AssetsRules $assetsrules
|
||||
# CustomTabs $customtabs
|
||||
# PermissionViews $permissionviews
|
||||
# PermissionFields $permissionfields
|
||||
# PermissionComponent $permissioncomponent
|
||||
# CustomButtonPermissions $custombuttonpermissions
|
||||
+ __construct(Config $config, Event $event, ...)
|
||||
+ get() : string
|
||||
}
|
||||
|
||||
note right of AccessSections::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
Config $config
|
||||
Event $event
|
||||
Language $language
|
||||
Component $component
|
||||
FieldName $fieldname
|
||||
TypeName $typename
|
||||
Counter $counter
|
||||
Permission $permission
|
||||
AssetsRules $assetsrules
|
||||
CustomTabs $customtabs
|
||||
PermissionViews $permissionviews
|
||||
PermissionFields $permissionfields
|
||||
PermissionComponent $permissioncomponent
|
||||
CustomButtonPermissions $custombuttonpermissions
|
||||
end note
|
||||
|
||||
note right of AccessSections::get
|
||||
Get Access Sections
|
||||
|
||||
since: 3.2.0
|
||||
return: string
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
709
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php
Normal file
709
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.php
Normal file
@ -0,0 +1,709 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Creator;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Language;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Component;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomButtonPermissions;
|
||||
use VDM\Joomla\Utilities\MathHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Access Sections Creator Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class AccessSections
|
||||
{
|
||||
/**
|
||||
* 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 Language Class.
|
||||
*
|
||||
* @var Language
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Language $language;
|
||||
|
||||
/**
|
||||
* The Component Class.
|
||||
*
|
||||
* @var Component
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Component $component;
|
||||
|
||||
/**
|
||||
* The Name Class.
|
||||
*
|
||||
* @var FieldName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected FieldName $fieldname;
|
||||
|
||||
/**
|
||||
* The TypeName Class.
|
||||
*
|
||||
* @var TypeName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected TypeName $typename;
|
||||
|
||||
/**
|
||||
* The Counter Class.
|
||||
*
|
||||
* @var Counter
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Counter $counter;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The AssetsRules Class.
|
||||
*
|
||||
* @var AssetsRules
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected AssetsRules $assetsrules;
|
||||
|
||||
/**
|
||||
* The CustomTabs Class.
|
||||
*
|
||||
* @var CustomTabs
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CustomTabs $customtabs;
|
||||
|
||||
/**
|
||||
* The PermissionViews Class.
|
||||
*
|
||||
* @var PermissionViews
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected PermissionViews $permissionviews;
|
||||
|
||||
/**
|
||||
* The PermissionFields Class.
|
||||
*
|
||||
* @var PermissionFields
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected PermissionFields $permissionfields;
|
||||
|
||||
/**
|
||||
* The PermissionComponent Class.
|
||||
*
|
||||
* @var PermissionComponent
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected PermissionComponent $permissioncomponent;
|
||||
|
||||
/**
|
||||
* The CustomButtonPermissions Class.
|
||||
*
|
||||
* @var CustomButtonPermissions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CustomButtonPermissions $custombuttonpermissions;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Event $event The EventInterface Class.
|
||||
* @param Language $language The Language Class.
|
||||
* @param Component $component The Component Class.
|
||||
* @param FieldName $fieldname The Name Class.
|
||||
* @param TypeName $typename The TypeName Class.
|
||||
* @param Counter $counter The Counter Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param AssetsRules $assetsrules The AssetsRules Class.
|
||||
* @param CustomTabs $customtabs The CustomTabs Class.
|
||||
* @param PermissionViews $permissionviews The PermissionViews Class.
|
||||
* @param PermissionFields $permissionfields The PermissionFields Class.
|
||||
* @param PermissionComponent $permissioncomponent The PermissionComponent Class.
|
||||
* @param CustomButtonPermissions $custombuttonpermissions The CustomButtonPermissions Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Event $event, Language $language,
|
||||
Component $component, FieldName $fieldname,
|
||||
TypeName $typename, Counter $counter,
|
||||
Permission $permission, AssetsRules $assetsrules,
|
||||
CustomTabs $customtabs, PermissionViews $permissionviews,
|
||||
PermissionFields $permissionfields,
|
||||
PermissionComponent $permissioncomponent,
|
||||
CustomButtonPermissions $custombuttonpermissions)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->event = $event;
|
||||
$this->language = $language;
|
||||
$this->component = $component;
|
||||
$this->fieldname = $fieldname;
|
||||
$this->typename = $typename;
|
||||
$this->counter = $counter;
|
||||
$this->permission = $permission;
|
||||
$this->assetsrules = $assetsrules;
|
||||
$this->customtabs = $customtabs;
|
||||
$this->permissionviews = $permissionviews;
|
||||
$this->permissionfields = $permissionfields;
|
||||
$this->permissioncomponent = $permissioncomponent;
|
||||
$this->custombuttonpermissions = $custombuttonpermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Access Sections
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(): string
|
||||
{
|
||||
// access size counter
|
||||
$this->counter->accessSize = 12; // ;)
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeBuildAccessSections
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeBuildAccessSections'
|
||||
);
|
||||
|
||||
// Get the default fields
|
||||
$default_fields = $this->config->default_fields;
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.admin',
|
||||
'title' => 'JACTION_ADMIN',
|
||||
'description' => 'JACTION_ADMIN_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.options',
|
||||
'title' => 'JACTION_OPTIONS',
|
||||
'description' => 'JACTION_OPTIONS_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.manage',
|
||||
'title' => 'JACTION_MANAGE',
|
||||
'description' => 'JACTION_MANAGE_COMPONENT_DESC'
|
||||
], true);
|
||||
|
||||
if ($this->config->get('add_eximport', false))
|
||||
{
|
||||
$exportTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Export Data', 'U');
|
||||
$exportDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Export Data', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $exportTitle, 'Export Data');
|
||||
$this->language->set(
|
||||
'bothadmin', $exportDesc,
|
||||
' Allows users in this group to export data.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.export',
|
||||
'title' => $exportTitle,
|
||||
'description' => $exportDesc
|
||||
], true);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
$importTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Import Data', 'U');
|
||||
$importDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Import Data', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $importTitle, 'Import Data');
|
||||
$this->language->set(
|
||||
'bothadmin', $importDesc,
|
||||
' Allows users in this group to import data.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.import',
|
||||
'title' => $importTitle,
|
||||
'description' => $importDesc
|
||||
], true);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
}
|
||||
|
||||
// version permission
|
||||
$batchTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Use Batch', 'U');
|
||||
$batchDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Use Batch', 'U') . '_DESC';
|
||||
$this->language->set('bothadmin', $batchTitle, 'Use Batch');
|
||||
$this->language->set(
|
||||
'bothadmin', $batchDesc,
|
||||
' Allows users in this group to use batch copy/update method.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.batch',
|
||||
'title' => $batchTitle,
|
||||
'description' => $batchDesc
|
||||
], true);
|
||||
|
||||
// version permission
|
||||
$importTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Versions', 'U');
|
||||
$importDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Versions', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $importTitle, 'Edit Version');
|
||||
$this->language->set(
|
||||
'bothadmin', $importDesc,
|
||||
' Allows users in this group to edit versions.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.version',
|
||||
'title' => $importTitle,
|
||||
'description' => $importDesc
|
||||
], true);
|
||||
|
||||
// set the defaults
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.create',
|
||||
'title' => 'JACTION_CREATE',
|
||||
'description' => 'JACTION_CREATE_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.delete',
|
||||
'title' => 'JACTION_DELETE',
|
||||
'description' => 'JACTION_DELETE_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit',
|
||||
'title' => 'JACTION_EDIT',
|
||||
'description' => 'JACTION_EDIT_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.state',
|
||||
'title' => 'JACTION_EDITSTATE',
|
||||
'description' => 'JACTION_ACCESS_EDITSTATE_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.own',
|
||||
'title' => 'JACTION_EDITOWN',
|
||||
'description' => 'JACTION_EDITOWN_COMPONENT_DESC'
|
||||
], true);
|
||||
|
||||
// set the Joomla fields
|
||||
if ($this->config->get('set_joomla_fields', false))
|
||||
{
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.value',
|
||||
'title' => 'JACTION_EDITVALUE',
|
||||
'description' => 'JACTION_EDITVALUE_COMPONENT_DESC'
|
||||
], true);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
}
|
||||
|
||||
// new custom created by permissions
|
||||
$created_byTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created By', 'U');
|
||||
$created_byDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created By', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $created_byTitle, 'Edit Created By');
|
||||
$this->language->set(
|
||||
'bothadmin', $created_byDesc,
|
||||
' Allows users in this group to edit created by.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.created_by',
|
||||
'title' => $created_byTitle,
|
||||
'description' => $created_byDesc
|
||||
], true);
|
||||
|
||||
// new custom created date permissions
|
||||
$createdTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created Date', 'U');
|
||||
$createdDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created Date', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $createdTitle, 'Edit Created Date');
|
||||
$this->language->set(
|
||||
'bothadmin', $createdDesc,
|
||||
' Allows users in this group to edit created date.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.created',
|
||||
'title' => $createdTitle,
|
||||
'description' => $createdDesc
|
||||
], true);
|
||||
|
||||
// set the menu controller lookup
|
||||
$menuControllers = ['access', 'submenu', 'dashboard_list', 'dashboard_add'];
|
||||
|
||||
// set the custom admin views permissions
|
||||
if ($this->component->isArray('custom_admin_views'))
|
||||
{
|
||||
foreach ($this->component->get('custom_admin_views') as $custom_admin_view)
|
||||
{
|
||||
// new custom permissions to access this view
|
||||
$customAdminName = $custom_admin_view['settings']->name;
|
||||
$customAdminCode = $custom_admin_view['settings']->code;
|
||||
$customAdminTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$customAdminName . ' Access', 'U'
|
||||
);
|
||||
$customAdminDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$customAdminName . ' Access', 'U'
|
||||
) . '_DESC';
|
||||
$sortKey = StringHelper::safe(
|
||||
$customAdminName . ' Access'
|
||||
);
|
||||
$this->language->set(
|
||||
'bothadmin', $customAdminTitle, $customAdminName . ' Access'
|
||||
);
|
||||
$this->language->set(
|
||||
'bothadmin', $customAdminDesc,
|
||||
' Allows the users in this group to access '
|
||||
. StringHelper::safe($customAdminName, 'w')
|
||||
. '.'
|
||||
);
|
||||
$this->permissioncomponent->set($sortKey, [
|
||||
'name' => "$customAdminCode.access",
|
||||
'title' => $customAdminTitle,
|
||||
'description' => $customAdminDesc
|
||||
]);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
|
||||
// add the custom permissions to use the buttons of this view
|
||||
$this->custombuttonpermissions->add(
|
||||
$custom_admin_view['settings'], $customAdminName,
|
||||
$customAdminCode
|
||||
);
|
||||
|
||||
// add menu controll view that has menus options
|
||||
foreach ($menuControllers as $menuController)
|
||||
{
|
||||
// add menu controll view that has menus options
|
||||
if (isset($custom_admin_view[$menuController])
|
||||
&& $custom_admin_view[$menuController])
|
||||
{
|
||||
$targetView_ = 'views.';
|
||||
if ($menuController === 'dashboard_add')
|
||||
{
|
||||
$targetView_ = 'view.';
|
||||
}
|
||||
|
||||
// menucontroller
|
||||
$menucontrollerView['action'] = $targetView_
|
||||
. $menuController;
|
||||
$menucontrollerView['implementation'] = '2';
|
||||
if (isset($custom_admin_view['settings']->permissions)
|
||||
&& ArrayHelper::check(
|
||||
$custom_admin_view['settings']->permissions
|
||||
))
|
||||
{
|
||||
array_push(
|
||||
$custom_admin_view['settings']->permissions,
|
||||
$menucontrollerView
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$custom_admin_view['settings']->permissions
|
||||
= [];
|
||||
$custom_admin_view['settings']->permissions[]
|
||||
= $menucontrollerView;
|
||||
}
|
||||
unset($menucontrollerView);
|
||||
}
|
||||
}
|
||||
|
||||
$this->permission ->set(
|
||||
$custom_admin_view, $customAdminCode, $customAdminCode,
|
||||
$menuControllers, 'customAdmin'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// set the site views permissions
|
||||
if ($this->component->isArray('site_views'))
|
||||
{
|
||||
foreach ($this->component->get('site_views') as $site_view)
|
||||
{
|
||||
// new custom permissions to access this view
|
||||
$siteName = $site_view['settings']->name;
|
||||
$siteCode = $site_view['settings']->code;
|
||||
$siteTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$siteName . ' Access Site', 'U'
|
||||
);
|
||||
$siteDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$siteName . ' Access Site', 'U'
|
||||
) . '_DESC';
|
||||
$sortKey = StringHelper::safe(
|
||||
$siteName . ' Access Site'
|
||||
);
|
||||
|
||||
if (isset($site_view['access']) && $site_view['access'] == 1)
|
||||
{
|
||||
$this->language->set(
|
||||
'bothadmin', $siteTitle, $siteName . ' (Site) Access'
|
||||
);
|
||||
$this->language->set(
|
||||
'bothadmin', $siteDesc,
|
||||
' Allows the users in this group to access site '
|
||||
. StringHelper::safe($siteName, 'w')
|
||||
. '.'
|
||||
);
|
||||
$this->permissioncomponent->set($sortKey, [
|
||||
'name' => "site.$siteCode.access",
|
||||
'title' => $siteTitle,
|
||||
'description' => $siteDesc
|
||||
]);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
|
||||
// check if this site view requires access rule to default to public
|
||||
if (isset($site_view['public_access'])
|
||||
&& $site_view['public_access'] == 1)
|
||||
{
|
||||
// we use one as public group (TODO we see if we run into any issues)
|
||||
$this->assetsrules->add('site', '"site.' . $siteCode
|
||||
. '.access":{"1":1}');
|
||||
}
|
||||
}
|
||||
|
||||
// add the custom permissions to use the buttons of this view
|
||||
$this->custombuttonpermissions->add(
|
||||
$site_view['settings'], $siteName, $siteCode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->component->isArray('admin_views'))
|
||||
{
|
||||
foreach ($this->component->get('admin_views') as $view)
|
||||
{
|
||||
// set view name
|
||||
$nameView = StringHelper::safe(
|
||||
$view['settings']->name_single
|
||||
);
|
||||
$nameViews = StringHelper::safe(
|
||||
$view['settings']->name_list
|
||||
);
|
||||
|
||||
// add custom tab permissions if found
|
||||
if (($tabs_ = $this->customtabs->get($nameView)) !== null
|
||||
&& ArrayHelper::check($tabs_))
|
||||
{
|
||||
foreach ($tabs_ as $_customTab)
|
||||
{
|
||||
if (isset($_customTab['permission'])
|
||||
&& $_customTab['permission'] == 1)
|
||||
{
|
||||
$this->permissioncomponent->set($_customTab['sortKey'], [
|
||||
'name' => $_customTab['view'] . '.' . $_customTab['code'] . '.viewtab',
|
||||
'title' => $_customTab['lang_permission'],
|
||||
'description' => $_customTab['lang_permission_desc']
|
||||
]);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add the custom permissions to use the buttons of this view
|
||||
$this->custombuttonpermissions->add(
|
||||
$view['settings'], $view['settings']->name_single, $nameView
|
||||
);
|
||||
|
||||
if ($nameView != 'component')
|
||||
{
|
||||
// add menu controll view that has menus options
|
||||
foreach ($menuControllers as $menuController)
|
||||
{
|
||||
// add menu controll view that has menus options
|
||||
if (isset($view[$menuController])
|
||||
&& $view[$menuController])
|
||||
{
|
||||
$targetView_ = 'views.';
|
||||
if ($menuController === 'dashboard_add')
|
||||
{
|
||||
$targetView_ = 'view.';
|
||||
}
|
||||
// menucontroller
|
||||
$menucontrollerView['action'] = $targetView_ . $menuController;
|
||||
$menucontrollerView['implementation'] = '2';
|
||||
if (isset($view['settings']->permissions)
|
||||
&& ArrayHelper::check(
|
||||
$view['settings']->permissions
|
||||
))
|
||||
{
|
||||
array_push(
|
||||
$view['settings']->permissions,
|
||||
$menucontrollerView
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$view['settings']->permissions = [];
|
||||
$view['settings']->permissions[] = $menucontrollerView;
|
||||
}
|
||||
unset($menucontrollerView);
|
||||
}
|
||||
}
|
||||
|
||||
// check if there are fields
|
||||
if (ArrayHelper::check($view['settings']->fields))
|
||||
{
|
||||
// field permission options
|
||||
$permission_options = [1 => 'edit', 2 => 'access', 3 => 'view'];
|
||||
|
||||
// check the fields for their permission settings
|
||||
foreach ($view['settings']->fields as $field)
|
||||
{
|
||||
// see if field require permissions to be set
|
||||
if (isset($field['permission'])
|
||||
&& ArrayHelper::check(
|
||||
$field['permission']
|
||||
))
|
||||
{
|
||||
if (ArrayHelper::check(
|
||||
$field['settings']->properties
|
||||
))
|
||||
{
|
||||
$fieldType = $this->typename->get($field);
|
||||
$fieldName = $this->fieldname->get(
|
||||
$field, $nameViews
|
||||
);
|
||||
|
||||
// loop the permission options
|
||||
foreach ($field['permission'] as $permission_id)
|
||||
{
|
||||
// set the permission key word
|
||||
$permission_option = $permission_options[(int) $permission_id];
|
||||
|
||||
// reset the bucket
|
||||
$fieldView = [];
|
||||
|
||||
// set the permission for this field
|
||||
$fieldView['action'] = 'view.' . $permission_option . '.' . $fieldName;
|
||||
$fieldView['implementation'] = '3';
|
||||
|
||||
// check if persmissions was already set
|
||||
if (isset($view['settings']->permissions)
|
||||
&& ArrayHelper::check(
|
||||
$view['settings']->permissions
|
||||
))
|
||||
{
|
||||
array_push($view['settings']->permissions, $fieldView);
|
||||
}
|
||||
else
|
||||
{
|
||||
$view['settings']->permissions = [];
|
||||
$view['settings']->permissions[] = $fieldView;
|
||||
}
|
||||
|
||||
// ensure that no default field get loaded
|
||||
if (!in_array($fieldName, $default_fields))
|
||||
{
|
||||
// load to global field permission set
|
||||
$this->permissionfields->
|
||||
set("$nameView.$fieldName.$permission_option", $fieldType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->permission ->set(
|
||||
$view, $nameView, $nameViews, $menuControllers
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterBuildAccessSections
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterBuildAccessSections'
|
||||
);
|
||||
|
||||
/// now build the section
|
||||
$component = $this->permissioncomponent->build();
|
||||
|
||||
// add views to the component section
|
||||
$component .= $this->permissionviews->build();
|
||||
|
||||
// remove the fix, is not needed
|
||||
if ($this->counter->accessSize < 30)
|
||||
{
|
||||
// since we have less than 30 actions
|
||||
// we do not need the fix for this component
|
||||
$this->config->set('add_assets_table_fix', 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get the worst case column size required (can be worse I know)
|
||||
// access/action size x 20 characters x 8 groups
|
||||
$character_length = (int) MathHelper::bc(
|
||||
'mul', $this->counter->accessSize, 20, 0
|
||||
);
|
||||
|
||||
// set worse case
|
||||
$this->config->set('access_worse_case', (int) MathHelper::bc(
|
||||
'mul', $character_length, 8, 0
|
||||
));
|
||||
}
|
||||
|
||||
// return the build
|
||||
return $component;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
667
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power
Normal file
667
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/code.power
Normal file
@ -0,0 +1,667 @@
|
||||
/**
|
||||
* 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 Language Class.
|
||||
*
|
||||
* @var Language
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Language $language;
|
||||
|
||||
/**
|
||||
* The Component Class.
|
||||
*
|
||||
* @var Component
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Component $component;
|
||||
|
||||
/**
|
||||
* The Name Class.
|
||||
*
|
||||
* @var FieldName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected FieldName $fieldname;
|
||||
|
||||
/**
|
||||
* The TypeName Class.
|
||||
*
|
||||
* @var TypeName
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected TypeName $typename;
|
||||
|
||||
/**
|
||||
* The Counter Class.
|
||||
*
|
||||
* @var Counter
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Counter $counter;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* The AssetsRules Class.
|
||||
*
|
||||
* @var AssetsRules
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected AssetsRules $assetsrules;
|
||||
|
||||
/**
|
||||
* The CustomTabs Class.
|
||||
*
|
||||
* @var CustomTabs
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CustomTabs $customtabs;
|
||||
|
||||
/**
|
||||
* The PermissionViews Class.
|
||||
*
|
||||
* @var PermissionViews
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected PermissionViews $permissionviews;
|
||||
|
||||
/**
|
||||
* The PermissionFields Class.
|
||||
*
|
||||
* @var PermissionFields
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected PermissionFields $permissionfields;
|
||||
|
||||
/**
|
||||
* The PermissionComponent Class.
|
||||
*
|
||||
* @var PermissionComponent
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected PermissionComponent $permissioncomponent;
|
||||
|
||||
/**
|
||||
* The CustomButtonPermissions Class.
|
||||
*
|
||||
* @var CustomButtonPermissions
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CustomButtonPermissions $custombuttonpermissions;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Event $event The EventInterface Class.
|
||||
* @param Language $language The Language Class.
|
||||
* @param Component $component The Component Class.
|
||||
* @param FieldName $fieldname The Name Class.
|
||||
* @param TypeName $typename The TypeName Class.
|
||||
* @param Counter $counter The Counter Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
* @param AssetsRules $assetsrules The AssetsRules Class.
|
||||
* @param CustomTabs $customtabs The CustomTabs Class.
|
||||
* @param PermissionViews $permissionviews The PermissionViews Class.
|
||||
* @param PermissionFields $permissionfields The PermissionFields Class.
|
||||
* @param PermissionComponent $permissioncomponent The PermissionComponent Class.
|
||||
* @param CustomButtonPermissions $custombuttonpermissions The CustomButtonPermissions Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Event $event, Language $language,
|
||||
Component $component, FieldName $fieldname,
|
||||
TypeName $typename, Counter $counter,
|
||||
Permission $permission, AssetsRules $assetsrules,
|
||||
CustomTabs $customtabs, PermissionViews $permissionviews,
|
||||
PermissionFields $permissionfields,
|
||||
PermissionComponent $permissioncomponent,
|
||||
CustomButtonPermissions $custombuttonpermissions)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->event = $event;
|
||||
$this->language = $language;
|
||||
$this->component = $component;
|
||||
$this->fieldname = $fieldname;
|
||||
$this->typename = $typename;
|
||||
$this->counter = $counter;
|
||||
$this->permission = $permission;
|
||||
$this->assetsrules = $assetsrules;
|
||||
$this->customtabs = $customtabs;
|
||||
$this->permissionviews = $permissionviews;
|
||||
$this->permissionfields = $permissionfields;
|
||||
$this->permissioncomponent = $permissioncomponent;
|
||||
$this->custombuttonpermissions = $custombuttonpermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Access Sections
|
||||
*
|
||||
* @return string
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(): string
|
||||
{
|
||||
// access size counter
|
||||
$this->counter->accessSize = 12; // ;)
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeBuildAccessSections
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeBuildAccessSections'
|
||||
);
|
||||
|
||||
// Get the default fields
|
||||
$default_fields = $this->config->default_fields;
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.admin',
|
||||
'title' => 'JACTION_ADMIN',
|
||||
'description' => 'JACTION_ADMIN_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.options',
|
||||
'title' => 'JACTION_OPTIONS',
|
||||
'description' => 'JACTION_OPTIONS_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.manage',
|
||||
'title' => 'JACTION_MANAGE',
|
||||
'description' => 'JACTION_MANAGE_COMPONENT_DESC'
|
||||
], true);
|
||||
|
||||
if ($this->config->get('add_eximport', false))
|
||||
{
|
||||
$exportTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Export Data', 'U');
|
||||
$exportDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Export Data', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $exportTitle, 'Export Data');
|
||||
$this->language->set(
|
||||
'bothadmin', $exportDesc,
|
||||
' Allows users in this group to export data.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.export',
|
||||
'title' => $exportTitle,
|
||||
'description' => $exportDesc
|
||||
], true);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
$importTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Import Data', 'U');
|
||||
$importDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Import Data', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $importTitle, 'Import Data');
|
||||
$this->language->set(
|
||||
'bothadmin', $importDesc,
|
||||
' Allows users in this group to import data.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.import',
|
||||
'title' => $importTitle,
|
||||
'description' => $importDesc
|
||||
], true);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
}
|
||||
|
||||
// version permission
|
||||
$batchTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Use Batch', 'U');
|
||||
$batchDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Use Batch', 'U') . '_DESC';
|
||||
$this->language->set('bothadmin', $batchTitle, 'Use Batch');
|
||||
$this->language->set(
|
||||
'bothadmin', $batchDesc,
|
||||
' Allows users in this group to use batch copy/update method.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.batch',
|
||||
'title' => $batchTitle,
|
||||
'description' => $batchDesc
|
||||
], true);
|
||||
|
||||
// version permission
|
||||
$importTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Versions', 'U');
|
||||
$importDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Versions', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $importTitle, 'Edit Version');
|
||||
$this->language->set(
|
||||
'bothadmin', $importDesc,
|
||||
' Allows users in this group to edit versions.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.version',
|
||||
'title' => $importTitle,
|
||||
'description' => $importDesc
|
||||
], true);
|
||||
|
||||
// set the defaults
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.create',
|
||||
'title' => 'JACTION_CREATE',
|
||||
'description' => 'JACTION_CREATE_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.delete',
|
||||
'title' => 'JACTION_DELETE',
|
||||
'description' => 'JACTION_DELETE_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit',
|
||||
'title' => 'JACTION_EDIT',
|
||||
'description' => 'JACTION_EDIT_COMPONENT_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.state',
|
||||
'title' => 'JACTION_EDITSTATE',
|
||||
'description' => 'JACTION_ACCESS_EDITSTATE_DESC'
|
||||
], true);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.own',
|
||||
'title' => 'JACTION_EDITOWN',
|
||||
'description' => 'JACTION_EDITOWN_COMPONENT_DESC'
|
||||
], true);
|
||||
|
||||
// set the Joomla fields
|
||||
if ($this->config->get('set_joomla_fields', false))
|
||||
{
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.value',
|
||||
'title' => 'JACTION_EDITVALUE',
|
||||
'description' => 'JACTION_EDITVALUE_COMPONENT_DESC'
|
||||
], true);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
}
|
||||
|
||||
// new custom created by permissions
|
||||
$created_byTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created By', 'U');
|
||||
$created_byDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created By', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $created_byTitle, 'Edit Created By');
|
||||
$this->language->set(
|
||||
'bothadmin', $created_byDesc,
|
||||
' Allows users in this group to edit created by.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.created_by',
|
||||
'title' => $created_byTitle,
|
||||
'description' => $created_byDesc
|
||||
], true);
|
||||
|
||||
// new custom created date permissions
|
||||
$createdTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created Date', 'U');
|
||||
$createdDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe('Edit Created Date', 'U')
|
||||
. '_DESC';
|
||||
$this->language->set('bothadmin', $createdTitle, 'Edit Created Date');
|
||||
$this->language->set(
|
||||
'bothadmin', $createdDesc,
|
||||
' Allows users in this group to edit created date.'
|
||||
);
|
||||
$this->permissioncomponent->add('->HEAD<-', [
|
||||
'name' => 'core.edit.created',
|
||||
'title' => $createdTitle,
|
||||
'description' => $createdDesc
|
||||
], true);
|
||||
|
||||
// set the menu controller lookup
|
||||
$menuControllers = ['access', 'submenu', 'dashboard_list', 'dashboard_add'];
|
||||
|
||||
// set the custom admin views permissions
|
||||
if ($this->component->isArray('custom_admin_views'))
|
||||
{
|
||||
foreach ($this->component->get('custom_admin_views') as $custom_admin_view)
|
||||
{
|
||||
// new custom permissions to access this view
|
||||
$customAdminName = $custom_admin_view['settings']->name;
|
||||
$customAdminCode = $custom_admin_view['settings']->code;
|
||||
$customAdminTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$customAdminName . ' Access', 'U'
|
||||
);
|
||||
$customAdminDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$customAdminName . ' Access', 'U'
|
||||
) . '_DESC';
|
||||
$sortKey = StringHelper::safe(
|
||||
$customAdminName . ' Access'
|
||||
);
|
||||
$this->language->set(
|
||||
'bothadmin', $customAdminTitle, $customAdminName . ' Access'
|
||||
);
|
||||
$this->language->set(
|
||||
'bothadmin', $customAdminDesc,
|
||||
' Allows the users in this group to access '
|
||||
. StringHelper::safe($customAdminName, 'w')
|
||||
. '.'
|
||||
);
|
||||
$this->permissioncomponent->set($sortKey, [
|
||||
'name' => "$customAdminCode.access",
|
||||
'title' => $customAdminTitle,
|
||||
'description' => $customAdminDesc
|
||||
]);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
|
||||
// add the custom permissions to use the buttons of this view
|
||||
$this->custombuttonpermissions->add(
|
||||
$custom_admin_view['settings'], $customAdminName,
|
||||
$customAdminCode
|
||||
);
|
||||
|
||||
// add menu controll view that has menus options
|
||||
foreach ($menuControllers as $menuController)
|
||||
{
|
||||
// add menu controll view that has menus options
|
||||
if (isset($custom_admin_view[$menuController])
|
||||
&& $custom_admin_view[$menuController])
|
||||
{
|
||||
$targetView_ = 'views.';
|
||||
if ($menuController === 'dashboard_add')
|
||||
{
|
||||
$targetView_ = 'view.';
|
||||
}
|
||||
|
||||
// menucontroller
|
||||
$menucontrollerView['action'] = $targetView_
|
||||
. $menuController;
|
||||
$menucontrollerView['implementation'] = '2';
|
||||
if (isset($custom_admin_view['settings']->permissions)
|
||||
&& ArrayHelper::check(
|
||||
$custom_admin_view['settings']->permissions
|
||||
))
|
||||
{
|
||||
array_push(
|
||||
$custom_admin_view['settings']->permissions,
|
||||
$menucontrollerView
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$custom_admin_view['settings']->permissions
|
||||
= [];
|
||||
$custom_admin_view['settings']->permissions[]
|
||||
= $menucontrollerView;
|
||||
}
|
||||
unset($menucontrollerView);
|
||||
}
|
||||
}
|
||||
|
||||
$this->permission ->set(
|
||||
$custom_admin_view, $customAdminCode, $customAdminCode,
|
||||
$menuControllers, 'customAdmin'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// set the site views permissions
|
||||
if ($this->component->isArray('site_views'))
|
||||
{
|
||||
foreach ($this->component->get('site_views') as $site_view)
|
||||
{
|
||||
// new custom permissions to access this view
|
||||
$siteName = $site_view['settings']->name;
|
||||
$siteCode = $site_view['settings']->code;
|
||||
$siteTitle = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$siteName . ' Access Site', 'U'
|
||||
);
|
||||
$siteDesc = $this->config->lang_prefix . '_'
|
||||
. StringHelper::safe(
|
||||
$siteName . ' Access Site', 'U'
|
||||
) . '_DESC';
|
||||
$sortKey = StringHelper::safe(
|
||||
$siteName . ' Access Site'
|
||||
);
|
||||
|
||||
if (isset($site_view['access']) && $site_view['access'] == 1)
|
||||
{
|
||||
$this->language->set(
|
||||
'bothadmin', $siteTitle, $siteName . ' (Site) Access'
|
||||
);
|
||||
$this->language->set(
|
||||
'bothadmin', $siteDesc,
|
||||
' Allows the users in this group to access site '
|
||||
. StringHelper::safe($siteName, 'w')
|
||||
. '.'
|
||||
);
|
||||
$this->permissioncomponent->set($sortKey, [
|
||||
'name' => "site.$siteCode.access",
|
||||
'title' => $siteTitle,
|
||||
'description' => $siteDesc
|
||||
]);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
|
||||
// check if this site view requires access rule to default to public
|
||||
if (isset($site_view['public_access'])
|
||||
&& $site_view['public_access'] == 1)
|
||||
{
|
||||
// we use one as public group (TODO we see if we run into any issues)
|
||||
$this->assetsrules->add('site', '"site.' . $siteCode
|
||||
. '.access":{"1":1}');
|
||||
}
|
||||
}
|
||||
|
||||
// add the custom permissions to use the buttons of this view
|
||||
$this->custombuttonpermissions->add(
|
||||
$site_view['settings'], $siteName, $siteCode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->component->isArray('admin_views'))
|
||||
{
|
||||
foreach ($this->component->get('admin_views') as $view)
|
||||
{
|
||||
// set view name
|
||||
$nameView = StringHelper::safe(
|
||||
$view['settings']->name_single
|
||||
);
|
||||
$nameViews = StringHelper::safe(
|
||||
$view['settings']->name_list
|
||||
);
|
||||
|
||||
// add custom tab permissions if found
|
||||
if (($tabs_ = $this->customtabs->get($nameView)) !== null
|
||||
&& ArrayHelper::check($tabs_))
|
||||
{
|
||||
foreach ($tabs_ as $_customTab)
|
||||
{
|
||||
if (isset($_customTab['permission'])
|
||||
&& $_customTab['permission'] == 1)
|
||||
{
|
||||
$this->permissioncomponent->set($_customTab['sortKey'], [
|
||||
'name' => $_customTab['view'] . '.' . $_customTab['code'] . '.viewtab',
|
||||
'title' => $_customTab['lang_permission'],
|
||||
'description' => $_customTab['lang_permission_desc']
|
||||
]);
|
||||
|
||||
// the size needs increase
|
||||
$this->counter->accessSize++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add the custom permissions to use the buttons of this view
|
||||
$this->custombuttonpermissions->add(
|
||||
$view['settings'], $view['settings']->name_single, $nameView
|
||||
);
|
||||
|
||||
if ($nameView != 'component')
|
||||
{
|
||||
// add menu controll view that has menus options
|
||||
foreach ($menuControllers as $menuController)
|
||||
{
|
||||
// add menu controll view that has menus options
|
||||
if (isset($view[$menuController])
|
||||
&& $view[$menuController])
|
||||
{
|
||||
$targetView_ = 'views.';
|
||||
if ($menuController === 'dashboard_add')
|
||||
{
|
||||
$targetView_ = 'view.';
|
||||
}
|
||||
// menucontroller
|
||||
$menucontrollerView['action'] = $targetView_ . $menuController;
|
||||
$menucontrollerView['implementation'] = '2';
|
||||
if (isset($view['settings']->permissions)
|
||||
&& ArrayHelper::check(
|
||||
$view['settings']->permissions
|
||||
))
|
||||
{
|
||||
array_push(
|
||||
$view['settings']->permissions,
|
||||
$menucontrollerView
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$view['settings']->permissions = [];
|
||||
$view['settings']->permissions[] = $menucontrollerView;
|
||||
}
|
||||
unset($menucontrollerView);
|
||||
}
|
||||
}
|
||||
|
||||
// check if there are fields
|
||||
if (ArrayHelper::check($view['settings']->fields))
|
||||
{
|
||||
// field permission options
|
||||
$permission_options = [1 => 'edit', 2 => 'access', 3 => 'view'];
|
||||
|
||||
// check the fields for their permission settings
|
||||
foreach ($view['settings']->fields as $field)
|
||||
{
|
||||
// see if field require permissions to be set
|
||||
if (isset($field['permission'])
|
||||
&& ArrayHelper::check(
|
||||
$field['permission']
|
||||
))
|
||||
{
|
||||
if (ArrayHelper::check(
|
||||
$field['settings']->properties
|
||||
))
|
||||
{
|
||||
$fieldType = $this->typename->get($field);
|
||||
$fieldName = $this->fieldname->get(
|
||||
$field, $nameViews
|
||||
);
|
||||
|
||||
// loop the permission options
|
||||
foreach ($field['permission'] as $permission_id)
|
||||
{
|
||||
// set the permission key word
|
||||
$permission_option = $permission_options[(int) $permission_id];
|
||||
|
||||
// reset the bucket
|
||||
$fieldView = [];
|
||||
|
||||
// set the permission for this field
|
||||
$fieldView['action'] = 'view.' . $permission_option . '.' . $fieldName;
|
||||
$fieldView['implementation'] = '3';
|
||||
|
||||
// check if persmissions was already set
|
||||
if (isset($view['settings']->permissions)
|
||||
&& ArrayHelper::check(
|
||||
$view['settings']->permissions
|
||||
))
|
||||
{
|
||||
array_push($view['settings']->permissions, $fieldView);
|
||||
}
|
||||
else
|
||||
{
|
||||
$view['settings']->permissions = [];
|
||||
$view['settings']->permissions[] = $fieldView;
|
||||
}
|
||||
|
||||
// ensure that no default field get loaded
|
||||
if (!in_array($fieldName, $default_fields))
|
||||
{
|
||||
// load to global field permission set
|
||||
$this->permissionfields->
|
||||
set("$nameView.$fieldName.$permission_option", $fieldType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->permission ->set(
|
||||
$view, $nameView, $nameViews, $menuControllers
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterBuildAccessSections
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterBuildAccessSections'
|
||||
);
|
||||
|
||||
/// now build the section
|
||||
$component = $this->permissioncomponent->build();
|
||||
|
||||
// add views to the component section
|
||||
$component .= $this->permissionviews->build();
|
||||
|
||||
// remove the fix, is not needed
|
||||
if ($this->counter->accessSize < 30)
|
||||
{
|
||||
// since we have less than 30 actions
|
||||
// we do not need the fix for this component
|
||||
$this->config->set('add_assets_table_fix', 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get the worst case column size required (can be worse I know)
|
||||
// access/action size x 20 characters x 8 groups
|
||||
$character_length = (int) MathHelper::bc(
|
||||
'mul', $this->counter->accessSize, 20, 0
|
||||
);
|
||||
|
||||
// set worse case
|
||||
$this->config->set('access_worse_case', (int) MathHelper::bc(
|
||||
'mul', $character_length, 8, 0
|
||||
));
|
||||
}
|
||||
|
||||
// return the build
|
||||
return $component;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
87
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json
Normal file
87
src/15615db0-02b9-454f-a82e-1ab39ae5e6a9/settings.json
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "15615db0-02b9-454f-a82e-1ab39ae5e6a9",
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "AccessSections",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Creator.AccessSections",
|
||||
"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": "8eee7df5-2775-41a9-9372-c46c5939a252",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use": "9387215f-a965-4421-acf3-5e8f9d11382f",
|
||||
"as": "FieldName"
|
||||
},
|
||||
"use_selection5": {
|
||||
"use": "eb33420d-359d-44a5-852e-613aef1feaae",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection6": {
|
||||
"use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection7": {
|
||||
"use": "7f01622a-74c9-4e67-b111-3eb488035206",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection8": {
|
||||
"use": "9b5872d6-c1d8-4602-b443-5844d2c950ee",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection9": {
|
||||
"use": "9551b683-67b6-4367-bb14-4b016def37e3",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection10": {
|
||||
"use": "480d11b9-783b-45d5-bce1-b0c2fcaad08a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection11": {
|
||||
"use": "5133a033-1351-43ec-9692-2907d7b9aacd",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection12": {
|
||||
"use": "94f4939f-82cc-4196-802b-1346ce5c7f99",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection13": {
|
||||
"use": "8bf026e7-9ae0-423c-b74b-5bc16c54acf7",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection14": {
|
||||
"use": "152c8793-8b75-4715-996a-257b9f65451c",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection15": {
|
||||
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection16": {
|
||||
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.AccessSections",
|
||||
"description": "Access Sections Creator Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -96,9 +96,13 @@ class Historycomponent
|
||||
*/
|
||||
private function setAdminView(object $item)
|
||||
{
|
||||
$old_admin_views = $this->history->get(
|
||||
'component_admin_views', $item->addadmin_views_id
|
||||
);
|
||||
$old_admin_views = null;
|
||||
if (isset($item->addadmin_views_id))
|
||||
{
|
||||
$old_admin_views = $this->history->get(
|
||||
'component_admin_views', $item->addadmin_views_id
|
||||
);
|
||||
}
|
||||
|
||||
// add new views if found
|
||||
if ($old_admin_views && ObjectHelper::check($old_admin_views))
|
||||
@ -126,9 +130,13 @@ class Historycomponent
|
||||
*/
|
||||
private function setComponent(object &$item)
|
||||
{
|
||||
$old_component = $this->history->get(
|
||||
'joomla_component', $this->config->component_id
|
||||
);
|
||||
$old_component = null;
|
||||
if (isset($this->config->component_id))
|
||||
{
|
||||
$old_component = $this->history->get(
|
||||
'joomla_component', $this->config->component_id
|
||||
);
|
||||
}
|
||||
|
||||
// check if a new version was manually set
|
||||
if ($old_component && ObjectHelper::check($old_component))
|
||||
|
@ -66,9 +66,13 @@
|
||||
*/
|
||||
private function setAdminView(object $item)
|
||||
{
|
||||
$old_admin_views = $this->history->get(
|
||||
'component_admin_views', $item->addadmin_views_id
|
||||
);
|
||||
$old_admin_views = null;
|
||||
if (isset($item->addadmin_views_id))
|
||||
{
|
||||
$old_admin_views = $this->history->get(
|
||||
'component_admin_views', $item->addadmin_views_id
|
||||
);
|
||||
}
|
||||
|
||||
// add new views if found
|
||||
if ($old_admin_views && ObjectHelper::check($old_admin_views))
|
||||
@ -96,9 +100,13 @@
|
||||
*/
|
||||
private function setComponent(object &$item)
|
||||
{
|
||||
$old_component = $this->history->get(
|
||||
'joomla_component', $this->config->component_id
|
||||
);
|
||||
$old_component = null;
|
||||
if (isset($this->config->component_id))
|
||||
{
|
||||
$old_component = $this->history->get(
|
||||
'joomla_component', $this->config->component_id
|
||||
);
|
||||
}
|
||||
|
||||
// check if a new version was manually set
|
||||
if ($old_component && ObjectHelper::check($old_component))
|
||||
|
52
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/README.md
Normal file
52
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/README.md
Normal file
@ -0,0 +1,52 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class InputButton (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour**
|
||||
```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)
|
||||
|
345
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php
Normal file
345
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.php
Normal file
@ -0,0 +1,345 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour;
|
||||
|
||||
|
||||
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[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\"";
|
||||
$addButton[] = Indent::_(5) . "href=\"index.php?option="
|
||||
. $fieldData['component'] . "&view=" . $fieldData['view']
|
||||
. "&layout=edit'.\$ref.'\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-new icon-white\"></span></a>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only add if user allowed to edit " . $fieldData['view'];
|
||||
// check if the item has permissions.
|
||||
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
|
||||
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build edit button";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-edit\"></span></a>';";
|
||||
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build script";
|
||||
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
|
||||
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "let \".\$button_code_name.\"Value = this.value;";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||
$addButton[] = Indent::_(6) . "});";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||
$addButton[] = Indent::_(5) . "});";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "function \".\$button_code_name.\"Button(value) {";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "var createButton = document.getElementById('\".\$button_code_name.\"Create');";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "var editButton = document.getElementById('\".\$button_code_name.\"Edit');";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
|
||||
$addButton[] = Indent::_(7) . "// hide the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "createButton.style.display = 'none';";
|
||||
$addButton[] = Indent::_(7) . "// show edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "editButton.style.display = 'block';";
|
||||
$addButton[] = Indent::_(7) . "let url = 'index.php?option="
|
||||
. $fieldData['component'] . "&view=" . $fieldData['views']
|
||||
. "&task=" . $fieldData['view']
|
||||
. ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
|
||||
$addButton[] = Indent::_(7)
|
||||
. "editButton.setAttribute('href', url);";
|
||||
$addButton[] = Indent::_(6) . "} else {";
|
||||
$addButton[] = Indent::_(7) . "// show the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "createButton.style.display = 'block';";
|
||||
$addButton[] = Indent::_(7) . "// hide edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "editButton.style.display = 'none';";
|
||||
$addButton[] = Indent::_(6) . "}";
|
||||
$addButton[] = Indent::_(5) . "}\";";
|
||||
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " check if button was created for " . $fieldData['view']
|
||||
. " field.";
|
||||
$addButton[] = Indent::_(3)
|
||||
. "if (is_array(\$button) && count(\$button) > 0)";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Load the needed script.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$document = Factory::getApplication()->getDocument();";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " return the button attached to input field.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "return '<div class=\"input-group\">' .\$html . implode('',\$button).'</div>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(2) . "}";
|
||||
$addButton[] = Indent::_(2) . "return \$html;";
|
||||
$addButton[] = Indent::_(1) . "}";
|
||||
|
||||
return implode(PHP_EOL, $addButton);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
312
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.power
Normal file
312
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/code.power
Normal file
@ -0,0 +1,312 @@
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Placeholder Class.
|
||||
*
|
||||
* @var Placeholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Placeholder $placeholder,
|
||||
Permission $permission)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Add Button To List Field Input (getInput tweak)
|
||||
*
|
||||
* @param array $fieldData The field custom data
|
||||
*
|
||||
* @return string of getInput class on success empty string otherwise
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function get(array $fieldData): string
|
||||
{
|
||||
// make sure hte view values are set
|
||||
if (isset($fieldData['add_button'])
|
||||
&& ($fieldData['add_button'] === 'true'
|
||||
|| 1 == $fieldData['add_button'])
|
||||
&& isset($fieldData['view'])
|
||||
&& isset($fieldData['views'])
|
||||
&& StringHelper::check($fieldData['view'])
|
||||
&& StringHelper::check($fieldData['views']))
|
||||
{
|
||||
// set local component
|
||||
$local_component = "com_" . $this->config->component_code_name;
|
||||
// check that the component value is set
|
||||
if (!isset($fieldData['component'])
|
||||
|| !StringHelper::check(
|
||||
$fieldData['component']
|
||||
))
|
||||
{
|
||||
$fieldData['component'] = $local_component;
|
||||
}
|
||||
// check that the component has the com_ value in it
|
||||
if (strpos((string) $fieldData['component'], 'com_') === false
|
||||
|| strpos((string) $fieldData['component'], '=') !== false)
|
||||
{
|
||||
$fieldData['component'] = "com_" . $fieldData['component'];
|
||||
}
|
||||
// make sure the component is update if # # # or [ [ [ component placeholder is used
|
||||
if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false
|
||||
|| strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but
|
||||
{
|
||||
$fieldData['component'] = $this->placeholder->update_(
|
||||
$fieldData['component']
|
||||
);
|
||||
}
|
||||
// get core permissions
|
||||
$coreLoad = false;
|
||||
// add ref tags
|
||||
$refLoad = true;
|
||||
// fall back on the field component
|
||||
$component = $fieldData['component'];
|
||||
// check if we should add ref tags (since it only works well on local views)
|
||||
if ($local_component !== $component)
|
||||
{
|
||||
// do not add ref tags
|
||||
$refLoad = false;
|
||||
}
|
||||
// start building the add buttons/s
|
||||
$addButton = array();
|
||||
$addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||
$addButton[] = Indent::_(1) . " * Override to add new button";
|
||||
$addButton[] = Indent::_(1) . " *";
|
||||
$addButton[] = Indent::_(1)
|
||||
. " * @return string The field input markup.";
|
||||
$addButton[] = Indent::_(1) . " *";
|
||||
$addButton[] = Indent::_(1) . " * @since 3.2";
|
||||
$addButton[] = Indent::_(1) . " */";
|
||||
$addButton[] = Indent::_(1) . "protected function getInput()";
|
||||
$addButton[] = Indent::_(1) . "{";
|
||||
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " see if we should add buttons";
|
||||
$addButton[] = Indent::_(2)
|
||||
. "\$set_button = \$this->getAttribute('button');";
|
||||
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get html";
|
||||
$addButton[] = Indent::_(2) . "\$html = parent::getInput();";
|
||||
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||
. " if true set button";
|
||||
$addButton[] = Indent::_(2) . "if (\$set_button === 'true')";
|
||||
$addButton[] = Indent::_(2) . "{";
|
||||
$addButton[] = Indent::_(3) . "\$button = array();";
|
||||
$addButton[] = Indent::_(3) . "\$script = array();";
|
||||
$addButton[] = Indent::_(3)
|
||||
. "\$button_code_name = \$this->getAttribute('name');";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get the input from url";
|
||||
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
|
||||
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " get the view name & id";
|
||||
$addButton[] = Indent::_(3)
|
||||
. "\$values = \$jinput->getArray(array(";
|
||||
$addButton[] = Indent::_(4) . "'id' => 'int',";
|
||||
$addButton[] = Indent::_(4) . "'view' => 'word'";
|
||||
$addButton[] = Indent::_(3) . "));";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " check if new item";
|
||||
$addButton[] = Indent::_(3) . "\$ref = '';";
|
||||
$addButton[] = Indent::_(3) . "\$refJ = '';";
|
||||
if ($refLoad)
|
||||
{
|
||||
$addButton[] = Indent::_(3)
|
||||
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only load referral if not new item.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$ref = '&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[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\"";
|
||||
$addButton[] = Indent::_(5) . "href=\"index.php?option="
|
||||
. $fieldData['component'] . "&view=" . $fieldData['view']
|
||||
. "&layout=edit'.\$ref.'\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-new icon-white\"></span></a>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only add if user allowed to edit " . $fieldData['view'];
|
||||
// check if the item has permissions.
|
||||
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
|
||||
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build edit button";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-edit\"></span></a>';";
|
||||
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build script";
|
||||
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
|
||||
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "let \".\$button_code_name.\"Value = this.value;";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||
$addButton[] = Indent::_(6) . "});";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||
$addButton[] = Indent::_(5) . "});";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "function \".\$button_code_name.\"Button(value) {";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "var createButton = document.getElementById('\".\$button_code_name.\"Create');";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "var editButton = document.getElementById('\".\$button_code_name.\"Edit');";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
|
||||
$addButton[] = Indent::_(7) . "// hide the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "createButton.style.display = 'none';";
|
||||
$addButton[] = Indent::_(7) . "// show edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "editButton.style.display = 'block';";
|
||||
$addButton[] = Indent::_(7) . "let url = 'index.php?option="
|
||||
. $fieldData['component'] . "&view=" . $fieldData['views']
|
||||
. "&task=" . $fieldData['view']
|
||||
. ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
|
||||
$addButton[] = Indent::_(7)
|
||||
. "editButton.setAttribute('href', url);";
|
||||
$addButton[] = Indent::_(6) . "} else {";
|
||||
$addButton[] = Indent::_(7) . "// show the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "createButton.style.display = 'block';";
|
||||
$addButton[] = Indent::_(7) . "// hide edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "editButton.style.display = 'none';";
|
||||
$addButton[] = Indent::_(6) . "}";
|
||||
$addButton[] = Indent::_(5) . "}\";";
|
||||
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " check if button was created for " . $fieldData['view']
|
||||
. " field.";
|
||||
$addButton[] = Indent::_(3)
|
||||
. "if (is_array(\$button) && count(\$button) > 0)";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " Load the needed script.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$document = Factory::getApplication()->getDocument();";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " return the button attached to input field.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "return '<div class=\"input-group\">' .\$html . implode('',\$button).'</div>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(2) . "}";
|
||||
$addButton[] = Indent::_(2) . "return \$html;";
|
||||
$addButton[] = Indent::_(1) . "}";
|
||||
|
||||
return implode(PHP_EOL, $addButton);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
49
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json
Normal file
49
src/1b8a40e9-7847-4341-8a8e-dfdc2d531bbe/settings.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "1b8a40e9-7847-4341-8a8e-dfdc2d531bbe",
|
||||
"implements": [
|
||||
"c600f58c-3fe2-4d2d-b711-2660eab6effe"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "InputButton",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Field.J4.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.JoomlaFour.InputButton",
|
||||
"description": "Compiler Field Input Button\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -14,8 +14,8 @@ class Gui #Gold {
|
||||
# Config $config
|
||||
# Reverse $reverse
|
||||
# Parser $parser
|
||||
# \JDatabaseDriver $db
|
||||
# CMSApplication $app
|
||||
# $db
|
||||
# $app
|
||||
+ __construct(?Config $config = null, ?Reverse $reverse = null, ...)
|
||||
+ set(string $string, array $config) : string
|
||||
+ search(string $file, array $placeholders, ...) : void
|
||||
@ -31,8 +31,6 @@ note right of Gui::__construct
|
||||
?Config $config = null
|
||||
?Reverse $reverse = null
|
||||
?Parser $parser = null
|
||||
?\JDatabaseDriver $db = null
|
||||
?CMSApplication $app = null
|
||||
end note
|
||||
|
||||
note right of Gui::set
|
||||
|
@ -61,18 +61,16 @@ class Gui implements GuiInterface
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var CMSApplication
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected CMSApplication $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -80,20 +78,17 @@ class Gui implements GuiInterface
|
||||
* @param Config|null $config The compiler config object.
|
||||
* @param Reverse|null $reverse The compiler placeholder reverse object.
|
||||
* @param Parser|null $parser The powers parser object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null,
|
||||
?\JDatabaseDriver $db = null, ?CMSApplication $app = null)
|
||||
public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse');
|
||||
$this->parser = $parser ?: Compiler::_('Power.Parser');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,18 +25,16 @@
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var CMSApplication
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected CMSApplication $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -44,20 +42,17 @@
|
||||
* @param Config|null $config The compiler config object.
|
||||
* @param Reverse|null $reverse The compiler placeholder reverse object.
|
||||
* @param Parser|null $parser The powers parser object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null,
|
||||
?\JDatabaseDriver $db = null, ?CMSApplication $app = null)
|
||||
public function __construct(?Config $config = null, ?Reverse $reverse = null, ?Parser $parser = null)
|
||||
{
|
||||
$this->config = $config ?: Compiler::_('Config');
|
||||
$this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse');
|
||||
$this->parser = $parser ?: Compiler::_('Power.Parser');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
$this->db = Factory::getDbo();
|
||||
$this->app = Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,10 +14,10 @@ class External #Gold {
|
||||
# array $code
|
||||
# array $cutter
|
||||
# Placeholder $placeholder
|
||||
# \JDatabaseDriver $db
|
||||
# User $user
|
||||
# CMSApplication $app
|
||||
+ __construct(?Placeholder $placeholder = null, ?\JDatabaseDriver $db = null, ...)
|
||||
# $db
|
||||
# $user
|
||||
# $app
|
||||
+ __construct(?Placeholder $placeholder = null)
|
||||
+ set(string $string, int $debug) : string
|
||||
# getCode(string $target, array $bucket) : void
|
||||
# cut(string $string, string $sequence, ...) : string
|
||||
@ -27,12 +27,6 @@ note right of External::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
?Placeholder $placeholder = null
|
||||
?\JDatabaseDriver $db = null
|
||||
?User $user = null
|
||||
?CMSApplication $app = null
|
||||
end note
|
||||
|
||||
note right of External::set
|
||||
|
@ -60,45 +60,38 @@ class External implements ExternalInterface
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* User object
|
||||
*
|
||||
* @var User
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected User $user;
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var CMSApplication
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected CMSApplication $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Placeholder|null $placeholder The compiler placeholder object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
* @param User|null $user The User object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Placeholder $placeholder = null,
|
||||
?\JDatabaseDriver $db = null, ?User $user = null, ?CMSApplication $app = null)
|
||||
public function __construct(?Placeholder $placeholder = null)
|
||||
{
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->user = $user ?: Factory::getUser();
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
$this->db = Factory::getDbo();
|
||||
$this->user = Factory::getUser();
|
||||
$this->app = Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,45 +25,38 @@
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var \JDatabaseDriver
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected \JDatabaseDriver $db;
|
||||
protected $db;
|
||||
|
||||
/**
|
||||
* User object
|
||||
*
|
||||
* @var User
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected User $user;
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* Database object to query local DB
|
||||
*
|
||||
* @var CMSApplication
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected CMSApplication $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Placeholder|null $placeholder The compiler placeholder object.
|
||||
* @param \JDatabaseDriver|null $db The Database Driver object.
|
||||
* @param User|null $user The User object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(?Placeholder $placeholder = null,
|
||||
?\JDatabaseDriver $db = null, ?User $user = null, ?CMSApplication $app = null)
|
||||
public function __construct(?Placeholder $placeholder = null)
|
||||
{
|
||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||
$this->db = $db ?: Factory::getDbo();
|
||||
$this->user = $user ?: Factory::getUser();
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
$this->db = Factory::getDbo();
|
||||
$this->user = Factory::getUser();
|
||||
$this->app = Factory::getApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -207,7 +207,11 @@ class InstallScript implements GetScriptInterface
|
||||
$extension = $this->extension;
|
||||
|
||||
// start build
|
||||
$script = PHP_EOL . '/**';
|
||||
$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 . ' *';
|
||||
@ -325,7 +329,7 @@ class InstallScript implements GetScriptInterface
|
||||
$script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__)
|
||||
. ' get application';
|
||||
$script .= PHP_EOL . Indent::_(2)
|
||||
. '$app = JFactory::getApplication();' . PHP_EOL;
|
||||
. '$app = Factory::getApplication();' . PHP_EOL;
|
||||
|
||||
// add the default version check (TODO) must make this dynamic
|
||||
if ('preflight' === $name)
|
||||
|
@ -178,7 +178,11 @@
|
||||
$extension = $this->extension;
|
||||
|
||||
// start build
|
||||
$script = PHP_EOL . '/**';
|
||||
$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 . ' *';
|
||||
@ -296,7 +300,7 @@
|
||||
$script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__)
|
||||
. ' get application';
|
||||
$script .= PHP_EOL . Indent::_(2)
|
||||
. '$app = JFactory::getApplication();' . PHP_EOL;
|
||||
. '$app = Factory::getApplication();' . PHP_EOL;
|
||||
|
||||
// add the default version check (TODO) must make this dynamic
|
||||
if ('preflight' === $name)
|
||||
|
94
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md
Normal file
94
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/README.md
Normal file
@ -0,0 +1,94 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class Header (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour**
|
||||
```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
|
||||
# setChosenMultiSelectionHeaders(array $headers, string $nameListCode) : 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
|
||||
|
||||
note right of Header::setChosenMultiSelectionHeaders
|
||||
Build chosen multi selection headers for the view
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
643
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php
Normal file
643
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php
Normal file
@ -0,0 +1,643 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
|
||||
|
||||
|
||||
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\String\NamespaceHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Build headers for all Joomla 4 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->config->get('namespace_prefix');
|
||||
$this->ComponentName = $this->placeholder->get('Component');
|
||||
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
// 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.views':
|
||||
$this->setChosenMultiSelectionHeaders($headers, $codeName);
|
||||
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;
|
||||
}
|
||||
|
||||
// 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]
|
||||
);
|
||||
|
||||
// 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;';
|
||||
$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':
|
||||
$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 '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;';
|
||||
$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\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.component':
|
||||
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
|
||||
break;
|
||||
|
||||
case 'site.view':
|
||||
case 'site.views':
|
||||
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||
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;';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 . '\') . \' -\']);';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
604
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power
Normal file
604
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.power
Normal file
@ -0,0 +1,604 @@
|
||||
/**
|
||||
* 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->config->get('namespace_prefix');
|
||||
$this->ComponentName = $this->placeholder->get('Component');
|
||||
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
// 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.views':
|
||||
$this->setChosenMultiSelectionHeaders($headers, $codeName);
|
||||
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;
|
||||
}
|
||||
|
||||
// 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]
|
||||
);
|
||||
|
||||
// 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;';
|
||||
$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':
|
||||
$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 '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;';
|
||||
$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\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.component':
|
||||
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
|
||||
break;
|
||||
|
||||
case 'site.view':
|
||||
case 'site.views':
|
||||
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||
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;';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 . '\') . \' -\']);';
|
||||
}
|
||||
}
|
||||
}
|
73
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json
Normal file
73
src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "1ee227b9-da0f-4e7b-ae66-99a9d53f6f49",
|
||||
"implements": [
|
||||
"3a777d70-52ad-49ec-9016-6f7438608613"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "Header",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.JoomlaFour.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_selection10": {
|
||||
"use": "ce8cf834-6bac-44fb-941c-861f7e046cc0",
|
||||
"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.JoomlaFour.Header",
|
||||
"description": "Build headers for all Joomla 4 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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -11,13 +11,14 @@
|
||||
```uml
|
||||
@startuml
|
||||
class Structure #Gold {
|
||||
# Placeholder $placeholder
|
||||
# Settings $settings
|
||||
# Paths $paths
|
||||
# Counter $counter
|
||||
# File $file
|
||||
# Files $files
|
||||
# CMSApplication $app
|
||||
+ __construct(?Settings $settings = null, ?Paths $paths = null, ...)
|
||||
+ __construct(Placeholder $placeholder, Settings $settings, ...)
|
||||
+ build(array $target, string $type, ...) : bool
|
||||
- getFileDetails(object $details, string $item, ...) : ?array
|
||||
- getPath(object $details, string $zipPath, ...) : ?string
|
||||
@ -30,11 +31,12 @@ note right of Structure::__construct
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
?Settings $settings = null
|
||||
?Paths $paths = null
|
||||
?Counter $counter = null
|
||||
?File $file = null
|
||||
?Files $files = null
|
||||
Placeholder $placeholder
|
||||
Settings $settings
|
||||
Paths $paths
|
||||
Counter $counter
|
||||
File $file
|
||||
Files $files
|
||||
?CMSApplication $app = null
|
||||
end note
|
||||
|
||||
|
@ -17,8 +17,8 @@ use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Filesystem\File as JoomlaFile;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Component\Settings;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\File;
|
||||
@ -35,41 +35,49 @@ use VDM\Joomla\Utilities\StringHelper;
|
||||
class Structure
|
||||
{
|
||||
/**
|
||||
* Compiler Component Joomla Version Settings
|
||||
* The Placeholder Class.
|
||||
*
|
||||
* @var Settings
|
||||
* @var Placeholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* The SettingsInterface Class.
|
||||
*
|
||||
* @var Settings
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Settings $settings;
|
||||
|
||||
/**
|
||||
* Compiler Utilities Paths
|
||||
* The Paths Class.
|
||||
*
|
||||
* @var Paths
|
||||
* @var Paths
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Paths $paths;
|
||||
|
||||
/**
|
||||
* Compiler Counter
|
||||
* The Counter Class.
|
||||
*
|
||||
* @var Counter
|
||||
* @var Counter
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Counter $counter;
|
||||
|
||||
/**
|
||||
* Compiler Utilities File
|
||||
* The File Class.
|
||||
*
|
||||
* @var File
|
||||
* @var File
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected File $file;
|
||||
|
||||
/**
|
||||
* Compiler Utilities Files
|
||||
* The Files Class.
|
||||
*
|
||||
* @var Files
|
||||
* @var Files
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Files $files;
|
||||
@ -85,25 +93,25 @@ class Structure
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Settings|null $settings The compiler component joomla version settings object.
|
||||
* @param Paths|null $paths The compiler paths object.
|
||||
* @param Counter|null $counter The compiler counter object.
|
||||
* @param File|null $file The compiler file object.
|
||||
* @param Files|null $files The compiler files object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param Settings $settings The SettingsInterface Class.
|
||||
* @param Paths $paths The Paths Class.
|
||||
* @param Counter $counter The Counter Class.
|
||||
* @param File $file The File Class.
|
||||
* @param Files $files The Files Class.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(?Settings $settings = null, ?Paths $paths = null,
|
||||
?Counter $counter = null, ?File $file = null, ?Files $files = null,
|
||||
?CMSApplication $app = null)
|
||||
public function __construct(Placeholder $placeholder, Settings $settings, Paths $paths,
|
||||
Counter $counter, File $file, Files $files, ?CMSApplication $app = null)
|
||||
{
|
||||
$this->settings = $settings ?: Compiler::_('Component.Settings');
|
||||
$this->paths = $paths ?: Compiler::_('Utilities.Paths');
|
||||
$this->counter = $counter ?: Compiler::_('Utilities.Counter');
|
||||
$this->file = $file ?: Compiler::_('Utilities.File');
|
||||
$this->files = $files ?: Compiler::_('Utilities.Files');
|
||||
$this->placeholder = $placeholder;
|
||||
$this->settings = $settings;
|
||||
$this->paths = $paths;
|
||||
$this->counter = $counter;
|
||||
$this->file = $file;
|
||||
$this->files = $files;
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
}
|
||||
|
||||
@ -130,6 +138,15 @@ class Structure
|
||||
// search the target
|
||||
foreach ($target as $main => $name)
|
||||
{
|
||||
// get the key name (either file name or name)
|
||||
$key = $fileName ?? $name;
|
||||
|
||||
// add to placeholders as Name and name
|
||||
$this->placeholder->set('Name', StringHelper::safe($name, 'F'));
|
||||
$this->placeholder->set('name', StringHelper::safe($name));
|
||||
$this->placeholder->set('Key', StringHelper::safe($key, 'F'));
|
||||
$this->placeholder->set('key', StringHelper::safe($key));
|
||||
|
||||
// make sure it is lower case
|
||||
$name = StringHelper::safe($name);
|
||||
|
||||
@ -157,6 +174,12 @@ class Structure
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove the name from placeholders
|
||||
$this->placeholder->remove('Name');
|
||||
$this->placeholder->remove('name');
|
||||
$this->placeholder->remove('Key');
|
||||
$this->placeholder->remove('key');
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,6 +274,8 @@ class Structure
|
||||
{
|
||||
$path = $details->path;
|
||||
}
|
||||
|
||||
$path = $this->placeholder->update_($path);
|
||||
|
||||
// make sure we have component to replace
|
||||
if (strpos((string) $path, 'c0mp0n3nt') !== false)
|
||||
@ -291,23 +316,27 @@ class Structure
|
||||
if (!empty($fileName))
|
||||
{
|
||||
$name = $name . '_' . $fileName;
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
if ($details->rename === 'new')
|
||||
{
|
||||
$item = $details->newName;
|
||||
}
|
||||
elseif (!empty($fileName))
|
||||
{
|
||||
$item = str_replace(
|
||||
$details->rename, $fileName, $item
|
||||
);
|
||||
}
|
||||
elseif ($details->rename === 'new')
|
||||
else
|
||||
{
|
||||
return $details->newName;
|
||||
$item = str_replace(
|
||||
$details->rename, $name, $item
|
||||
);
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
$details->rename, $name, $item
|
||||
);
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
return $this->placeholder->update_($item);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,39 +1,47 @@
|
||||
/**
|
||||
* Compiler Component Joomla Version Settings
|
||||
* The Placeholder Class.
|
||||
*
|
||||
* @var Settings
|
||||
* @var Placeholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Placeholder $placeholder;
|
||||
|
||||
/**
|
||||
* The SettingsInterface Class.
|
||||
*
|
||||
* @var Settings
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Settings $settings;
|
||||
|
||||
/**
|
||||
* Compiler Utilities Paths
|
||||
* The Paths Class.
|
||||
*
|
||||
* @var Paths
|
||||
* @var Paths
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Paths $paths;
|
||||
|
||||
/**
|
||||
* Compiler Counter
|
||||
* The Counter Class.
|
||||
*
|
||||
* @var Counter
|
||||
* @var Counter
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Counter $counter;
|
||||
|
||||
/**
|
||||
* Compiler Utilities File
|
||||
* The File Class.
|
||||
*
|
||||
* @var File
|
||||
* @var File
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected File $file;
|
||||
|
||||
/**
|
||||
* Compiler Utilities Files
|
||||
* The Files Class.
|
||||
*
|
||||
* @var Files
|
||||
* @var Files
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Files $files;
|
||||
@ -49,25 +57,25 @@
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Settings|null $settings The compiler component joomla version settings object.
|
||||
* @param Paths|null $paths The compiler paths object.
|
||||
* @param Counter|null $counter The compiler counter object.
|
||||
* @param File|null $file The compiler file object.
|
||||
* @param Files|null $files The compiler files object.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param Settings $settings The SettingsInterface Class.
|
||||
* @param Paths $paths The Paths Class.
|
||||
* @param Counter $counter The Counter Class.
|
||||
* @param File $file The File Class.
|
||||
* @param Files $files The Files Class.
|
||||
* @param CMSApplication|null $app The CMS Application object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(?Settings $settings = null, ?Paths $paths = null,
|
||||
?Counter $counter = null, ?File $file = null, ?Files $files = null,
|
||||
?CMSApplication $app = null)
|
||||
public function __construct(Placeholder $placeholder, Settings $settings, Paths $paths,
|
||||
Counter $counter, File $file, Files $files, ?CMSApplication $app = null)
|
||||
{
|
||||
$this->settings = $settings ?: Compiler::_('Component.Settings');
|
||||
$this->paths = $paths ?: Compiler::_('Utilities.Paths');
|
||||
$this->counter = $counter ?: Compiler::_('Utilities.Counter');
|
||||
$this->file = $file ?: Compiler::_('Utilities.File');
|
||||
$this->files = $files ?: Compiler::_('Utilities.Files');
|
||||
$this->placeholder = $placeholder;
|
||||
$this->settings = $settings;
|
||||
$this->paths = $paths;
|
||||
$this->counter = $counter;
|
||||
$this->file = $file;
|
||||
$this->files = $files;
|
||||
$this->app = $app ?: Factory::getApplication();
|
||||
}
|
||||
|
||||
@ -94,6 +102,15 @@
|
||||
// search the target
|
||||
foreach ($target as $main => $name)
|
||||
{
|
||||
// get the key name (either file name or name)
|
||||
$key = $fileName ?? $name;
|
||||
|
||||
// add to placeholders as Name and name
|
||||
$this->placeholder->set('Name', StringHelper::safe($name, 'F'));
|
||||
$this->placeholder->set('name', StringHelper::safe($name));
|
||||
$this->placeholder->set('Key', StringHelper::safe($key, 'F'));
|
||||
$this->placeholder->set('key', StringHelper::safe($key));
|
||||
|
||||
// make sure it is lower case
|
||||
$name = StringHelper::safe($name);
|
||||
|
||||
@ -121,6 +138,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove the name from placeholders
|
||||
$this->placeholder->remove('Name');
|
||||
$this->placeholder->remove('name');
|
||||
$this->placeholder->remove('Key');
|
||||
$this->placeholder->remove('key');
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,6 +238,8 @@
|
||||
{
|
||||
$path = $details->path;
|
||||
}
|
||||
|
||||
$path = $this->placeholder->update_($path);
|
||||
|
||||
// make sure we have component to replace
|
||||
if (strpos((string) $path, 'c0mp0n3nt') !== false)
|
||||
@ -255,20 +280,25 @@
|
||||
if (!empty($fileName))
|
||||
{
|
||||
$name = $name . '_' . $fileName;
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
if ($details->rename === 'new')
|
||||
{
|
||||
$item = $details->newName;
|
||||
}
|
||||
elseif (!empty($fileName))
|
||||
{
|
||||
$item = str_replace(
|
||||
$details->rename, $fileName, $item
|
||||
);
|
||||
}
|
||||
elseif ($details->rename === 'new')
|
||||
else
|
||||
{
|
||||
return $details->newName;
|
||||
$item = str_replace(
|
||||
$details->rename, $name, $item
|
||||
);
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
$details->rename, $name, $item
|
||||
);
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
return $this->placeholder->update_($item);
|
||||
}
|
@ -11,12 +11,12 @@
|
||||
"type": "class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",
|
||||
"as": "Compiler"
|
||||
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "63dabe82-0f4a-4ade-9851-8518ade23de2",
|
||||
"as": "default"
|
||||
"use": "5f44e66a-31d0-45ff-92b3-b7372dc57ae9",
|
||||
"as": "Settings"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "6f20369a-8536-4870-a1a3-cda254c939c8",
|
||||
|
30
src/207b5ef3-b3bb-45bf-af14-4572e296d761/README.md
Normal file
30
src/207b5ef3-b3bb-45bf-af14-4572e296d761/README.md
Normal file
@ -0,0 +1,30 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class FrontendParams (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder**
|
||||
> extends: **Registry**
|
||||
```uml
|
||||
@startuml
|
||||
class FrontendParams << (F,LightGreen) >> #RoyalBlue {
|
||||
}
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
27
src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php
Normal file
27
src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Front-end Params Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FrontendParams extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
1
src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.power
Normal file
1
src/207b5ef3-b3bb-45bf-af14-4572e296d761/code.power
Normal file
@ -0,0 +1 @@
|
||||
###CODEPOWER###
|
20
src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json
Normal file
20
src/207b5ef3-b3bb-45bf-af14-4572e296d761/settings.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7",
|
||||
"guid": "207b5ef3-b3bb-45bf-af14-4572e296d761",
|
||||
"implements": [
|
||||
"64e291c2-11f1-423d-a44d-837cc12cc017"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "FrontendParams",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Builder.FrontendParams",
|
||||
"type": "final class",
|
||||
"use_selection": null,
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.FrontendParams",
|
||||
"description": "Front-end Params Builder Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
53
src/208bc37c-0055-44df-9a34-63d6bfa10765/README.md
Normal file
53
src/208bc37c-0055-44df-9a34-63d6bfa10765/README.md
Normal file
@ -0,0 +1,53 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class ConfigFieldsetsCustomfield (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator**
|
||||
```uml
|
||||
@startuml
|
||||
class ConfigFieldsetsCustomfield << (F,LightGreen) >> #RoyalBlue {
|
||||
# Config $config
|
||||
# Language $language
|
||||
# Customfield $customfield
|
||||
# ConfigFieldsets $configfieldsets
|
||||
+ __construct(Config $config, Language $language, ...)
|
||||
+ set(string $lang) : void
|
||||
}
|
||||
|
||||
note right of ConfigFieldsetsCustomfield::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
Config $config
|
||||
Language $language
|
||||
Customfield $customfield
|
||||
ConfigFieldsets $configfieldsets
|
||||
end note
|
||||
|
||||
note right of ConfigFieldsetsCustomfield::set
|
||||
Set Custom Control Config Fieldsets
|
||||
|
||||
return: void
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
142
src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php
Normal file
142
src/208bc37c-0055-44df-9a34-63d6bfa10765/code.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Creator;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Language;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
|
||||
|
||||
/**
|
||||
* Config Fieldsets Customfield Creator Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ConfigFieldsetsCustomfield
|
||||
{
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Language Class.
|
||||
*
|
||||
* @var Language
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Language $language;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var Customfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customfield $customfield;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsets Class.
|
||||
*
|
||||
* @var ConfigFieldsets
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsets $configfieldsets;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Language $language The Language Class.
|
||||
* @param Customfield $customfield The ConfigFieldsetsCustomfield Class.
|
||||
* @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Language $language,
|
||||
Customfield $customfield,
|
||||
ConfigFieldsets $configfieldsets)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->language = $language;
|
||||
$this->customfield = $customfield;
|
||||
$this->configfieldsets = $configfieldsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Custom Control Config Fieldsets
|
||||
*
|
||||
* @param string $lang
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function set(string $lang): void
|
||||
{
|
||||
// add custom new global fields set
|
||||
if ($this->customfield->isActive())
|
||||
{
|
||||
foreach ($this->customfield->allActive() as $tab => $tabFields)
|
||||
{
|
||||
$tabCode = StringHelper::safe($tab)
|
||||
. '_custom_config';
|
||||
$tabUpper = StringHelper::safe($tab, 'U');
|
||||
$tabLower = StringHelper::safe($tab);
|
||||
// remove display targeted fields
|
||||
$bucket = [];
|
||||
foreach ($tabFields as $tabField)
|
||||
{
|
||||
$display = GetHelper::between(
|
||||
$tabField, 'display="', '"'
|
||||
);
|
||||
if (!StringHelper::check($display)
|
||||
|| $display === 'config')
|
||||
{
|
||||
// remove this display since it is not used in Joomla
|
||||
$bucket[] = str_replace(
|
||||
'display="config"', '', (string) $tabField
|
||||
);
|
||||
}
|
||||
}
|
||||
// only add the tab if it has values
|
||||
if (ArrayHelper::check($bucket))
|
||||
{
|
||||
// setup lang
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_' . $tabUpper, $tab
|
||||
);
|
||||
// start field set
|
||||
$this->configfieldsets->add('component', Indent::_(1) . "<fieldset");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'name="'
|
||||
. $tabCode . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang
|
||||
. '_' . $tabUpper . '">');
|
||||
// set the fields
|
||||
$this->configfieldsets->add('component', implode("", $bucket));
|
||||
// close field set
|
||||
$this->configfieldsets->add('component', Indent::_(1) . "</fieldset>");
|
||||
}
|
||||
// remove after loading
|
||||
$this->customfield->remove($tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
109
src/208bc37c-0055-44df-9a34-63d6bfa10765/code.power
Normal file
109
src/208bc37c-0055-44df-9a34-63d6bfa10765/code.power
Normal file
@ -0,0 +1,109 @@
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Language Class.
|
||||
*
|
||||
* @var Language
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Language $language;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var Customfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customfield $customfield;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsets Class.
|
||||
*
|
||||
* @var ConfigFieldsets
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsets $configfieldsets;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Language $language The Language Class.
|
||||
* @param Customfield $customfield The ConfigFieldsetsCustomfield Class.
|
||||
* @param ConfigFieldsets $configfieldsets The ConfigFieldsets Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Language $language,
|
||||
Customfield $customfield,
|
||||
ConfigFieldsets $configfieldsets)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->language = $language;
|
||||
$this->customfield = $customfield;
|
||||
$this->configfieldsets = $configfieldsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Custom Control Config Fieldsets
|
||||
*
|
||||
* @param string $lang
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function set(string $lang): void
|
||||
{
|
||||
// add custom new global fields set
|
||||
if ($this->customfield->isActive())
|
||||
{
|
||||
foreach ($this->customfield->allActive() as $tab => $tabFields)
|
||||
{
|
||||
$tabCode = StringHelper::safe($tab)
|
||||
. '_custom_config';
|
||||
$tabUpper = StringHelper::safe($tab, 'U');
|
||||
$tabLower = StringHelper::safe($tab);
|
||||
// remove display targeted fields
|
||||
$bucket = [];
|
||||
foreach ($tabFields as $tabField)
|
||||
{
|
||||
$display = GetHelper::between(
|
||||
$tabField, 'display="', '"'
|
||||
);
|
||||
if (!StringHelper::check($display)
|
||||
|| $display === 'config')
|
||||
{
|
||||
// remove this display since it is not used in Joomla
|
||||
$bucket[] = str_replace(
|
||||
'display="config"', '', (string) $tabField
|
||||
);
|
||||
}
|
||||
}
|
||||
// only add the tab if it has values
|
||||
if (ArrayHelper::check($bucket))
|
||||
{
|
||||
// setup lang
|
||||
$this->language->set(
|
||||
$this->config->lang_target, $lang . '_' . $tabUpper, $tab
|
||||
);
|
||||
// start field set
|
||||
$this->configfieldsets->add('component', Indent::_(1) . "<fieldset");
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'name="'
|
||||
. $tabCode . '"');
|
||||
$this->configfieldsets->add('component', Indent::_(2) . 'label="' . $lang
|
||||
. '_' . $tabUpper . '">');
|
||||
// set the fields
|
||||
$this->configfieldsets->add('component', implode("", $bucket));
|
||||
// close field set
|
||||
$this->configfieldsets->add('component', Indent::_(1) . "</fieldset>");
|
||||
}
|
||||
// remove after loading
|
||||
$this->customfield->remove($tab);
|
||||
}
|
||||
}
|
||||
}
|
51
src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json
Normal file
51
src/208bc37c-0055-44df-9a34-63d6bfa10765/settings.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "208bc37c-0055-44df-9a34-63d6bfa10765",
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "ConfigFieldsetsCustomfield",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Creator.ConfigFieldsetsCustomfield",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "8eee7df5-2775-41a9-9372-c46c5939a252",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b",
|
||||
"as": "Customfield"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "0a524af3-f647-4f62-a422-d7d36ebe749b",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection5": {
|
||||
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection6": {
|
||||
"use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection7": {
|
||||
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsetsCustomfield",
|
||||
"description": "Config Fieldsets Customfield Creator Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
77
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/README.md
Normal file
77
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/README.md
Normal file
@ -0,0 +1,77 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class ConfigFieldsets (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Creator**
|
||||
```uml
|
||||
@startuml
|
||||
class ConfigFieldsets << (F,LightGreen) >> #RoyalBlue {
|
||||
# Config $config
|
||||
# Component $component
|
||||
# Event $event
|
||||
# Placeholder $placeholder
|
||||
# CPlaceholder $cplaceholder
|
||||
# ExtensionsParams $extensionsparams
|
||||
# Customfield $customfield
|
||||
# FieldAsString $fieldasstring
|
||||
# ConfigFieldsetsGlobal $configfieldsetsglobal
|
||||
# ConfigFieldsetsSiteControl $configfieldsetssitecontrol
|
||||
# ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol
|
||||
# ConfigFieldsetsUikit $configfieldsetsuikit
|
||||
# ConfigFieldsetsGooglechart $configfieldsetsgooglechart
|
||||
# ConfigFieldsetsEmailHelper $configfieldsetsemailhelper
|
||||
# ConfigFieldsetsEncryption $configfieldsetsencryption
|
||||
# ConfigFieldsetsCustomfield $configfieldsetscustomfield
|
||||
+ __construct(Config $config, Component $component, ...)
|
||||
+ set(int $timer) : void
|
||||
}
|
||||
|
||||
note right of ConfigFieldsets::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.0
|
||||
|
||||
arguments:
|
||||
Config $config
|
||||
Component $component
|
||||
Event $event
|
||||
Placeholder $placeholder
|
||||
CPlaceholder $cplaceholder
|
||||
ExtensionsParams $extensionsparams
|
||||
Customfield $customfield
|
||||
FieldAsString $fieldasstring
|
||||
ConfigFieldsetsGlobal $configfieldsetsglobal
|
||||
ConfigFieldsetsSiteControl $configfieldsetssitecontrol
|
||||
ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol
|
||||
ConfigFieldsetsUikit $configfieldsetsuikit
|
||||
ConfigFieldsetsGooglechart $configfieldsetsgooglechart
|
||||
ConfigFieldsetsEmailHelper $configfieldsetsemailhelper
|
||||
ConfigFieldsetsEncryption $configfieldsetsencryption
|
||||
ConfigFieldsetsCustomfield $configfieldsetscustomfield
|
||||
end note
|
||||
|
||||
note right of ConfigFieldsets::set
|
||||
Set Config Fieldsets
|
||||
|
||||
return: void
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
388
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php
Normal file
388
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.php
Normal file
@ -0,0 +1,388 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Creator;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Component;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as CPlaceholder;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield as Customfield;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldAsString;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGlobal;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsSiteControl;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGroupControl;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsUikit;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGooglechart;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEmailHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEncryption;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsCustomfield;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||
use VDM\Joomla\Utilities\GetHelper;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
use VDM\Joomla\Utilities\MathHelper;
|
||||
|
||||
|
||||
/**
|
||||
* Config Fieldsets Creator Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class ConfigFieldsets
|
||||
{
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Component Class.
|
||||
*
|
||||
* @var Component
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Component $component;
|
||||
|
||||
/**
|
||||
* 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 Placeholder Class.
|
||||
*
|
||||
* @var CPlaceholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CPlaceholder $cplaceholder;
|
||||
|
||||
/**
|
||||
* The ExtensionsParams Class.
|
||||
*
|
||||
* @var ExtensionsParams
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ExtensionsParams $extensionsparams;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var Customfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customfield $customfield;
|
||||
|
||||
/**
|
||||
* The FieldAsString Class.
|
||||
*
|
||||
* @var FieldAsString
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected FieldAsString $fieldasstring;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsGlobal Class.
|
||||
*
|
||||
* @var ConfigFieldsetsGlobal
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsGlobal $configfieldsetsglobal;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsSiteControl Class.
|
||||
*
|
||||
* @var ConfigFieldsetsSiteControl
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsSiteControl $configfieldsetssitecontrol;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsGroupControl Class.
|
||||
*
|
||||
* @var ConfigFieldsetsGroupControl
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsUikit Class.
|
||||
*
|
||||
* @var ConfigFieldsetsUikit
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsUikit $configfieldsetsuikit;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsGooglechart Class.
|
||||
*
|
||||
* @var ConfigFieldsetsGooglechart
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsGooglechart $configfieldsetsgooglechart;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsEmailHelper Class.
|
||||
*
|
||||
* @var ConfigFieldsetsEmailHelper
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsEmailHelper $configfieldsetsemailhelper;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsEncryption Class.
|
||||
*
|
||||
* @var ConfigFieldsetsEncryption
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsEncryption $configfieldsetsencryption;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var ConfigFieldsetsCustomfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsCustomfield $configfieldsetscustomfield;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Component $component The Component Class.
|
||||
* @param Event $event The EventInterface Class.
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param CPlaceholder $cplaceholder The Placeholder Class.
|
||||
* @param ExtensionsParams $extensionsparams The ExtensionsParams Class.
|
||||
* @param Customfield $customfield The ConfigFieldsetsCustomfield Class.
|
||||
* @param FieldAsString $fieldasstring The FieldAsString Class.
|
||||
* @param ConfigFieldsetsGlobal $configfieldsetsglobal The ConfigFieldsetsGlobal Class.
|
||||
* @param ConfigFieldsetsSiteControl $configfieldsetssitecontrol The ConfigFieldsetsSiteControl Class.
|
||||
* @param ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol The ConfigFieldsetsGroupControl Class.
|
||||
* @param ConfigFieldsetsUikit $configfieldsetsuikit The ConfigFieldsetsUikit Class.
|
||||
* @param ConfigFieldsetsGooglechart $configfieldsetsgooglechart The ConfigFieldsetsGooglechart Class.
|
||||
* @param ConfigFieldsetsEmailHelper $configfieldsetsemailhelper The ConfigFieldsetsEmailHelper Class.
|
||||
* @param ConfigFieldsetsEncryption $configfieldsetsencryption The ConfigFieldsetsEncryption Class.
|
||||
* @param ConfigFieldsetsCustomfield $configfieldsetscustomfield The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Component $component, Event $event,
|
||||
Placeholder $placeholder, CPlaceholder $cplaceholder,
|
||||
ExtensionsParams $extensionsparams,
|
||||
Customfield $customfield, FieldAsString $fieldasstring,
|
||||
ConfigFieldsetsGlobal $configfieldsetsglobal,
|
||||
ConfigFieldsetsSiteControl $configfieldsetssitecontrol,
|
||||
ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol,
|
||||
ConfigFieldsetsUikit $configfieldsetsuikit,
|
||||
ConfigFieldsetsGooglechart $configfieldsetsgooglechart,
|
||||
ConfigFieldsetsEmailHelper $configfieldsetsemailhelper,
|
||||
ConfigFieldsetsEncryption $configfieldsetsencryption,
|
||||
ConfigFieldsetsCustomfield $configfieldsetscustomfield)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->component = $component;
|
||||
$this->event = $event;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->cplaceholder = $cplaceholder;
|
||||
$this->extensionsparams = $extensionsparams;
|
||||
$this->customfield = $customfield;
|
||||
$this->fieldasstring = $fieldasstring;
|
||||
$this->configfieldsetsglobal = $configfieldsetsglobal;
|
||||
$this->configfieldsetssitecontrol = $configfieldsetssitecontrol;
|
||||
$this->configfieldsetsgroupcontrol = $configfieldsetsgroupcontrol;
|
||||
$this->configfieldsetsuikit = $configfieldsetsuikit;
|
||||
$this->configfieldsetsgooglechart = $configfieldsetsgooglechart;
|
||||
$this->configfieldsetsemailhelper = $configfieldsetsemailhelper;
|
||||
$this->configfieldsetsencryption = $configfieldsetsencryption;
|
||||
$this->configfieldsetscustomfield = $configfieldsetscustomfield;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Config Fieldsets
|
||||
*
|
||||
* @param int $timer
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function set(int $timer = 0): void
|
||||
{
|
||||
// main lang prefix
|
||||
$lang = $this->config->lang_prefix . '_CONFIG';
|
||||
if (1 == $timer) // this is before the admin views are build
|
||||
{
|
||||
// start loading Global params
|
||||
$autorName = StringHelper::html(
|
||||
$this->component->get('author')
|
||||
);
|
||||
$autorEmail = StringHelper::html(
|
||||
$this->component->get('email')
|
||||
);
|
||||
$this->extensionsparams->add('component', '"autorName":"' . $autorName
|
||||
. '","autorEmail":"' . $autorEmail . '"');
|
||||
|
||||
// set the custom fields
|
||||
if ($this->component->isArray('config'))
|
||||
{
|
||||
// set component code name
|
||||
$component = $this->config->component_code_name;
|
||||
$nameSingleCode = 'config';
|
||||
$nameListCode = 'configs';
|
||||
|
||||
// set place holders
|
||||
$placeholders = [];
|
||||
$placeholders[Placefix::_h('component')]
|
||||
= $this->config->component_code_name;
|
||||
$placeholders[Placefix::_h('Component')]
|
||||
= StringHelper::safe(
|
||||
$this->component->get('name_code'), 'F'
|
||||
);
|
||||
$placeholders[Placefix::_h('COMPONENT')]
|
||||
= StringHelper::safe(
|
||||
$this->component->get('name_code'), 'U'
|
||||
);
|
||||
$placeholders[Placefix::_h('view')]
|
||||
= $nameSingleCode;
|
||||
$placeholders[Placefix::_h('views')]
|
||||
= $nameListCode;
|
||||
$placeholders[Placefix::_('component')]
|
||||
= $this->config->component_code_name;
|
||||
$placeholders[Placefix::_('Component')]
|
||||
= $placeholders[Placefix::_h('Component')];
|
||||
$placeholders[Placefix::_('COMPONENT')]
|
||||
= $placeholders[Placefix::_h('COMPONENT')];
|
||||
$placeholders[Placefix::_('view')]
|
||||
= $nameSingleCode;
|
||||
$placeholders[Placefix::_('views')]
|
||||
= $nameListCode;
|
||||
|
||||
// load the global placeholders
|
||||
foreach ($this->cplaceholder->get() as $globalPlaceholder => $gloabalValue)
|
||||
{
|
||||
$placeholders[$globalPlaceholder] = $gloabalValue;
|
||||
}
|
||||
$view = [];
|
||||
$viewType = 0;
|
||||
// set the custom table key
|
||||
$dbkey = 'g';
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeSetConfigFieldsets
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeSetConfigFieldsets', [&$timer]
|
||||
);
|
||||
|
||||
// build the config fields
|
||||
foreach ($this->component->get('config') as $field)
|
||||
{
|
||||
// get the xml string
|
||||
$xmlField = $this->fieldasstring->get(
|
||||
$field, $view, $viewType, $lang, $nameSingleCode,
|
||||
$nameListCode, $placeholders, $dbkey, false
|
||||
);
|
||||
|
||||
// make sure the xml is set and a string
|
||||
if (isset($xmlField) && StringHelper::check($xmlField))
|
||||
{
|
||||
$this->customfield->add($field['tabname'], $xmlField, true);
|
||||
// set global params to db on install
|
||||
$fieldName = StringHelper::safe(
|
||||
$this->placeholder->update(
|
||||
GetHelper::between(
|
||||
$xmlField, 'name="', '"'
|
||||
), $placeholders
|
||||
)
|
||||
);
|
||||
$fieldDefault = $this->placeholder->update(
|
||||
GetHelper::between(
|
||||
$xmlField, 'default="', '"'
|
||||
), $placeholders
|
||||
);
|
||||
if (isset($field['custom_value'])
|
||||
&& StringHelper::check(
|
||||
$field['custom_value']
|
||||
))
|
||||
{
|
||||
// add array if found
|
||||
if ((strpos((string) $field['custom_value'], '["') !== false)
|
||||
&& (strpos((string) $field['custom_value'], '"]')
|
||||
!== false))
|
||||
{
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"' . $fieldName
|
||||
. '":' . $field['custom_value']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"' . $fieldName
|
||||
. '":"' . $field['custom_value'] . '"');
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($fieldDefault))
|
||||
{
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"' . $fieldName . '":"'
|
||||
. $fieldDefault . '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// first run we must set the global
|
||||
$this->configfieldsetsglobal->set($lang, $autorName, $autorEmail);
|
||||
$this->configfieldsetssitecontrol->set($lang);
|
||||
}
|
||||
elseif (2 == $timer) // this is after the admin views are build
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeSetConfigFieldsets
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeSetConfigFieldsets', [&$timer]
|
||||
);
|
||||
|
||||
// these field sets can only be added after admin view is build
|
||||
$this->configfieldsetsgroupcontrol->set($lang);
|
||||
|
||||
// these can be added anytime really (but looks best after groups
|
||||
$this->configfieldsetsuikit->set($lang);
|
||||
$this->configfieldsetsgooglechart->set($lang);
|
||||
$this->configfieldsetsemailhelper->set($lang);
|
||||
$this->configfieldsetsencryption->set($lang);
|
||||
|
||||
// these are the custom settings
|
||||
$this->configfieldsetscustomfield->set($lang);
|
||||
}
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterSetConfigFieldsets
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterSetConfigFieldsets', [&$timer]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
340
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.power
Normal file
340
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/code.power
Normal file
@ -0,0 +1,340 @@
|
||||
/**
|
||||
* The Config Class.
|
||||
*
|
||||
* @var Config
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Config $config;
|
||||
|
||||
/**
|
||||
* The Component Class.
|
||||
*
|
||||
* @var Component
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Component $component;
|
||||
|
||||
/**
|
||||
* 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 Placeholder Class.
|
||||
*
|
||||
* @var CPlaceholder
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected CPlaceholder $cplaceholder;
|
||||
|
||||
/**
|
||||
* The ExtensionsParams Class.
|
||||
*
|
||||
* @var ExtensionsParams
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ExtensionsParams $extensionsparams;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var Customfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Customfield $customfield;
|
||||
|
||||
/**
|
||||
* The FieldAsString Class.
|
||||
*
|
||||
* @var FieldAsString
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected FieldAsString $fieldasstring;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsGlobal Class.
|
||||
*
|
||||
* @var ConfigFieldsetsGlobal
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsGlobal $configfieldsetsglobal;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsSiteControl Class.
|
||||
*
|
||||
* @var ConfigFieldsetsSiteControl
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsSiteControl $configfieldsetssitecontrol;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsGroupControl Class.
|
||||
*
|
||||
* @var ConfigFieldsetsGroupControl
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsUikit Class.
|
||||
*
|
||||
* @var ConfigFieldsetsUikit
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsUikit $configfieldsetsuikit;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsGooglechart Class.
|
||||
*
|
||||
* @var ConfigFieldsetsGooglechart
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsGooglechart $configfieldsetsgooglechart;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsEmailHelper Class.
|
||||
*
|
||||
* @var ConfigFieldsetsEmailHelper
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsEmailHelper $configfieldsetsemailhelper;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsEncryption Class.
|
||||
*
|
||||
* @var ConfigFieldsetsEncryption
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsEncryption $configfieldsetsencryption;
|
||||
|
||||
/**
|
||||
* The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @var ConfigFieldsetsCustomfield
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ConfigFieldsetsCustomfield $configfieldsetscustomfield;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Component $component The Component Class.
|
||||
* @param Event $event The EventInterface Class.
|
||||
* @param Placeholder $placeholder The Placeholder Class.
|
||||
* @param CPlaceholder $cplaceholder The Placeholder Class.
|
||||
* @param ExtensionsParams $extensionsparams The ExtensionsParams Class.
|
||||
* @param Customfield $customfield The ConfigFieldsetsCustomfield Class.
|
||||
* @param FieldAsString $fieldasstring The FieldAsString Class.
|
||||
* @param ConfigFieldsetsGlobal $configfieldsetsglobal The ConfigFieldsetsGlobal Class.
|
||||
* @param ConfigFieldsetsSiteControl $configfieldsetssitecontrol The ConfigFieldsetsSiteControl Class.
|
||||
* @param ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol The ConfigFieldsetsGroupControl Class.
|
||||
* @param ConfigFieldsetsUikit $configfieldsetsuikit The ConfigFieldsetsUikit Class.
|
||||
* @param ConfigFieldsetsGooglechart $configfieldsetsgooglechart The ConfigFieldsetsGooglechart Class.
|
||||
* @param ConfigFieldsetsEmailHelper $configfieldsetsemailhelper The ConfigFieldsetsEmailHelper Class.
|
||||
* @param ConfigFieldsetsEncryption $configfieldsetsencryption The ConfigFieldsetsEncryption Class.
|
||||
* @param ConfigFieldsetsCustomfield $configfieldsetscustomfield The ConfigFieldsetsCustomfield Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Component $component, Event $event,
|
||||
Placeholder $placeholder, CPlaceholder $cplaceholder,
|
||||
ExtensionsParams $extensionsparams,
|
||||
Customfield $customfield, FieldAsString $fieldasstring,
|
||||
ConfigFieldsetsGlobal $configfieldsetsglobal,
|
||||
ConfigFieldsetsSiteControl $configfieldsetssitecontrol,
|
||||
ConfigFieldsetsGroupControl $configfieldsetsgroupcontrol,
|
||||
ConfigFieldsetsUikit $configfieldsetsuikit,
|
||||
ConfigFieldsetsGooglechart $configfieldsetsgooglechart,
|
||||
ConfigFieldsetsEmailHelper $configfieldsetsemailhelper,
|
||||
ConfigFieldsetsEncryption $configfieldsetsencryption,
|
||||
ConfigFieldsetsCustomfield $configfieldsetscustomfield)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->component = $component;
|
||||
$this->event = $event;
|
||||
$this->placeholder = $placeholder;
|
||||
$this->cplaceholder = $cplaceholder;
|
||||
$this->extensionsparams = $extensionsparams;
|
||||
$this->customfield = $customfield;
|
||||
$this->fieldasstring = $fieldasstring;
|
||||
$this->configfieldsetsglobal = $configfieldsetsglobal;
|
||||
$this->configfieldsetssitecontrol = $configfieldsetssitecontrol;
|
||||
$this->configfieldsetsgroupcontrol = $configfieldsetsgroupcontrol;
|
||||
$this->configfieldsetsuikit = $configfieldsetsuikit;
|
||||
$this->configfieldsetsgooglechart = $configfieldsetsgooglechart;
|
||||
$this->configfieldsetsemailhelper = $configfieldsetsemailhelper;
|
||||
$this->configfieldsetsencryption = $configfieldsetsencryption;
|
||||
$this->configfieldsetscustomfield = $configfieldsetscustomfield;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Config Fieldsets
|
||||
*
|
||||
* @param int $timer
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function set(int $timer = 0): void
|
||||
{
|
||||
// main lang prefix
|
||||
$lang = $this->config->lang_prefix . '_CONFIG';
|
||||
if (1 == $timer) // this is before the admin views are build
|
||||
{
|
||||
// start loading Global params
|
||||
$autorName = StringHelper::html(
|
||||
$this->component->get('author')
|
||||
);
|
||||
$autorEmail = StringHelper::html(
|
||||
$this->component->get('email')
|
||||
);
|
||||
$this->extensionsparams->add('component', '"autorName":"' . $autorName
|
||||
. '","autorEmail":"' . $autorEmail . '"');
|
||||
|
||||
// set the custom fields
|
||||
if ($this->component->isArray('config'))
|
||||
{
|
||||
// set component code name
|
||||
$component = $this->config->component_code_name;
|
||||
$nameSingleCode = 'config';
|
||||
$nameListCode = 'configs';
|
||||
|
||||
// set place holders
|
||||
$placeholders = [];
|
||||
$placeholders[Placefix::_h('component')]
|
||||
= $this->config->component_code_name;
|
||||
$placeholders[Placefix::_h('Component')]
|
||||
= StringHelper::safe(
|
||||
$this->component->get('name_code'), 'F'
|
||||
);
|
||||
$placeholders[Placefix::_h('COMPONENT')]
|
||||
= StringHelper::safe(
|
||||
$this->component->get('name_code'), 'U'
|
||||
);
|
||||
$placeholders[Placefix::_h('view')]
|
||||
= $nameSingleCode;
|
||||
$placeholders[Placefix::_h('views')]
|
||||
= $nameListCode;
|
||||
$placeholders[Placefix::_('component')]
|
||||
= $this->config->component_code_name;
|
||||
$placeholders[Placefix::_('Component')]
|
||||
= $placeholders[Placefix::_h('Component')];
|
||||
$placeholders[Placefix::_('COMPONENT')]
|
||||
= $placeholders[Placefix::_h('COMPONENT')];
|
||||
$placeholders[Placefix::_('view')]
|
||||
= $nameSingleCode;
|
||||
$placeholders[Placefix::_('views')]
|
||||
= $nameListCode;
|
||||
|
||||
// load the global placeholders
|
||||
foreach ($this->cplaceholder->get() as $globalPlaceholder => $gloabalValue)
|
||||
{
|
||||
$placeholders[$globalPlaceholder] = $gloabalValue;
|
||||
}
|
||||
$view = [];
|
||||
$viewType = 0;
|
||||
// set the custom table key
|
||||
$dbkey = 'g';
|
||||
|
||||
// Trigger Event: jcb_ce_onBeforeSetConfigFieldsets
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeSetConfigFieldsets', [&$timer]
|
||||
);
|
||||
|
||||
// build the config fields
|
||||
foreach ($this->component->get('config') as $field)
|
||||
{
|
||||
// get the xml string
|
||||
$xmlField = $this->fieldasstring->get(
|
||||
$field, $view, $viewType, $lang, $nameSingleCode,
|
||||
$nameListCode, $placeholders, $dbkey, false
|
||||
);
|
||||
|
||||
// make sure the xml is set and a string
|
||||
if (isset($xmlField) && StringHelper::check($xmlField))
|
||||
{
|
||||
$this->customfield->add($field['tabname'], $xmlField, true);
|
||||
// set global params to db on install
|
||||
$fieldName = StringHelper::safe(
|
||||
$this->placeholder->update(
|
||||
GetHelper::between(
|
||||
$xmlField, 'name="', '"'
|
||||
), $placeholders
|
||||
)
|
||||
);
|
||||
$fieldDefault = $this->placeholder->update(
|
||||
GetHelper::between(
|
||||
$xmlField, 'default="', '"'
|
||||
), $placeholders
|
||||
);
|
||||
if (isset($field['custom_value'])
|
||||
&& StringHelper::check(
|
||||
$field['custom_value']
|
||||
))
|
||||
{
|
||||
// add array if found
|
||||
if ((strpos((string) $field['custom_value'], '["') !== false)
|
||||
&& (strpos((string) $field['custom_value'], '"]')
|
||||
!== false))
|
||||
{
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"' . $fieldName
|
||||
. '":' . $field['custom_value']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"' . $fieldName
|
||||
. '":"' . $field['custom_value'] . '"');
|
||||
}
|
||||
}
|
||||
elseif (StringHelper::check($fieldDefault))
|
||||
{
|
||||
// load the Global checkin defautls
|
||||
$this->extensionsparams->add('component', '"' . $fieldName . '":"'
|
||||
. $fieldDefault . '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// first run we must set the global
|
||||
$this->configfieldsetsglobal->set($lang, $autorName, $autorEmail);
|
||||
$this->configfieldsetssitecontrol->set($lang);
|
||||
}
|
||||
elseif (2 == $timer) // this is after the admin views are build
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeSetConfigFieldsets
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onBeforeSetConfigFieldsets', [&$timer]
|
||||
);
|
||||
|
||||
// these field sets can only be added after admin view is build
|
||||
$this->configfieldsetsgroupcontrol->set($lang);
|
||||
|
||||
// these can be added anytime really (but looks best after groups
|
||||
$this->configfieldsetsuikit->set($lang);
|
||||
$this->configfieldsetsgooglechart->set($lang);
|
||||
$this->configfieldsetsemailhelper->set($lang);
|
||||
$this->configfieldsetsencryption->set($lang);
|
||||
|
||||
// these are the custom settings
|
||||
$this->configfieldsetscustomfield->set($lang);
|
||||
}
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterSetConfigFieldsets
|
||||
$this->event->trigger(
|
||||
'jcb_ce_onAfterSetConfigFieldsets', [&$timer]
|
||||
);
|
||||
}
|
111
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json
Normal file
111
src/20cf1825-29d0-4c6c-8fe9-a1e13a4dac53/settings.json
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "20cf1825-29d0-4c6c-8fe9-a1e13a4dac53",
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "ConfigFieldsets",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Creator.ConfigFieldsets",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d",
|
||||
"as": "Event"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection4": {
|
||||
"use": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb",
|
||||
"as": "CPlaceholder"
|
||||
},
|
||||
"use_selection5": {
|
||||
"use": "bcf1e767-1566-440d-9f67-5c1bada934fa",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection6": {
|
||||
"use": "ed314bd8-c995-4282-bcaa-5e0a68ac401b",
|
||||
"as": "Customfield"
|
||||
},
|
||||
"use_selection7": {
|
||||
"use": "f48764e0-16c6-459c-8576-af7616f3b720",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection8": {
|
||||
"use": "0fe3133d-1ff3-4444-9229-4218d8fb338e",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection9": {
|
||||
"use": "aac8502a-dbdf-42b6-a9ba-2c2e941f8b11",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection10": {
|
||||
"use": "a8d9583a-6ddb-4aac-b0d1-4c2d2d1c8c74",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection11": {
|
||||
"use": "84c11075-570a-4907-9be0-9305e0fabe3c",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection12": {
|
||||
"use": "31c8127c-0d42-4e09-be81-7cf243c5b30f",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection13": {
|
||||
"use": "d80e58b8-8462-47c4-9dcd-380445f1c64a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection14": {
|
||||
"use": "5e3fc314-646b-4834-8b1a-1a79f3d4d2ab",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection15": {
|
||||
"use": "208bc37c-0055-44df-9a34-63d6bfa10765",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection16": {
|
||||
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection17": {
|
||||
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection18": {
|
||||
"use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection19": {
|
||||
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection20": {
|
||||
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection21": {
|
||||
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection22": {
|
||||
"use": "152c8793-8b75-4715-996a-257b9f65451c",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Creator.ConfigFieldsets",
|
||||
"description": "Config Fieldsets Creator Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -11,7 +11,7 @@
|
||||
```uml
|
||||
@startuml
|
||||
interface EventInterface #Lavender {
|
||||
+ trigger(string $event, mixed $data) : void
|
||||
+ trigger(string $event, mixed $data = null) : void
|
||||
}
|
||||
|
||||
note right of EventInterface::trigger
|
||||
|
@ -28,6 +28,6 @@ interface EventInterface
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function trigger(string $event, $data);
|
||||
public function trigger(string $event, $data = null);
|
||||
}
|
||||
|
||||
|
@ -7,4 +7,4 @@
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function trigger(string $event, $data);
|
||||
public function trigger(string $event, $data = null);
|
46
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/README.md
Normal file
46
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/README.md
Normal file
@ -0,0 +1,46 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class CanDelete (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\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 Model 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)
|
||||
|
91
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php
Normal file
91
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\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 3
|
||||
*
|
||||
* @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 Model 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))";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "if (\$record->published != -2)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
$allow[] = Indent::_(4) . "return;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
// check if the item has permissions.
|
||||
$allow[] = PHP_EOL . Indent::_(3)
|
||||
. "\$user = Factory::getUser();";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
$allow[] = Indent::_(3) . "return \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$record->id);";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
$allow[] = Indent::_(2) . "return false;";
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
||||
}
|
||||
|
61
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.power
Normal file
61
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/code.power
Normal file
@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 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 Model 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))";
|
||||
$allow[] = Indent::_(2) . "{";
|
||||
$allow[] = Indent::_(3) . "if (\$record->published != -2)";
|
||||
$allow[] = Indent::_(3) . "{";
|
||||
$allow[] = Indent::_(4) . "return;";
|
||||
$allow[] = Indent::_(3) . "}";
|
||||
// check if the item has permissions.
|
||||
$allow[] = PHP_EOL . Indent::_(3)
|
||||
. "\$user = Factory::getUser();";
|
||||
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " The record has been set. Check the record permissions.";
|
||||
$allow[] = Indent::_(3) . "return \$user->authorise('"
|
||||
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
|
||||
. $nameSingleCode . ".' . (int) \$record->id);";
|
||||
$allow[] = Indent::_(2) . "}";
|
||||
$allow[] = Indent::_(2) . "return false;";
|
||||
|
||||
return implode(PHP_EOL, $allow);
|
||||
}
|
37
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json
Normal file
37
src/23766738-d0a4-4d0a-8555-7e4c97c0cddd/settings.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "23766738-d0a4-4d0a-8555-7e4c97c0cddd",
|
||||
"implements": [
|
||||
"e00a7d1d-6d80-41c5-bf13-32d41bc5bf91"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "CanDelete",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Architecture.J3.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.JoomlaThree.Model.CanDelete",
|
||||
"description": "Model Can Delete Class for Joomla 3\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
109
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md
Normal file
109
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md
Normal file
@ -0,0 +1,109 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class FileInjector (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities**
|
||||
```uml
|
||||
@startuml
|
||||
class FileInjector << (F,LightGreen) >> #RoyalBlue {
|
||||
# Power $power
|
||||
+ __construct(Power $power)
|
||||
+ add(string $file, string $data, ...) : void
|
||||
- openFileWithLock(string $file) : resource
|
||||
- processFile(resource $actual_file, resource $temp_file, ...) : void
|
||||
- truncateIfNeeded(resource $actual_file, string $data, ...) : void
|
||||
- copyRemainingData(resource $actual_file, resource $temp_file, ...) : void
|
||||
- injectSuperPowers(resource $actual_file) : void
|
||||
}
|
||||
|
||||
note right of FileInjector::__construct
|
||||
Constructor.
|
||||
|
||||
since: 3.2.0
|
||||
end note
|
||||
|
||||
note right of FileInjector::add
|
||||
Inserts or replaces data in a file at a specific position.
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
|
||||
arguments:
|
||||
string $file
|
||||
string $data
|
||||
int $position
|
||||
?int $replace = null
|
||||
end note
|
||||
|
||||
note right of FileInjector::openFileWithLock
|
||||
Opens a file and acquires an exclusive lock on it.
|
||||
|
||||
since: 3.2.0
|
||||
return: resource
|
||||
end note
|
||||
|
||||
note right of FileInjector::processFile
|
||||
Processes the file for data insertion and copying the remaining data.
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
|
||||
arguments:
|
||||
resource $actual_file
|
||||
resource $temp_file
|
||||
string $data
|
||||
int $position
|
||||
?int $replace
|
||||
end note
|
||||
|
||||
note right of FileInjector::truncateIfNeeded
|
||||
Truncates the file after data insertion if necessary.
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
|
||||
arguments:
|
||||
resource $actual_file
|
||||
string $data
|
||||
int $position
|
||||
end note
|
||||
|
||||
note right of FileInjector::copyRemainingData
|
||||
Copies the remaining data from the temporary stream to the actual file.
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
|
||||
arguments:
|
||||
resource $actual_file
|
||||
resource $temp_file
|
||||
int $position
|
||||
?int $replace
|
||||
end note
|
||||
|
||||
note right of FileInjector::injectSuperPowers
|
||||
Injects super powers into the file content, if found, and updates the file.
|
||||
|
||||
since: 3.2.0
|
||||
return: void
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
213
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php
Normal file
213
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php
Normal file
@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Utilities;
|
||||
|
||||
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Power\Injector as Power;
|
||||
use VDM\Joomla\Utilities\MathHelper;
|
||||
|
||||
|
||||
/**
|
||||
* File Injector
|
||||
* Thanks to http://stackoverflow.com/a/16813550/1429677
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class FileInjector
|
||||
{
|
||||
/**
|
||||
* The Injector Class.
|
||||
*
|
||||
* @var Power
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Power $power;
|
||||
|
||||
/**
|
||||
* The pattern to get the powers
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Power $power The Injector Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Power $power)
|
||||
{
|
||||
$this->power = $power;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts or replaces data in a file at a specific position.
|
||||
*
|
||||
* @param string $file The path of the file to modify.
|
||||
* @param string $data The data to insert or replace.
|
||||
* @param int $position The position in the file where the data should be inserted or replaced.
|
||||
* @param int|null $replace The number of bytes to replace; if null, data will be inserted.
|
||||
*
|
||||
* @return void
|
||||
* @throws \RuntimeException If unable to open or modify the file.
|
||||
* @throws \InvalidArgumentException If the position is negative.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function add(string $file, string $data, int $position, ?int $replace = null): void
|
||||
{
|
||||
if ($position < 0)
|
||||
{
|
||||
throw new \InvalidArgumentException('Position cannot be negative.');
|
||||
}
|
||||
|
||||
$found_super_powers = preg_match($this->pattern, $data);
|
||||
$actual_file = $this->openFileWithLock($file);
|
||||
|
||||
try
|
||||
{
|
||||
$temp_file = fopen('php://temp', "rw+");
|
||||
if ($temp_file === false)
|
||||
{
|
||||
throw new \RuntimeException("Unable to open temporary file.");
|
||||
}
|
||||
|
||||
$this->processFile($actual_file, $temp_file, $data, $position, $replace);
|
||||
|
||||
if ($found_super_powers)
|
||||
{
|
||||
$this->injectSuperPowers($actual_file);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
flock($actual_file, LOCK_UN);
|
||||
fclose($actual_file);
|
||||
if (isset($temp_file))
|
||||
{
|
||||
fclose($temp_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a file and acquires an exclusive lock on it.
|
||||
*
|
||||
* @param string $file The file path to open.
|
||||
*
|
||||
* @return resource The file handle.
|
||||
* @throws \RuntimeException If the file cannot be opened or locked.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function openFileWithLock(string $file)
|
||||
{
|
||||
$actual_file = fopen($file, "rw+");
|
||||
if ($actual_file === false || !flock($actual_file, LOCK_EX))
|
||||
{
|
||||
throw new \RuntimeException("Unable to open and lock the file: {$file}");
|
||||
}
|
||||
return $actual_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the file for data insertion and copying the remaining data.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
* @param resource $temp_file The file handle of the temporary file.
|
||||
* @param string $data The data to be inserted.
|
||||
* @param int $position The position in the file for the data insertion.
|
||||
* @param int|null $replace The number of bytes to replace; if null, data will be inserted.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function processFile($actual_file, $temp_file, string $data, int $position, ?int $replace): void
|
||||
{
|
||||
// Make a copy of the file in the temporary stream
|
||||
stream_copy_to_stream($actual_file, $temp_file);
|
||||
|
||||
// Move to the position where the data should be added
|
||||
fseek($actual_file, $position);
|
||||
|
||||
// Add the data
|
||||
fwrite($actual_file, $data);
|
||||
|
||||
$this->truncateIfNeeded($actual_file, $data, $position);
|
||||
$this->copyRemainingData($actual_file, $temp_file, $position, $replace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates the file after data insertion if necessary.
|
||||
*
|
||||
* @param resource $actual_file The file handle.
|
||||
* @param string $data The data that was inserted.
|
||||
* @param int $position The position where data was inserted.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function truncateIfNeeded($actual_file, string $data, int $position): void
|
||||
{
|
||||
// Truncate the file at the end of the added data if replacing
|
||||
$data_length = mb_strlen($data, '8bit');
|
||||
$remove = MathHelper::bc('add', $position, $data_length);
|
||||
ftruncate($actual_file, $remove);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the remaining data from the temporary stream to the actual file.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
* @param resource $temp_file The file handle of the temporary file.
|
||||
* @param int $position The position in the file where data insertion finished.
|
||||
* @param int|null $replace The number of bytes that were replaced; if null, data was inserted.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function copyRemainingData($actual_file, $temp_file, int $position, ?int $replace): void
|
||||
{
|
||||
// check if this was a replacement of data
|
||||
$position = MathHelper::bc('add', $position, $replace ?: 0);
|
||||
|
||||
// Move to the position of the remaining data in the temporary stream
|
||||
fseek($temp_file, $position);
|
||||
|
||||
// Copy the remaining data from the temporary stream to the file
|
||||
stream_copy_to_stream($temp_file, $actual_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects super powers into the file content, if found, and updates the file.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function injectSuperPowers($actual_file): void
|
||||
{
|
||||
rewind($actual_file);
|
||||
|
||||
$power_data = $this->power->power(
|
||||
stream_get_contents($actual_file)
|
||||
);
|
||||
|
||||
ftruncate($actual_file, 0);
|
||||
rewind($actual_file);
|
||||
|
||||
fwrite($actual_file, $power_data);
|
||||
}
|
||||
}
|
||||
|
185
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.power
Normal file
185
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.power
Normal file
@ -0,0 +1,185 @@
|
||||
/**
|
||||
* The Injector Class.
|
||||
*
|
||||
* @var Power
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Power $power;
|
||||
|
||||
/**
|
||||
* The pattern to get the powers
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Power $power The Injector Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Power $power)
|
||||
{
|
||||
$this->power = $power;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts or replaces data in a file at a specific position.
|
||||
*
|
||||
* @param string $file The path of the file to modify.
|
||||
* @param string $data The data to insert or replace.
|
||||
* @param int $position The position in the file where the data should be inserted or replaced.
|
||||
* @param int|null $replace The number of bytes to replace; if null, data will be inserted.
|
||||
*
|
||||
* @return void
|
||||
* @throws \RuntimeException If unable to open or modify the file.
|
||||
* @throws \InvalidArgumentException If the position is negative.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function add(string $file, string $data, int $position, ?int $replace = null): void
|
||||
{
|
||||
if ($position < 0)
|
||||
{
|
||||
throw new \InvalidArgumentException('Position cannot be negative.');
|
||||
}
|
||||
|
||||
$found_super_powers = preg_match($this->pattern, $data);
|
||||
$actual_file = $this->openFileWithLock($file);
|
||||
|
||||
try
|
||||
{
|
||||
$temp_file = fopen('php://temp', "rw+");
|
||||
if ($temp_file === false)
|
||||
{
|
||||
throw new \RuntimeException("Unable to open temporary file.");
|
||||
}
|
||||
|
||||
$this->processFile($actual_file, $temp_file, $data, $position, $replace);
|
||||
|
||||
if ($found_super_powers)
|
||||
{
|
||||
$this->injectSuperPowers($actual_file);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
flock($actual_file, LOCK_UN);
|
||||
fclose($actual_file);
|
||||
if (isset($temp_file))
|
||||
{
|
||||
fclose($temp_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a file and acquires an exclusive lock on it.
|
||||
*
|
||||
* @param string $file The file path to open.
|
||||
*
|
||||
* @return resource The file handle.
|
||||
* @throws \RuntimeException If the file cannot be opened or locked.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function openFileWithLock(string $file)
|
||||
{
|
||||
$actual_file = fopen($file, "rw+");
|
||||
if ($actual_file === false || !flock($actual_file, LOCK_EX))
|
||||
{
|
||||
throw new \RuntimeException("Unable to open and lock the file: {$file}");
|
||||
}
|
||||
return $actual_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the file for data insertion and copying the remaining data.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
* @param resource $temp_file The file handle of the temporary file.
|
||||
* @param string $data The data to be inserted.
|
||||
* @param int $position The position in the file for the data insertion.
|
||||
* @param int|null $replace The number of bytes to replace; if null, data will be inserted.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function processFile($actual_file, $temp_file, string $data, int $position, ?int $replace): void
|
||||
{
|
||||
// Make a copy of the file in the temporary stream
|
||||
stream_copy_to_stream($actual_file, $temp_file);
|
||||
|
||||
// Move to the position where the data should be added
|
||||
fseek($actual_file, $position);
|
||||
|
||||
// Add the data
|
||||
fwrite($actual_file, $data);
|
||||
|
||||
$this->truncateIfNeeded($actual_file, $data, $position);
|
||||
$this->copyRemainingData($actual_file, $temp_file, $position, $replace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates the file after data insertion if necessary.
|
||||
*
|
||||
* @param resource $actual_file The file handle.
|
||||
* @param string $data The data that was inserted.
|
||||
* @param int $position The position where data was inserted.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function truncateIfNeeded($actual_file, string $data, int $position): void
|
||||
{
|
||||
// Truncate the file at the end of the added data if replacing
|
||||
$data_length = mb_strlen($data, '8bit');
|
||||
$remove = MathHelper::bc('add', $position, $data_length);
|
||||
ftruncate($actual_file, $remove);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the remaining data from the temporary stream to the actual file.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
* @param resource $temp_file The file handle of the temporary file.
|
||||
* @param int $position The position in the file where data insertion finished.
|
||||
* @param int|null $replace The number of bytes that were replaced; if null, data was inserted.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function copyRemainingData($actual_file, $temp_file, int $position, ?int $replace): void
|
||||
{
|
||||
// check if this was a replacement of data
|
||||
$position = MathHelper::bc('add', $position, $replace ?: 0);
|
||||
|
||||
// Move to the position of the remaining data in the temporary stream
|
||||
fseek($temp_file, $position);
|
||||
|
||||
// Copy the remaining data from the temporary stream to the file
|
||||
stream_copy_to_stream($temp_file, $actual_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects super powers into the file content, if found, and updates the file.
|
||||
*
|
||||
* @param resource $actual_file The file handle of the actual file.
|
||||
*
|
||||
* @return void
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function injectSuperPowers($actual_file): void
|
||||
{
|
||||
rewind($actual_file);
|
||||
|
||||
$power_data = $this->power->power(
|
||||
stream_get_contents($actual_file)
|
||||
);
|
||||
|
||||
ftruncate($actual_file, 0);
|
||||
rewind($actual_file);
|
||||
|
||||
fwrite($actual_file, $power_data);
|
||||
}
|
27
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json
Normal file
27
src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "23f2ca33-440a-4941-8e9a-4bc67522c0cb",
|
||||
"implements": null,
|
||||
"load_selection": null,
|
||||
"name": "FileInjector",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Utilities.FileInjector",
|
||||
"type": "final class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
"use": "763d137c-42bc-4282-98d8-cc5c0654985f",
|
||||
"as": "Power"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "152c8793-8b75-4715-996a-257b9f65451c",
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.FileInjector",
|
||||
"description": "File Injector\r\n Thanks to http:\/\/stackoverflow.com\/a\/16813550\/1429677\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -6,29 +6,37 @@
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# class CoreValidation (Details)
|
||||
# class CoreRule (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree**
|
||||
```uml
|
||||
@startuml
|
||||
class CoreValidation #Gold {
|
||||
# ?array $rules
|
||||
class CoreRule #Gold {
|
||||
# array $rules
|
||||
# string $path
|
||||
+ __construct()
|
||||
+ get(bool $lowercase = false) : array
|
||||
- set(string $path) : void
|
||||
}
|
||||
|
||||
note right of CoreValidation::__construct
|
||||
note right of CoreRule::__construct
|
||||
Constructor
|
||||
|
||||
since: 3.2.0
|
||||
end note
|
||||
|
||||
note right of CoreValidation::get
|
||||
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
|
||||
```
|
||||
|
@ -14,23 +14,23 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree;
|
||||
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface;
|
||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Core Joomla Field Validation Rules
|
||||
* Core Joomla Field Rules
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
class CoreValidation implements CoreValidationInterface
|
||||
class CoreRule implements CoreRuleInterface
|
||||
{
|
||||
/**
|
||||
* Local Core Joomla Rules
|
||||
*
|
||||
* @var array|null
|
||||
* @var array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected ?array $rules = null;
|
||||
protected array $rules = [];
|
||||
|
||||
/**
|
||||
* Local Core Joomla Rules Path
|
||||
@ -61,41 +61,13 @@ class CoreValidation implements CoreValidationInterface
|
||||
*/
|
||||
public function get(bool $lowercase = false): array
|
||||
{
|
||||
if (!$this->rules)
|
||||
if ($this->rules === [])
|
||||
{
|
||||
// check if the path exist
|
||||
if (!Folder::exists($this->path))
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
// we must first store the current working directory
|
||||
$joomla = getcwd();
|
||||
|
||||
// go to that folder
|
||||
chdir($this->path);
|
||||
|
||||
// load all the files in this path
|
||||
$rules = Folder::files('.', '\.php', true, true);
|
||||
|
||||
// change back to Joomla working directory
|
||||
chdir($joomla);
|
||||
|
||||
// make sure we have an array
|
||||
if (!ArrayHelper::check($rules))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove the Rule.php from the name
|
||||
$this->rules = array_map(
|
||||
fn($name): string => str_replace(array('./','Rule.php'), '', (string) $name),
|
||||
$rules
|
||||
);
|
||||
$this->set($this->path);
|
||||
}
|
||||
|
||||
// return rules if found
|
||||
if (is_array($this->rules))
|
||||
if ($this->rules !== [])
|
||||
{
|
||||
// check if the names should be all lowercase
|
||||
if ($lowercase)
|
||||
@ -105,12 +77,49 @@ class CoreValidation implements CoreValidationInterface
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
/**
|
||||
* Local Core Joomla Rules
|
||||
*
|
||||
* @var array|null
|
||||
* @var array
|
||||
* @since 3.2.0
|
||||
**/
|
||||
protected ?array $rules = null;
|
||||
protected array $rules = [];
|
||||
|
||||
/**
|
||||
* Local Core Joomla Rules Path
|
||||
@ -35,41 +35,13 @@
|
||||
*/
|
||||
public function get(bool $lowercase = false): array
|
||||
{
|
||||
if (!$this->rules)
|
||||
if ($this->rules === [])
|
||||
{
|
||||
// check if the path exist
|
||||
if (!Folder::exists($this->path))
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
// we must first store the current working directory
|
||||
$joomla = getcwd();
|
||||
|
||||
// go to that folder
|
||||
chdir($this->path);
|
||||
|
||||
// load all the files in this path
|
||||
$rules = Folder::files('.', '\.php', true, true);
|
||||
|
||||
// change back to Joomla working directory
|
||||
chdir($joomla);
|
||||
|
||||
// make sure we have an array
|
||||
if (!ArrayHelper::check($rules))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove the Rule.php from the name
|
||||
$this->rules = array_map(
|
||||
fn($name): string => str_replace(array('./','Rule.php'), '', (string) $name),
|
||||
$rules
|
||||
);
|
||||
$this->set($this->path);
|
||||
}
|
||||
|
||||
// return rules if found
|
||||
if (is_array($this->rules))
|
||||
if ($this->rules !== [])
|
||||
{
|
||||
// check if the names should be all lowercase
|
||||
if ($lowercase)
|
||||
@ -79,9 +51,47 @@
|
||||
$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));
|
||||
}
|
@ -7,9 +7,9 @@
|
||||
"b9f05dc4-d23a-499a-a826-9749b81818ed"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "CoreValidation",
|
||||
"name": "CoreRule",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Field.JoomlaThree.CoreValidation",
|
||||
"system_name": "JCB.Compiler.Field.J3.CoreRule",
|
||||
"type": "class",
|
||||
"use_selection": {
|
||||
"use_selection0": {
|
||||
@ -17,8 +17,8 @@
|
||||
"as": "default"
|
||||
}
|
||||
},
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.CoreValidation",
|
||||
"description": "Core Joomla Field Validation Rules\r\n\r\n@since 3.2.0",
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\CMS\\Filesystem\\Folder;",
|
||||
"composer": ""
|
||||
|
57
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md
Normal file
57
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/README.md
Normal file
@ -0,0 +1,57 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# class History (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaFour**
|
||||
```uml
|
||||
@startuml
|
||||
class History #Gold {
|
||||
# ?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)
|
||||
|
230
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php
Normal file
230
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php
Normal file
@ -0,0 +1,230 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaFour;
|
||||
|
||||
|
||||
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
|
||||
*/
|
||||
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('#__ucm_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
|
||||
)
|
||||
);
|
||||
$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('#__ucm_history AS h');
|
||||
$query->where(
|
||||
$this->db->quoteName('h.ucm_item_id') . ' = ' . (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);
|
||||
}
|
||||
// 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();
|
||||
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('#__ucm_history', $object, 'version_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
198
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power
Normal file
198
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.power
Normal file
@ -0,0 +1,198 @@
|
||||
/**
|
||||
* 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('#__ucm_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
|
||||
)
|
||||
);
|
||||
$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('#__ucm_history AS h');
|
||||
$query->where(
|
||||
$this->db->quoteName('h.ucm_item_id') . ' = ' . (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);
|
||||
}
|
||||
// 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();
|
||||
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('#__ucm_history', $object, 'version_id');
|
||||
}
|
37
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json
Normal file
37
src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"add_head": "1",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "25c7ca86-6088-4f5f-b9fe-13504779c6ba",
|
||||
"implements": [
|
||||
"4325745f-da1f-4d4d-a591-3189fe8c06e5"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "History",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.JoomlaFour.History",
|
||||
"type": "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.JoomlaFour.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 <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "use Joomla\\CMS\\Factory;",
|
||||
"composer": ""
|
||||
}
|
30
src/274a78d1-24c2-4486-b560-b86e9ae72872/README.md
Normal file
30
src/274a78d1-24c2-4486-b560-b86e9ae72872/README.md
Normal file
@ -0,0 +1,30 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class Contributors (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder**
|
||||
> extends: **Registry**
|
||||
```uml
|
||||
@startuml
|
||||
class Contributors << (F,LightGreen) >> #RoyalBlue {
|
||||
}
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
---
|
||||
```
|
||||
██╗ ██████╗██████╗
|
||||
██║██╔════╝██╔══██╗
|
||||
██║██║ ██████╔╝
|
||||
██ ██║██║ ██╔══██╗
|
||||
╚█████╔╝╚██████╗██████╔╝
|
||||
╚════╝ ╚═════╝╚═════╝
|
||||
```
|
||||
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
|
27
src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php
Normal file
27
src/274a78d1-24c2-4486-b560-b86e9ae72872/code.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
|
||||
|
||||
|
||||
use VDM\Joomla\Interfaces\Registryinterface;
|
||||
use VDM\Joomla\Abstraction\Registry;
|
||||
|
||||
|
||||
/**
|
||||
* Contributors Builder Class
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
final class Contributors extends Registry implements Registryinterface
|
||||
{
|
||||
}
|
||||
|
1
src/274a78d1-24c2-4486-b560-b86e9ae72872/code.power
Normal file
1
src/274a78d1-24c2-4486-b560-b86e9ae72872/code.power
Normal file
@ -0,0 +1 @@
|
||||
###CODEPOWER###
|
20
src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json
Normal file
20
src/274a78d1-24c2-4486-b560-b86e9ae72872/settings.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "7e822c03-1b20-41d1-9427-f5b8d5836af7",
|
||||
"guid": "274a78d1-24c2-4486-b560-b86e9ae72872",
|
||||
"implements": [
|
||||
"64e291c2-11f1-423d-a44d-837cc12cc017"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "Contributors",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Builder.Contributors",
|
||||
"type": "final class",
|
||||
"use_selection": null,
|
||||
"namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.Contributors",
|
||||
"description": "Contributors Builder Class\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
46
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/README.md
Normal file
46
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/README.md
Normal file
@ -0,0 +1,46 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class CanDelete (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\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)
|
||||
|
87
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php
Normal file
87
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\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 4
|
||||
*
|
||||
* @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->state != -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);
|
||||
}
|
||||
}
|
||||
|
57
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power
Normal file
57
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/code.power
Normal file
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* The Component code name.
|
||||
*
|
||||
* @var String
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected String $component;
|
||||
|
||||
/**
|
||||
* The Permission Class.
|
||||
*
|
||||
* @var Permission
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected Permission $permission;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Config $config The Config Class.
|
||||
* @param Permission $permission The Permission Class.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function __construct(Config $config, Permission $permission)
|
||||
{
|
||||
$this->component = $config->component_code_name;
|
||||
$this->permission = $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Can Delete Function Code
|
||||
*
|
||||
* @param string $nameSingleCode The single code name of the view.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @return string The can delete method code
|
||||
*/
|
||||
public function get(string $nameSingleCode): string
|
||||
{
|
||||
$allow = [];
|
||||
|
||||
// setup the default script
|
||||
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->state != -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);
|
||||
}
|
37
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json
Normal file
37
src/2a69a8ab-cea0-4c75-92d5-9495cb740e0f/settings.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "2a69a8ab-cea0-4c75-92d5-9495cb740e0f",
|
||||
"implements": [
|
||||
"e00a7d1d-6d80-41c5-bf13-32d41bc5bf91"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "CanDelete",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Architecture.J4.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.JoomlaFour.Model.CanDelete",
|
||||
"description": "Model Can Delete Class for Joomla 4\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
52
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/README.md
Normal file
52
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/README.md
Normal file
@ -0,0 +1,52 @@
|
||||
```
|
||||
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
||||
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
||||
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
||||
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
||||
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
||||
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
||||
```
|
||||
# final class InputButton (Details)
|
||||
> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree**
|
||||
```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)
|
||||
|
339
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php
Normal file
339
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.php
Normal file
@ -0,0 +1,339 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 4th September, 2022
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree;
|
||||
|
||||
|
||||
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::getUser();";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only add if user allowed to create " . $fieldData['view'];
|
||||
// check if the item has permissions.
|
||||
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($fieldData['view'], 'core.create')
|
||||
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build Create button";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$button[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\"";
|
||||
$addButton[] = Indent::_(5) . "href=\"index.php?option="
|
||||
. $fieldData['component'] . "&view=" . $fieldData['view']
|
||||
. "&layout=edit'.\$ref.'\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-new icon-white\"></span></a>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only add if user allowed to edit " . $fieldData['view'];
|
||||
// check if the item has permissions.
|
||||
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
|
||||
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build edit button";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-edit\"></span></a>';";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build script";
|
||||
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||
$addButton[] = Indent::_(5) . "jQuery(document).ready(function() {";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {";
|
||||
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||
$addButton[] = Indent::_(6) . "});";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();";
|
||||
$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)
|
||||
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
|
||||
$addButton[] = Indent::_(7) . "// hide the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Create').hide();";
|
||||
$addButton[] = Indent::_(7) . "// show edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Edit').show();";
|
||||
$addButton[] = Indent::_(7) . "var 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)
|
||||
. "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);";
|
||||
$addButton[] = Indent::_(6) . "} else {";
|
||||
$addButton[] = Indent::_(7) . "// show the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Create').show();";
|
||||
$addButton[] = Indent::_(7) . "// hide edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Edit').hide();";
|
||||
$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::getDocument();";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " return the button attached to input field.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "return '<div class=\"input-append\">' .\$html . implode('',\$button).'</div>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(2) . "}";
|
||||
$addButton[] = Indent::_(2) . "return \$html;";
|
||||
$addButton[] = Indent::_(1) . "}";
|
||||
|
||||
return implode(PHP_EOL, $addButton);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
306
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.power
Normal file
306
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/code.power
Normal file
@ -0,0 +1,306 @@
|
||||
/**
|
||||
* 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::getUser();";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only add if user allowed to create " . $fieldData['view'];
|
||||
// check if the item has permissions.
|
||||
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($fieldData['view'], 'core.create')
|
||||
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build Create button";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$button[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\"";
|
||||
$addButton[] = Indent::_(5) . "href=\"index.php?option="
|
||||
. $fieldData['component'] . "&view=" . $fieldData['view']
|
||||
. "&layout=edit'.\$ref.'\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-new icon-white\"></span></a>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||
. " only add if user allowed to edit " . $fieldData['view'];
|
||||
// check if the item has permissions.
|
||||
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
|
||||
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||
$addButton[] = Indent::_(3) . "{";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build edit button";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
|
||||
. ":sprintf('" . $this->config->lang_prefix
|
||||
. "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >";
|
||||
$addButton[] = Indent::_(5)
|
||||
. "<span class=\"icon-edit\"></span></a>';";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " build script";
|
||||
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||
$addButton[] = Indent::_(5) . "jQuery(document).ready(function() {";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {";
|
||||
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||
$addButton[] = Indent::_(6) . "});";
|
||||
$addButton[] = Indent::_(6)
|
||||
. "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();";
|
||||
$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)
|
||||
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
|
||||
$addButton[] = Indent::_(7) . "// hide the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Create').hide();";
|
||||
$addButton[] = Indent::_(7) . "// show edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Edit').show();";
|
||||
$addButton[] = Indent::_(7) . "var 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)
|
||||
. "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);";
|
||||
$addButton[] = Indent::_(6) . "} else {";
|
||||
$addButton[] = Indent::_(7) . "// show the create button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Create').show();";
|
||||
$addButton[] = Indent::_(7) . "// hide edit button";
|
||||
$addButton[] = Indent::_(7)
|
||||
. "jQuery('#\".\$button_code_name.\"Edit').hide();";
|
||||
$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::getDocument();";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||
. " return the button attached to input field.";
|
||||
$addButton[] = Indent::_(4)
|
||||
. "return '<div class=\"input-append\">' .\$html . implode('',\$button).'</div>';";
|
||||
$addButton[] = Indent::_(3) . "}";
|
||||
$addButton[] = Indent::_(2) . "}";
|
||||
$addButton[] = Indent::_(2) . "return \$html;";
|
||||
$addButton[] = Indent::_(1) . "}";
|
||||
|
||||
return implode(PHP_EOL, $addButton);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
49
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json
Normal file
49
src/2bc33733-e900-4a9c-8cb3-c537aa9db785/settings.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"add_head": "0",
|
||||
"add_licensing_template": "2",
|
||||
"extends": "0",
|
||||
"guid": "2bc33733-e900-4a9c-8cb3-c537aa9db785",
|
||||
"implements": [
|
||||
"c600f58c-3fe2-4d2d-b711-2660eab6effe"
|
||||
],
|
||||
"load_selection": null,
|
||||
"name": "InputButton",
|
||||
"power_version": "1.0.0",
|
||||
"system_name": "JCB.Compiler.Field.J3.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.JoomlaThree.InputButton",
|
||||
"description": "Compiler Field Input Button\r\n\r\n@since 3.2.0",
|
||||
"licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe <https:\/\/dev.vdm.io>\r\n * @git Joomla Component Builder <https:\/\/git.vdm.dev\/joomla\/Component-Builder>\r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n",
|
||||
"head": "",
|
||||
"composer": ""
|
||||
}
|
@ -14,6 +14,7 @@ class Builder #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
|
||||
@ -22,8 +23,11 @@ class Builder #Gold {
|
||||
+ 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
|
||||
@ -36,14 +40,17 @@ class Builder #Gold {
|
||||
+ 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
|
||||
@ -53,6 +60,7 @@ class Builder #Gold {
|
||||
+ getJsonItem(Container $container) : JsonItem
|
||||
+ getJsonItemArray(Container $container) : JsonItemArray
|
||||
+ getJsonString(Container $container) : JsonString
|
||||
+ getLanguageMessages(Container $container) : LanguageMessages
|
||||
+ getLayout(Container $container) : Layout
|
||||
+ getLayoutData(Container $container) : LayoutData
|
||||
+ getLibraryManager(Container $container) : LibraryManager
|
||||
@ -81,8 +89,10 @@ class Builder #Gold {
|
||||
+ getPermissionComponent(Container $container) : PermissionComponent
|
||||
+ getPermissionCore(Container $container) : PermissionCore
|
||||
+ getPermissionDashboard(Container $container) : PermissionDashboard
|
||||
+ getPermissionFields(Container $container) : PermissionFields
|
||||
+ getPermissionGlobalAction(Container $container) : PermissionGlobalAction
|
||||
+ getPermissionViews(Container $container) : PermissionViews
|
||||
+ getRequest(Container $container) : Request
|
||||
+ getScriptMediaSwitch(Container $container) : ScriptMediaSwitch
|
||||
+ getScriptUserSwitch(Container $container) : ScriptUserSwitch
|
||||
+ getSearch(Container $container) : Search
|
||||
@ -101,6 +111,7 @@ class Builder #Gold {
|
||||
+ getTitle(Container $container) : Title
|
||||
+ getUikitComp(Container $container) : UikitComp
|
||||
+ getUpdateMysql(Container $container) : UpdateMysql
|
||||
+ getViewsDefaultOrdering(Container $container) : ViewsDefaultOrdering
|
||||
}
|
||||
|
||||
note right of Builder::register
|
||||
@ -124,76 +135,104 @@ note right of Builder::getAccessSwitchList
|
||||
return: AccessSwitchList
|
||||
end note
|
||||
|
||||
note left of Builder::getAdminFilterType
|
||||
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 right of Builder::getAlias
|
||||
note left of Builder::getAlias
|
||||
Get The Alias Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Alias
|
||||
end note
|
||||
|
||||
note left of Builder::getBaseSixFour
|
||||
note right of Builder::getBaseSixFour
|
||||
Get The BaseSixFour Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: BaseSixFour
|
||||
end note
|
||||
|
||||
note right of Builder::getCategory
|
||||
note left of Builder::getCategory
|
||||
Get The Category Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Category
|
||||
end note
|
||||
|
||||
note left of Builder::getCategoryCode
|
||||
note right of Builder::getCategoryCode
|
||||
Get The CategoryCode Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: CategoryCode
|
||||
end note
|
||||
|
||||
note right of Builder::getCategoryOtherName
|
||||
note left of Builder::getCategoryOtherName
|
||||
Get The CategoryOtherName Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: CategoryOtherName
|
||||
end note
|
||||
|
||||
note left of Builder::getCheckBox
|
||||
note right of Builder::getCheckBox
|
||||
Get The CheckBox Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: CheckBox
|
||||
end note
|
||||
|
||||
note right of Builder::getComponentFields
|
||||
note left of Builder::getComponentFields
|
||||
Get The ComponentFields Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: ComponentFields
|
||||
end note
|
||||
|
||||
note left of Builder::getContentMulti
|
||||
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 right of Builder::getContentOne
|
||||
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.
|
||||
|
||||
@ -278,41 +317,55 @@ note right of Builder::getExtensionCustomFields
|
||||
return: ExtensionCustomFields
|
||||
end note
|
||||
|
||||
note left of Builder::getFieldGroupControl
|
||||
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 right of Builder::getFieldNames
|
||||
note left of Builder::getFieldNames
|
||||
Get The FieldNames Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: FieldNames
|
||||
end note
|
||||
|
||||
note left of Builder::getFieldRelations
|
||||
note right of Builder::getFieldRelations
|
||||
Get The FieldRelations Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: FieldRelations
|
||||
end note
|
||||
|
||||
note right of Builder::getFilter
|
||||
note left of Builder::getFilter
|
||||
Get The Filter Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Filter
|
||||
end note
|
||||
|
||||
note left of Builder::getFootableScripts
|
||||
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.
|
||||
|
||||
@ -334,69 +387,83 @@ note right of Builder::getGoogleChart
|
||||
return: GoogleChart
|
||||
end note
|
||||
|
||||
note left of Builder::getHasPermissions
|
||||
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 right of Builder::getHiddenFields
|
||||
note left of Builder::getHiddenFields
|
||||
Get The HiddenFields Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: HiddenFields
|
||||
end note
|
||||
|
||||
note left of Builder::getHistory
|
||||
note right of Builder::getHistory
|
||||
Get The History Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: History
|
||||
end note
|
||||
|
||||
note right of Builder::getIntegerFields
|
||||
note left of Builder::getIntegerFields
|
||||
Get The IntegerFields Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: IntegerFields
|
||||
end note
|
||||
|
||||
note left of Builder::getItemsMethodEximportString
|
||||
note right of Builder::getItemsMethodEximportString
|
||||
Get The ItemsMethodEximportString Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: ItemsMethodEximportString
|
||||
end note
|
||||
|
||||
note right of Builder::getItemsMethodListString
|
||||
note left of Builder::getItemsMethodListString
|
||||
Get The ItemsMethodListString Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: ItemsMethodListString
|
||||
end note
|
||||
|
||||
note left of Builder::getJsonItem
|
||||
note right of Builder::getJsonItem
|
||||
Get The JsonItem Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: JsonItem
|
||||
end note
|
||||
|
||||
note right of Builder::getJsonItemArray
|
||||
note left of Builder::getJsonItemArray
|
||||
Get The JsonItemArray Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: JsonItemArray
|
||||
end note
|
||||
|
||||
note left of Builder::getJsonString
|
||||
note right of Builder::getJsonString
|
||||
Get The JsonString Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: JsonString
|
||||
end note
|
||||
|
||||
note left of Builder::getLanguageMessages
|
||||
Get The LanguageMessages Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: LanguageMessages
|
||||
end note
|
||||
|
||||
note right of Builder::getLayout
|
||||
Get The Layout Class.
|
||||
|
||||
@ -593,20 +660,34 @@ note left of Builder::getPermissionDashboard
|
||||
return: PermissionDashboard
|
||||
end note
|
||||
|
||||
note right of Builder::getPermissionGlobalAction
|
||||
note right of Builder::getPermissionFields
|
||||
Get The PermissionFields Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: PermissionFields
|
||||
end note
|
||||
|
||||
note left of Builder::getPermissionGlobalAction
|
||||
Get The PermissionGlobalAction Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: PermissionGlobalAction
|
||||
end note
|
||||
|
||||
note left of Builder::getPermissionViews
|
||||
note right of Builder::getPermissionViews
|
||||
Get The PermissionViews Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: PermissionViews
|
||||
end note
|
||||
|
||||
note left of Builder::getRequest
|
||||
Get The Request Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: Request
|
||||
end note
|
||||
|
||||
note right of Builder::getScriptMediaSwitch
|
||||
Get The ScriptMediaSwitch Class.
|
||||
|
||||
@ -732,6 +813,13 @@ note left of Builder::getUpdateMysql
|
||||
since: 3.2.0
|
||||
return: UpdateMysql
|
||||
end note
|
||||
|
||||
note right of Builder::getViewsDefaultOrdering
|
||||
Get The ViewsDefaultOrdering Class.
|
||||
|
||||
since: 3.2.0
|
||||
return: ViewsDefaultOrdering
|
||||
end note
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user