From ebaeeeb4b3db4131cb78c860b1c2d43694ee0f1b Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 22 Mar 2023 00:52:57 +0200 Subject: [PATCH] first commit --- README.md | 2293 +++++++++++++++++ .../README.md | 134 + .../code.php | 930 +++++++ .../settings.json | 60 + .../README.md | 47 + .../code.php | 132 + .../settings.json | 33 + .../README.md | 113 + .../code.php | 393 +++ .../settings.json | 69 + .../README.md | 90 + .../code.php | 420 +++ .../settings.json | 58 + .../README.md | 68 + .../code.php | 324 +++ .../settings.json | 58 + .../README.md | 349 +++ .../code.php | 808 ++++++ .../settings.json | 175 ++ .../README.md | 217 ++ .../code.php | 508 ++++ .../settings.json | 35 + .../README.md | 82 + .../code.php | 884 +++++++ .../settings.json | 89 + .../README.md | 168 ++ .../code.php | 407 +++ .../settings.json | 29 + .../README.md | 83 + .../code.php | 185 ++ .../settings.json | 33 + .../README.md | 37 + .../code.php | 49 + .../settings.json | 25 + .../README.md | 45 + .../code.php | 43 + .../settings.json | 16 + .../README.md | 37 + .../code.php | 71 + .../settings.json | 25 + .../README.md | 68 + .../code.php | 150 ++ .../settings.json | 49 + .../README.md | 53 + .../code.php | 46 + .../settings.json | 16 + .../README.md | 77 + .../code.php | 252 ++ .../settings.json | 52 + .../README.md | 77 + .../code.php | 399 +++ .../settings.json | 44 + .../README.md | 45 + .../code.php | 80 + .../settings.json | 29 + .../README.md | 86 + .../code.php | 371 +++ .../settings.json | 39 + .../README.md | 21 + .../code.php | 26 + .../settings.json | 16 + .../README.md | 106 + .../code.php | 313 +++ .../settings.json | 50 + .../README.md | 37 + .../code.php | 33 + .../settings.json | 16 + .../README.md | 37 + .../code.php | 33 + .../settings.json | 16 + .../README.md | 45 + .../code.php | 55 + .../settings.json | 23 + .../README.md | 46 + .../code.php | 116 + .../settings.json | 24 + .../README.md | 53 + .../code.php | 89 + .../settings.json | 27 + .../README.md | 46 + .../code.php | 78 + .../settings.json | 29 + .../README.md | 48 + .../code.php | 116 + .../settings.json | 33 + .../README.md | 53 + .../code.php | 94 + .../settings.json | 27 + .../README.md | 101 + .../code.php | 92 + .../settings.json | 16 + .../README.md | 37 + .../code.php | 40 + .../settings.json | 18 + .../README.md | 45 + .../code.php | 55 + .../settings.json | 23 + .../README.md | 51 + .../code.php | 46 + .../settings.json | 16 + .../README.md | 89 + .../code.php | 90 + .../settings.json | 16 + .../README.md | 45 + .../code.php | 78 + .../settings.json | 23 + .../README.md | 37 + .../code.php | 32 + .../settings.json | 16 + .../README.md | 53 + .../code.php | 78 + .../settings.json | 27 + .../README.md | 122 + .../code.php | 635 +++++ .../settings.json | 56 + .../README.md | 113 + .../code.php | 425 +++ .../settings.json | 74 + .../README.md | 46 + .../code.php | 79 + .../settings.json | 29 + .../README.md | 65 + .../code.php | 59 + .../settings.json | 16 + .../README.md | 46 + .../code.php | 95 + .../settings.json | 33 + .../README.md | 59 + .../code.php | 236 ++ .../settings.json | 41 + .../README.md | 75 + .../code.php | 341 +++ .../settings.json | 90 + .../README.md | 37 + .../code.php | 34 + .../settings.json | 16 + .../README.md | 53 + .../code.php | 72 + .../settings.json | 27 + .../README.md | 56 + .../code.php | 152 ++ .../settings.json | 41 + .../README.md | 45 + .../code.php | 100 + .../settings.json | 24 + .../README.md | 54 + .../code.php | 79 + .../settings.json | 21 + .../README.md | 53 + .../code.php | 174 ++ .../settings.json | 45 + .../README.md | 69 + .../code.php | 106 + .../settings.json | 16 + .../README.md | 109 + .../code.php | 211 ++ .../settings.json | 59 + .../README.md | 37 + .../code.php | 52 + .../settings.json | 22 + .../README.md | 46 + .../code.php | 173 ++ .../settings.json | 49 + .../README.md | 47 + .../code.php | 151 ++ .../settings.json | 41 + .../README.md | 57 + .../code.php | 115 + .../settings.json | 41 + .../README.md | 70 + .../code.php | 281 ++ .../settings.json | 50 + .../README.md | 53 + .../code.php | 109 + .../settings.json | 34 + .../README.md | 46 + .../code.php | 110 + .../settings.json | 37 + .../README.md | 54 + .../code.php | 88 + .../settings.json | 27 + .../README.md | 209 ++ .../code.php | 756 ++++++ .../settings.json | 65 + .../README.md | 156 ++ .../code.php | 624 +++++ .../settings.json | 62 + .../README.md | 54 + .../code.php | 176 ++ .../settings.json | 34 + .../README.md | 60 + .../code.php | 118 + .../settings.json | 37 + .../README.md | 37 + .../code.php | 30 + .../settings.json | 16 + .../README.md | 52 + .../code.php | 126 + .../settings.json | 37 + .../README.md | 118 + .../code.php | 414 +++ .../settings.json | 45 + .../README.md | 102 + .../code.php | 204 ++ .../settings.json | 31 + .../README.md | 60 + .../code.php | 356 +++ .../settings.json | 58 + .../README.md | 81 + .../code.php | 881 +++++++ .../settings.json | 78 + .../README.md | 77 + .../code.php | 82 + .../settings.json | 16 + .../README.md | 66 + .../code.php | 582 +++++ .../settings.json | 57 + .../README.md | 45 + .../code.php | 110 + .../settings.json | 33 + .../README.md | 36 + .../code.php | 83 + .../settings.json | 16 + .../README.md | 45 + .../code.php | 86 + .../settings.json | 35 + .../README.md | 45 + .../code.php | 43 + .../settings.json | 16 + .../README.md | 45 + .../code.php | 42 + .../settings.json | 16 + .../README.md | 57 + .../code.php | 232 ++ .../settings.json | 36 + .../README.md | 61 + .../code.php | 114 + .../settings.json | 31 + .../README.md | 101 + .../code.php | 232 ++ .../settings.json | 51 + .../README.md | 70 + .../code.php | 71 + .../settings.json | 16 + .../README.md | 53 + .../code.php | 112 + .../settings.json | 29 + .../README.md | 100 + .../code.php | 202 ++ .../settings.json | 35 + .../README.md | 62 + .../code.php | 155 ++ .../settings.json | 30 + .../README.md | 58 + .../code.php | 234 ++ .../settings.json | 53 + .../README.md | 133 + .../code.php | 432 ++++ .../settings.json | 16 + .../README.md | 37 + .../code.php | 31 + .../settings.json | 16 + .../README.md | 50 + .../code.php | 102 + .../settings.json | 29 + .../README.md | 53 + .../code.php | 92 + .../settings.json | 27 + .../README.md | 53 + .../code.php | 78 + .../settings.json | 27 + .../README.md | 52 + .../code.php | 232 ++ .../settings.json | 29 + .../README.md | 37 + .../code.php | 32 + .../settings.json | 16 + .../README.md | 53 + .../code.php | 90 + .../settings.json | 21 + .../README.md | 208 ++ .../code.php | 240 ++ .../settings.json | 16 + .../README.md | 59 + .../code.php | 321 +++ .../settings.json | 38 + .../README.md | 101 + .../code.php | 208 ++ .../settings.json | 55 + .../README.md | 54 + .../code.php | 177 ++ .../settings.json | 49 + .../README.md | 74 + .../code.php | 625 +++++ .../settings.json | 89 + .../README.md | 58 + .../code.php | 57 + .../settings.json | 16 + .../README.md | 53 + .../code.php | 67 + .../settings.json | 24 + .../README.md | 45 + .../code.php | 76 + .../settings.json | 33 + .../README.md | 47 + .../code.php | 145 ++ .../settings.json | 48 + .../README.md | 37 + .../code.php | 72 + .../settings.json | 21 + .../README.md | 45 + .../code.php | 91 + .../settings.json | 25 + .../README.md | 121 + .../code.php | 355 +++ .../settings.json | 57 + .../README.md | 74 + .../code.php | 259 ++ .../settings.json | 37 + .../README.md | 226 ++ .../code.php | 997 +++++++ .../settings.json | 64 + .../README.md | 54 + .../code.php | 86 + .../settings.json | 27 + .../README.md | 37 + .../code.php | 32 + .../settings.json | 16 + .../README.md | 45 + .../code.php | 84 + .../settings.json | 33 + .../README.md | 48 + .../code.php | 139 + .../settings.json | 29 + .../README.md | 118 + .../code.php | 250 ++ .../settings.json | 59 + .../README.md | 56 + .../code.php | 168 ++ .../settings.json | 49 + .../README.md | 75 + .../code.php | 237 ++ .../settings.json | 49 + .../README.md | 45 + .../code.php | 42 + .../settings.json | 17 + .../README.md | 85 + .../code.php | 957 +++++++ .../settings.json | 82 + .../README.md | 41 + .../code.php | 61 + .../settings.json | 25 + .../README.md | 68 + .../code.php | 329 +++ .../settings.json | 62 + .../README.md | 52 + .../code.php | 184 ++ .../settings.json | 45 + .../README.md | 93 + .../code.php | 545 ++++ .../settings.json | 122 + .../README.md | 52 + .../code.php | 213 ++ .../settings.json | 38 + .../README.md | 55 + .../code.php | 247 ++ .../settings.json | 45 + .../README.md | 64 + .../code.php | 318 +++ .../settings.json | 78 + .../README.md | 46 + .../code.php | 97 + .../settings.json | 29 + .../README.md | 83 + .../code.php | 89 + .../settings.json | 16 + .../README.md | 60 + .../code.php | 142 + .../settings.json | 41 + .../README.md | 63 + .../code.php | 147 ++ .../settings.json | 112 + .../README.md | 101 + .../code.php | 209 ++ .../settings.json | 51 + .../README.md | 47 + .../code.php | 128 + .../settings.json | 29 + .../README.md | 46 + .../code.php | 109 + .../settings.json | 41 + .../README.md | 46 + .../code.php | 109 + .../settings.json | 41 + .../README.md | 43 + .../code.php | 60 + .../settings.json | 25 + .../README.md | 53 + .../code.php | 180 ++ .../settings.json | 37 + .../README.md | 46 + .../code.php | 101 + .../settings.json | 21 + .../README.md | 62 + .../code.php | 342 +++ .../settings.json | 66 + .../README.md | 98 + .../code.php | 403 +++ .../settings.json | 25 + .../README.md | 46 + .../code.php | 90 + .../settings.json | 29 + .../README.md | 61 + .../code.php | 90 + .../settings.json | 31 + .../README.md | 37 + .../code.php | 127 + .../settings.json | 37 + .../README.md | 54 + .../code.php | 158 ++ .../settings.json | 45 + .../README.md | 54 + .../code.php | 85 + .../settings.json | 27 + .../README.md | 67 + .../code.php | 62 + .../settings.json | 16 + .../README.md | 88 + .../code.php | 877 +++++++ .../settings.json | 118 + .../README.md | 45 + .../code.php | 84 + .../settings.json | 33 + .../README.md | 46 + .../code.php | 104 + .../settings.json | 29 + .../README.md | 44 + .../code.php | 93 + .../settings.json | 16 + .../README.md | 73 + .../code.php | 265 ++ .../settings.json | 54 + .../README.md | 87 + .../code.php | 284 ++ .../settings.json | 47 + .../README.md | 38 + .../code.php | 81 + .../settings.json | 25 + .../README.md | 498 ++++ .../code.php | 837 ++++++ .../settings.json | 30 + .../README.md | 56 + .../code.php | 242 ++ .../settings.json | 57 + .../README.md | 87 + .../code.php | 88 + .../settings.json | 16 + .../README.md | 151 ++ .../code.php | 462 ++++ .../settings.json | 16 + .../README.md | 53 + .../code.php | 83 + .../settings.json | 27 + super-powers.json | 1388 ++++++++++ 464 files changed, 53451 insertions(+) create mode 100644 README.md create mode 100644 src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md create mode 100644 src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php create mode 100644 src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/settings.json create mode 100644 src/037c7274-fb16-455d-989a-bf1da022620b/README.md create mode 100644 src/037c7274-fb16-455d-989a-bf1da022620b/code.php create mode 100644 src/037c7274-fb16-455d-989a-bf1da022620b/settings.json create mode 100644 src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md create mode 100644 src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php create mode 100644 src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json create mode 100644 src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md create mode 100644 src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php create mode 100644 src/053803e6-1251-4aed-aefe-46a8e84198d2/settings.json create mode 100644 src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md create mode 100644 src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php create mode 100644 src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/settings.json create mode 100644 src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md create mode 100644 src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php create mode 100644 src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json create mode 100644 src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/README.md create mode 100644 src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/code.php create mode 100644 src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/settings.json create mode 100644 src/071c7cff-4c88-4b80-bd99-066c572dcb71/README.md create mode 100644 src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php create mode 100644 src/071c7cff-4c88-4b80-bd99-066c572dcb71/settings.json create mode 100644 src/0d08c583-04d5-454e-b756-48ca05e1651a/README.md create mode 100644 src/0d08c583-04d5-454e-b756-48ca05e1651a/code.php create mode 100644 src/0d08c583-04d5-454e-b756-48ca05e1651a/settings.json create mode 100644 src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/README.md create mode 100644 src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/code.php create mode 100644 src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/settings.json create mode 100644 src/0dabc67c-abec-4541-82bf-279abd3c9be1/README.md create mode 100644 src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php create mode 100644 src/0dabc67c-abec-4541-82bf-279abd3c9be1/settings.json create mode 100644 src/1133c2d7-ba7e-4c95-8cde-01f084d04682/README.md create mode 100644 src/1133c2d7-ba7e-4c95-8cde-01f084d04682/code.php create mode 100644 src/1133c2d7-ba7e-4c95-8cde-01f084d04682/settings.json create mode 100644 src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/README.md create mode 100644 src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/code.php create mode 100644 src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/settings.json create mode 100644 src/17a728e9-d6cf-4060-9efb-241b0ff2f981/README.md create mode 100644 src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php create mode 100644 src/17a728e9-d6cf-4060-9efb-241b0ff2f981/settings.json create mode 100644 src/1aefb8f5-486f-4f00-adf9-696340b3254e/README.md create mode 100644 src/1aefb8f5-486f-4f00-adf9-696340b3254e/code.php create mode 100644 src/1aefb8f5-486f-4f00-adf9-696340b3254e/settings.json create mode 100644 src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md create mode 100644 src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php create mode 100644 src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/settings.json create mode 100644 src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md create mode 100644 src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php create mode 100644 src/1cef0266-99e2-40d8-919f-c2ce32226b0a/settings.json create mode 100644 src/1d0fd857-12ec-4f47-ab1c-124d85748e24/README.md create mode 100644 src/1d0fd857-12ec-4f47-ab1c-124d85748e24/code.php create mode 100644 src/1d0fd857-12ec-4f47-ab1c-124d85748e24/settings.json create mode 100644 src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md create mode 100644 src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php create mode 100644 src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json create mode 100644 src/1d967151-7c20-4ca7-9400-65233cdcd4db/README.md create mode 100644 src/1d967151-7c20-4ca7-9400-65233cdcd4db/code.php create mode 100644 src/1d967151-7c20-4ca7-9400-65233cdcd4db/settings.json create mode 100644 src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md create mode 100644 src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php create mode 100644 src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json create mode 100644 src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/README.md create mode 100644 src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/code.php create mode 100644 src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/settings.json create mode 100644 src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md create mode 100644 src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php create mode 100644 src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/settings.json create mode 100644 src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md create mode 100644 src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php create mode 100644 src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json create mode 100644 src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md create mode 100644 src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php create mode 100644 src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json create mode 100644 src/253317c7-3c3b-48a0-aec8-8af5e7a86504/README.md create mode 100644 src/253317c7-3c3b-48a0-aec8-8af5e7a86504/code.php create mode 100644 src/253317c7-3c3b-48a0-aec8-8af5e7a86504/settings.json create mode 100644 src/268b85ef-49f3-4c39-8187-bb12e38d19ee/README.md create mode 100644 src/268b85ef-49f3-4c39-8187-bb12e38d19ee/code.php create mode 100644 src/268b85ef-49f3-4c39-8187-bb12e38d19ee/settings.json create mode 100644 src/29455d3b-df2b-4e41-8684-1608060e37a4/README.md create mode 100644 src/29455d3b-df2b-4e41-8684-1608060e37a4/code.php create mode 100644 src/29455d3b-df2b-4e41-8684-1608060e37a4/settings.json create mode 100644 src/295186de-5954-4a65-a4c1-2f79ef305743/README.md create mode 100644 src/295186de-5954-4a65-a4c1-2f79ef305743/code.php create mode 100644 src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json create mode 100644 src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md create mode 100644 src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php create mode 100644 src/2ad31f74-f579-499d-b98b-c4f54fd615dd/settings.json create mode 100644 src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/README.md create mode 100644 src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/code.php create mode 100644 src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/settings.json create mode 100644 src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md create mode 100644 src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php create mode 100644 src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json create mode 100644 src/2cc8517d-1105-4697-9743-048b4b7c089c/README.md create mode 100644 src/2cc8517d-1105-4697-9743-048b4b7c089c/code.php create mode 100644 src/2cc8517d-1105-4697-9743-048b4b7c089c/settings.json create mode 100644 src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/README.md create mode 100644 src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/code.php create mode 100644 src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/settings.json create mode 100644 src/2dd1289a-4000-43cc-8c62-77ff32de56bf/README.md create mode 100644 src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.php create mode 100644 src/2dd1289a-4000-43cc-8c62-77ff32de56bf/settings.json create mode 100644 src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/README.md create mode 100644 src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/code.php create mode 100644 src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/settings.json create mode 100644 src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/README.md create mode 100644 src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/code.php create mode 100644 src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/settings.json create mode 100644 src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md create mode 100644 src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php create mode 100644 src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json create mode 100644 src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md create mode 100644 src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php create mode 100644 src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json create mode 100644 src/3283a89c-329a-47fb-a011-0df6c31a5c73/README.md create mode 100644 src/3283a89c-329a-47fb-a011-0df6c31a5c73/code.php create mode 100644 src/3283a89c-329a-47fb-a011-0df6c31a5c73/settings.json create mode 100644 src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/README.md create mode 100644 src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/code.php create mode 100644 src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/settings.json create mode 100644 src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/README.md create mode 100644 src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/code.php create mode 100644 src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/settings.json create mode 100644 src/39ea8150-f124-4e47-909d-641bf1c96d5e/README.md create mode 100644 src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php create mode 100644 src/39ea8150-f124-4e47-909d-641bf1c96d5e/settings.json create mode 100644 src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md create mode 100644 src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php create mode 100644 src/3b6895da-d9eb-4164-90b1-4632a4cc2474/settings.json create mode 100644 src/4325745f-da1f-4d4d-a591-3189fe8c06e5/README.md create mode 100644 src/4325745f-da1f-4d4d-a591-3189fe8c06e5/code.php create mode 100644 src/4325745f-da1f-4d4d-a591-3189fe8c06e5/settings.json create mode 100644 src/4815e1c7-a433-443d-a112-d1e03d7df84b/README.md create mode 100644 src/4815e1c7-a433-443d-a112-d1e03d7df84b/code.php create mode 100644 src/4815e1c7-a433-443d-a112-d1e03d7df84b/settings.json create mode 100644 src/489da602-27c7-418c-bf59-1d45ad42bdcc/README.md create mode 100644 src/489da602-27c7-418c-bf59-1d45ad42bdcc/code.php create mode 100644 src/489da602-27c7-418c-bf59-1d45ad42bdcc/settings.json create mode 100644 src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md create mode 100644 src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php create mode 100644 src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json create mode 100644 src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/README.md create mode 100644 src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/code.php create mode 100644 src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/settings.json create mode 100644 src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/README.md create mode 100644 src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/code.php create mode 100644 src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/settings.json create mode 100644 src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/README.md create mode 100644 src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/code.php create mode 100644 src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/settings.json create mode 100644 src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md create mode 100644 src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php create mode 100644 src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json create mode 100644 src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/README.md create mode 100644 src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/code.php create mode 100644 src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/settings.json create mode 100644 src/55e61314-ba10-4e2b-92dd-b44adebabce9/README.md create mode 100644 src/55e61314-ba10-4e2b-92dd-b44adebabce9/code.php create mode 100644 src/55e61314-ba10-4e2b-92dd-b44adebabce9/settings.json create mode 100644 src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/README.md create mode 100644 src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/code.php create mode 100644 src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/settings.json create mode 100644 src/59895f37-50c8-4af3-9dad-230e18841953/README.md create mode 100644 src/59895f37-50c8-4af3-9dad-230e18841953/code.php create mode 100644 src/59895f37-50c8-4af3-9dad-230e18841953/settings.json create mode 100644 src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md create mode 100644 src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php create mode 100644 src/5b021139-dad0-4e9b-882a-2b4d807795af/settings.json create mode 100644 src/5c75b455-3d4c-452a-867e-e90424a64c88/README.md create mode 100644 src/5c75b455-3d4c-452a-867e-e90424a64c88/code.php create mode 100644 src/5c75b455-3d4c-452a-867e-e90424a64c88/settings.json create mode 100644 src/5f8e8fa6-3793-44af-882d-9cfb209434e9/README.md create mode 100644 src/5f8e8fa6-3793-44af-882d-9cfb209434e9/code.php create mode 100644 src/5f8e8fa6-3793-44af-882d-9cfb209434e9/settings.json create mode 100644 src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md create mode 100644 src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php create mode 100644 src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json create mode 100644 src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md create mode 100644 src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php create mode 100644 src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json create mode 100644 src/673954d3-78d3-445a-b99f-4b40d617c882/README.md create mode 100644 src/673954d3-78d3-445a-b99f-4b40d617c882/code.php create mode 100644 src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json create mode 100644 src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/README.md create mode 100644 src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/code.php create mode 100644 src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/settings.json create mode 100644 src/6c89c663-78f5-4078-9fac-7047f2eaaf96/README.md create mode 100644 src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php create mode 100644 src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json create mode 100644 src/6da2afa5-6087-46dd-80a0-74c6434bcb18/README.md create mode 100644 src/6da2afa5-6087-46dd-80a0-74c6434bcb18/code.php create mode 100644 src/6da2afa5-6087-46dd-80a0-74c6434bcb18/settings.json create mode 100644 src/6dfbf568-f3cd-4ea7-af04-6859447b5462/README.md create mode 100644 src/6dfbf568-f3cd-4ea7-af04-6859447b5462/code.php create mode 100644 src/6dfbf568-f3cd-4ea7-af04-6859447b5462/settings.json create mode 100644 src/6e64917c-d687-4ef3-a655-811319f5a81e/README.md create mode 100644 src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php create mode 100644 src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json create mode 100644 src/6f20369a-8536-4870-a1a3-cda254c939c8/README.md create mode 100644 src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php create mode 100644 src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json create mode 100644 src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md create mode 100644 src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php create mode 100644 src/7175c1cd-2071-4cd7-b499-23881e168c3f/settings.json create mode 100644 src/766a9524-37df-4604-91a7-b98a6150ee26/README.md create mode 100644 src/766a9524-37df-4604-91a7-b98a6150ee26/code.php create mode 100644 src/766a9524-37df-4604-91a7-b98a6150ee26/settings.json create mode 100644 src/78527c29-24ad-4735-ad4c-ec33a4952d9b/README.md create mode 100644 src/78527c29-24ad-4735-ad4c-ec33a4952d9b/code.php create mode 100644 src/78527c29-24ad-4735-ad4c-ec33a4952d9b/settings.json create mode 100644 src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/README.md create mode 100644 src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/code.php create mode 100644 src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/settings.json create mode 100644 src/797579e8-b272-41ed-91de-428cb0b3e089/README.md create mode 100644 src/797579e8-b272-41ed-91de-428cb0b3e089/code.php create mode 100644 src/797579e8-b272-41ed-91de-428cb0b3e089/settings.json create mode 100644 src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/README.md create mode 100644 src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/code.php create mode 100644 src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/settings.json create mode 100644 src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/README.md create mode 100644 src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/code.php create mode 100644 src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/settings.json create mode 100644 src/81de8f57-dd9c-4a17-964f-848cd4a0743b/README.md create mode 100644 src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php create mode 100644 src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json create mode 100644 src/86ac0760-26f5-4746-9c7f-ce77860f80f8/README.md create mode 100644 src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php create mode 100644 src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json create mode 100644 src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md create mode 100644 src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php create mode 100644 src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json create mode 100644 src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/README.md create mode 100644 src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/code.php create mode 100644 src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/settings.json create mode 100644 src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md create mode 100644 src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php create mode 100644 src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json create mode 100644 src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md create mode 100644 src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php create mode 100644 src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/settings.json create mode 100644 src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/README.md create mode 100644 src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/code.php create mode 100644 src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/settings.json create mode 100644 src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md create mode 100644 src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php create mode 100644 src/8eee7df5-2775-41a9-9372-c46c5939a252/settings.json create mode 100644 src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/README.md create mode 100644 src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/code.php create mode 100644 src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/settings.json create mode 100644 src/9387215f-a965-4421-acf3-5e8f9d11382f/README.md create mode 100644 src/9387215f-a965-4421-acf3-5e8f9d11382f/code.php create mode 100644 src/9387215f-a965-4421-acf3-5e8f9d11382f/settings.json create mode 100644 src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/README.md create mode 100644 src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php create mode 100644 src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json create mode 100644 src/97698747-c2ce-4e09-a470-acf6d8e86281/README.md create mode 100644 src/97698747-c2ce-4e09-a470-acf6d8e86281/code.php create mode 100644 src/97698747-c2ce-4e09-a470-acf6d8e86281/settings.json create mode 100644 src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/README.md create mode 100644 src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/code.php create mode 100644 src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/settings.json create mode 100644 src/9eba241c-af90-42dd-ae05-92ff4d8391d3/README.md create mode 100644 src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php create mode 100644 src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json create mode 100644 src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/README.md create mode 100644 src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php create mode 100644 src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json create mode 100644 src/a356d103-74f3-49ca-8e4f-3bd37746f089/README.md create mode 100644 src/a356d103-74f3-49ca-8e4f-3bd37746f089/code.php create mode 100644 src/a356d103-74f3-49ca-8e4f-3bd37746f089/settings.json create mode 100644 src/a3c515f5-4adf-4eb3-b637-0a1add550da6/README.md create mode 100644 src/a3c515f5-4adf-4eb3-b637-0a1add550da6/code.php create mode 100644 src/a3c515f5-4adf-4eb3-b637-0a1add550da6/settings.json create mode 100644 src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/README.md create mode 100644 src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/code.php create mode 100644 src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/settings.json create mode 100644 src/a6cdd935-c038-4a54-8446-54bed87f003c/README.md create mode 100644 src/a6cdd935-c038-4a54-8446-54bed87f003c/code.php create mode 100644 src/a6cdd935-c038-4a54-8446-54bed87f003c/settings.json create mode 100644 src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md create mode 100644 src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php create mode 100644 src/a6e1227c-1efe-407d-84ef-03c6989a6a88/settings.json create mode 100644 src/a74ac3b7-bb79-4639-8f14-54a8021be68b/README.md create mode 100644 src/a74ac3b7-bb79-4639-8f14-54a8021be68b/code.php create mode 100644 src/a74ac3b7-bb79-4639-8f14-54a8021be68b/settings.json create mode 100644 src/a8eb2fb1-88ed-4af8-842d-898eb915b588/README.md create mode 100644 src/a8eb2fb1-88ed-4af8-842d-898eb915b588/code.php create mode 100644 src/a8eb2fb1-88ed-4af8-842d-898eb915b588/settings.json create mode 100644 src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md create mode 100644 src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php create mode 100644 src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/settings.json create mode 100644 src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/README.md create mode 100644 src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/code.php create mode 100644 src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/settings.json create mode 100644 src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/README.md create mode 100644 src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/code.php create mode 100644 src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/settings.json create mode 100644 src/ae1fa148-91be-4f80-89a9-69d91ba9d575/README.md create mode 100644 src/ae1fa148-91be-4f80-89a9-69d91ba9d575/code.php create mode 100644 src/ae1fa148-91be-4f80-89a9-69d91ba9d575/settings.json create mode 100644 src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md create mode 100644 src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php create mode 100644 src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json create mode 100644 src/af5beb21-214a-44f6-9090-7ea24c22e649/README.md create mode 100644 src/af5beb21-214a-44f6-9090-7ea24c22e649/code.php create mode 100644 src/af5beb21-214a-44f6-9090-7ea24c22e649/settings.json create mode 100644 src/b591855d-d106-4fe5-90ad-8e706f6267cf/README.md create mode 100644 src/b591855d-d106-4fe5-90ad-8e706f6267cf/code.php create mode 100644 src/b591855d-d106-4fe5-90ad-8e706f6267cf/settings.json create mode 100644 src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/README.md create mode 100644 src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php create mode 100644 src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json create mode 100644 src/b80296eb-4718-4ed3-894d-69f3ac293733/README.md create mode 100644 src/b80296eb-4718-4ed3-894d-69f3ac293733/code.php create mode 100644 src/b80296eb-4718-4ed3-894d-69f3ac293733/settings.json create mode 100644 src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md create mode 100644 src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php create mode 100644 src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/settings.json create mode 100644 src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md create mode 100644 src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php create mode 100644 src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json create mode 100644 src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md create mode 100644 src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php create mode 100644 src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json create mode 100644 src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/README.md create mode 100644 src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/code.php create mode 100644 src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/settings.json create mode 100644 src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/README.md create mode 100644 src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/code.php create mode 100644 src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/settings.json create mode 100644 src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md create mode 100644 src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php create mode 100644 src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json create mode 100644 src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/README.md create mode 100644 src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php create mode 100644 src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json create mode 100644 src/ca111518-e47c-4049-b1b2-cb010f23866f/README.md create mode 100644 src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php create mode 100644 src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json create mode 100644 src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md create mode 100644 src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php create mode 100644 src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json create mode 100644 src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md create mode 100644 src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php create mode 100644 src/cb11e8d9-69c2-4095-831c-59908ea402e7/settings.json create mode 100644 src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/README.md create mode 100644 src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php create mode 100644 src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json create mode 100644 src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md create mode 100644 src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php create mode 100644 src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json create mode 100644 src/cebdcccb-24c5-46db-92de-63453852dcb8/README.md create mode 100644 src/cebdcccb-24c5-46db-92de-63453852dcb8/code.php create mode 100644 src/cebdcccb-24c5-46db-92de-63453852dcb8/settings.json create mode 100644 src/cef2815b-f72b-402a-b769-f028f676692d/README.md create mode 100644 src/cef2815b-f72b-402a-b769-f028f676692d/code.php create mode 100644 src/cef2815b-f72b-402a-b769-f028f676692d/settings.json create mode 100644 src/cfe62a32-8818-4bfb-8751-2f1e109b5336/README.md create mode 100644 src/cfe62a32-8818-4bfb-8751-2f1e109b5336/code.php create mode 100644 src/cfe62a32-8818-4bfb-8751-2f1e109b5336/settings.json create mode 100644 src/d33b9278-c409-4aec-a047-b72f56712391/README.md create mode 100644 src/d33b9278-c409-4aec-a047-b72f56712391/code.php create mode 100644 src/d33b9278-c409-4aec-a047-b72f56712391/settings.json create mode 100644 src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/README.md create mode 100644 src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/code.php create mode 100644 src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/settings.json create mode 100644 src/d4b418a7-bf9b-4768-969d-e07c36916fd2/README.md create mode 100644 src/d4b418a7-bf9b-4768-969d-e07c36916fd2/code.php create mode 100644 src/d4b418a7-bf9b-4768-969d-e07c36916fd2/settings.json create mode 100644 src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/README.md create mode 100644 src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/code.php create mode 100644 src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/settings.json create mode 100644 src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/README.md create mode 100644 src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php create mode 100644 src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json create mode 100644 src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/README.md create mode 100644 src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php create mode 100644 src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json create mode 100644 src/de01527a-6586-46ea-92e7-11ea3de1cedb/README.md create mode 100644 src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php create mode 100644 src/de01527a-6586-46ea-92e7-11ea3de1cedb/settings.json create mode 100644 src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/README.md create mode 100644 src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/code.php create mode 100644 src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/settings.json create mode 100644 src/e0075978-315d-4807-8507-ce9c6922a885/README.md create mode 100644 src/e0075978-315d-4807-8507-ce9c6922a885/code.php create mode 100644 src/e0075978-315d-4807-8507-ce9c6922a885/settings.json create mode 100644 src/e0e24173-a808-4dd5-8e26-de971d014f86/README.md create mode 100644 src/e0e24173-a808-4dd5-8e26-de971d014f86/code.php create mode 100644 src/e0e24173-a808-4dd5-8e26-de971d014f86/settings.json create mode 100644 src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/README.md create mode 100644 src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php create mode 100644 src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json create mode 100644 src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/README.md create mode 100644 src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/code.php create mode 100644 src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/settings.json create mode 100644 src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/README.md create mode 100644 src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/code.php create mode 100644 src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/settings.json create mode 100644 src/e6a64c41-405e-4bbc-9722-27402c22bbea/README.md create mode 100644 src/e6a64c41-405e-4bbc-9722-27402c22bbea/code.php create mode 100644 src/e6a64c41-405e-4bbc-9722-27402c22bbea/settings.json create mode 100644 src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/README.md create mode 100644 src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/code.php create mode 100644 src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/settings.json create mode 100644 src/e79842d3-51b7-4282-93c7-3487cd8b61ab/README.md create mode 100644 src/e79842d3-51b7-4282-93c7-3487cd8b61ab/code.php create mode 100644 src/e79842d3-51b7-4282-93c7-3487cd8b61ab/settings.json create mode 100644 src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/README.md create mode 100644 src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/code.php create mode 100644 src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/settings.json create mode 100644 src/eb33420d-359d-44a5-852e-613aef1feaae/README.md create mode 100644 src/eb33420d-359d-44a5-852e-613aef1feaae/code.php create mode 100644 src/eb33420d-359d-44a5-852e-613aef1feaae/settings.json create mode 100644 src/ebe3287d-bfa0-4519-b663-f442f4dea432/README.md create mode 100644 src/ebe3287d-bfa0-4519-b663-f442f4dea432/code.php create mode 100644 src/ebe3287d-bfa0-4519-b663-f442f4dea432/settings.json create mode 100644 src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md create mode 100644 src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php create mode 100644 src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json create mode 100644 src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/README.md create mode 100644 src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/code.php create mode 100644 src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/settings.json create mode 100644 src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md create mode 100644 src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php create mode 100644 src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json create mode 100644 src/ef97b03e-1018-447a-8d7e-30401b0257bb/README.md create mode 100644 src/ef97b03e-1018-447a-8d7e-30401b0257bb/code.php create mode 100644 src/ef97b03e-1018-447a-8d7e-30401b0257bb/settings.json create mode 100644 src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/README.md create mode 100644 src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/code.php create mode 100644 src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/settings.json create mode 100644 src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/README.md create mode 100644 src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/code.php create mode 100644 src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/settings.json create mode 100644 src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md create mode 100644 src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php create mode 100644 src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/settings.json create mode 100644 src/f1dc6430-fb54-452e-aa53-ce32ae93db88/README.md create mode 100644 src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php create mode 100644 src/f1dc6430-fb54-452e-aa53-ce32ae93db88/settings.json create mode 100644 src/f4578c04-a81e-4218-b80d-b0612196eaf0/README.md create mode 100644 src/f4578c04-a81e-4218-b80d-b0612196eaf0/code.php create mode 100644 src/f4578c04-a81e-4218-b80d-b0612196eaf0/settings.json create mode 100644 src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md create mode 100644 src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php create mode 100644 src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json create mode 100644 src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md create mode 100644 src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php create mode 100644 src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json create mode 100644 src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/README.md create mode 100644 src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/code.php create mode 100644 src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/settings.json create mode 100644 src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/README.md create mode 100644 src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php create mode 100644 src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json create mode 100644 src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/README.md create mode 100644 src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/code.php create mode 100644 src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/settings.json create mode 100644 super-powers.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1d6920 --- /dev/null +++ b/README.md @@ -0,0 +1,2293 @@ +``` +███████╗██╗ ██╗██████╗ ███████╗██████╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗ +███████║╚██████╔╝██║ ███████╗██║ ██║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ ███████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗██╔════╝ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝███████╗ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗╚════██║ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║███████║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝╚══════╝ +``` + +### What is JCB Super Powers? +The Joomla Component Builder (JCB) Super Power features are designed to enhance JCB's functionality and streamline the development process. These Super Powers enable developers to efficiently manage and share their custom powers across multiple JCB instances through repositories hosted on [https://git.vdm.dev/[username]/[repository-name]](https://git.vdm.dev). JCB Super Powers are managed using a combination of layers, events, tasks, methods, switches, and algorithms, which work together to provide powerful customization and extensibility options. More details on JCB Super Powers can be found in the [Super Powers Documentation](https://git.vdm.dev/joomla/super-powers/wiki). + +In summary, JCB Super Powers offer a flexible and efficient way to manage and share functionalities between JCB instances. By utilizing a sophisticated system of layers, events, tasks, methods, switches, and algorithms, developers can seamlessly integrate JCB core powers and their custom powers. For more information on how to work with JCB Super Powers, refer to the [Super Powers User Guide](https://git.vdm.dev/joomla/super-powers/wiki). + +### What can I find here? +This repository contains an index (see below) of all the approved powers within the JCB GUI. During the compilation of a component, these powers are automatically added to the repository, ensuring a well-organized and accessible collection of functionalities. + +# Index of powers + +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler](#vdm-joomla-componentbuilder-compiler) + + - **abstract class Factory** | [Details](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac) | [Code](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php) | [Settings](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json) | [d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac) + - **class Component** | [Details](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0) | [Code](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php) | [Settings](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json) | [e2472b22-a329-44d8-b4a2-ae3ba99e17a0](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0) + - **class Config** | [Details](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc) | [Code](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php) | [Settings](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json) | [fa4bf18e-301e-42e3-91fb-6e0096c07adc](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc) + - **class Content** | [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) | [adfbe68a-6d22-43e5-aee8-2787e8c47e75](src/adfbe68a-6d22-43e5-aee8-2787e8c47e75) + - **class Customcode** | [Details](src/313b43c4-98c3-4f62-9177-2d73ec8eba31) | [Code](src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php) | [Settings](src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json) | [313b43c4-98c3-4f62-9177-2d73ec8eba31](src/313b43c4-98c3-4f62-9177-2d73ec8eba31) + - **class Field** | [Details](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75) | [Code](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php) | [Settings](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json) | [d7ba2d5d-10b6-470d-978d-9f91ea65ee75](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75) + - **class Language** | [Details](src/8eee7df5-2775-41a9-9372-c46c5939a252) | [Code](src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php) | [Settings](src/8eee7df5-2775-41a9-9372-c46c5939a252/settings.json) | [8eee7df5-2775-41a9-9372-c46c5939a252](src/8eee7df5-2775-41a9-9372-c46c5939a252) + - **class Placeholder** | [Details](src/06453ada-e370-49f0-b262-e3f5a8ed0c2c) | [Code](src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/code.php) | [Settings](src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/settings.json) | [06453ada-e370-49f0-b262-e3f5a8ed0c2c](src/06453ada-e370-49f0-b262-e3f5a8ed0c2c) + - **class Power** | [Details](src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1) | [Code](src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php) | [Settings](src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/settings.json) | [b836c1b1-b6b1-44f7-b8a2-9a763a4185b1](src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1) + - **class Registry** | [Details](src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6) | [Code](src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/code.php) | [Settings](src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/settings.json) | [e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6](src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6) +- **Namespace**: [VDM\Joomla\Componentbuilder\Interfaces](#vdm-joomla-componentbuilder-interfaces) + + - **interface Cryptinterface** | [Details](src/81de8f57-dd9c-4a17-964f-848cd4a0743b) | [Code](src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php) | [Settings](src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json) | [81de8f57-dd9c-4a17-964f-848cd4a0743b](src/81de8f57-dd9c-4a17-964f-848cd4a0743b) + - **interface FactoryInterface** | [Details](src/caf33c5d-858c-4f9a-894f-ab302ec5445a) | [Code](src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php) | [Settings](src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json) | [caf33c5d-858c-4f9a-894f-ab302ec5445a](src/caf33c5d-858c-4f9a-894f-ab302ec5445a) + - **interface InsertInterface** | [Details](src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48) | [Code](src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/code.php) | [Settings](src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/settings.json) | [ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48](src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48) + - **interface LoadInterface** | [Details](src/2ad31f74-f579-499d-b98b-c4f54fd615dd) | [Code](src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php) | [Settings](src/2ad31f74-f579-499d-b98b-c4f54fd615dd/settings.json) | [2ad31f74-f579-499d-b98b-c4f54fd615dd](src/2ad31f74-f579-499d-b98b-c4f54fd615dd) + - **interface Mapperdoubleinterface** | [Details](src/fbc58009-fa16-4d49-a0dd-419c3b62d42f) | [Code](src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/code.php) | [Settings](src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/settings.json) | [fbc58009-fa16-4d49-a0dd-419c3b62d42f](src/fbc58009-fa16-4d49-a0dd-419c3b62d42f) + - **interface Mappersingleinterface** | [Details](src/78527c29-24ad-4735-ad4c-ec33a4952d9b) | [Code](src/78527c29-24ad-4735-ad4c-ec33a4952d9b/code.php) | [Settings](src/78527c29-24ad-4735-ad4c-ec33a4952d9b/settings.json) | [78527c29-24ad-4735-ad4c-ec33a4952d9b](src/78527c29-24ad-4735-ad4c-ec33a4952d9b) + - **interface ModelInterface** | [Details](src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff) | [Code](src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php) | [Settings](src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/settings.json) | [8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff](src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff) + - **interface Serverinterface** | [Details](src/86ac0760-26f5-4746-9c7f-ce77860f80f8) | [Code](src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php) | [Settings](src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json) | [86ac0760-26f5-4746-9c7f-ce77860f80f8](src/86ac0760-26f5-4746-9c7f-ce77860f80f8) + - **interface Tableinterface** | [Details](src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf) | [Code](src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/code.php) | [Settings](src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/settings.json) | [2da6d6c4-eb29-4d69-8bc2-36d96e916adf](src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Adminview](#vdm-joomla-componentbuilder-compiler-adminview) + + - **class Data** | [Details](src/cef2815b-f72b-402a-b769-f028f676692d) | [Code](src/cef2815b-f72b-402a-b769-f028f676692d/code.php) | [Settings](src/cef2815b-f72b-402a-b769-f028f676692d/settings.json) | [cef2815b-f72b-402a-b769-f028f676692d](src/cef2815b-f72b-402a-b769-f028f676692d) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Alias](#vdm-joomla-componentbuilder-compiler-alias) + + - **class Data** | [Details](src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c) | [Code](src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php) | [Settings](src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/settings.json) | [f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c](src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Component](#vdm-joomla-componentbuilder-compiler-component) + + - **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) | [cfe62a32-8818-4bfb-8751-2f1e109b5336](src/cfe62a32-8818-4bfb-8751-2f1e109b5336) + - **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) | [ef9578e5-4c9d-46bf-866f-3a94bdc7b753](src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753) + - **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) | [aecc17ba-0b0f-4e5c-ae43-71be063a3dcb](src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb) + - **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) | [63dabe82-0f4a-4ade-9851-8518ade23de2](src/63dabe82-0f4a-4ade-9851-8518ade23de2) + - **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) | [6c89c663-78f5-4078-9fac-7047f2eaaf96](src/6c89c663-78f5-4078-9fac-7047f2eaaf96) + - **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) | [b69a23db-0a62-4840-a9c5-b2d8d63ecc6c](src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c) + - **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) | [673954d3-78d3-445a-b99f-4b40d617c882](src/673954d3-78d3-445a-b99f-4b40d617c882) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Customcode](#vdm-joomla-componentbuilder-compiler-customcode) + + - **class Dispenser** | [Details](src/f1dc6430-fb54-452e-aa53-ce32ae93db88) | [Code](src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php) | [Settings](src/f1dc6430-fb54-452e-aa53-ce32ae93db88/settings.json) | [f1dc6430-fb54-452e-aa53-ce32ae93db88](src/f1dc6430-fb54-452e-aa53-ce32ae93db88) + - **class External** | [Details](src/1cef0266-99e2-40d8-919f-c2ce32226b0a) | [Code](src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php) | [Settings](src/1cef0266-99e2-40d8-919f-c2ce32226b0a/settings.json) | [1cef0266-99e2-40d8-919f-c2ce32226b0a](src/1cef0266-99e2-40d8-919f-c2ce32226b0a) + - **class Extractor** | [Details](src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1) | [Code](src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php) | [Settings](src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/settings.json) | [01411bb1-fdd6-4cca-84d7-1b62d93c70c1](src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1) + - **class Gui** | [Details](src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3) | [Code](src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php) | [Settings](src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/settings.json) | [1bd48df2-4f7e-4581-9fe9-4b54e59105e3](src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3) + - **class Hash** | [Details](src/797579e8-b272-41ed-91de-428cb0b3e089) | [Code](src/797579e8-b272-41ed-91de-428cb0b3e089/code.php) | [Settings](src/797579e8-b272-41ed-91de-428cb0b3e089/settings.json) | [797579e8-b272-41ed-91de-428cb0b3e089](src/797579e8-b272-41ed-91de-428cb0b3e089) + - **class LockBase** | [Details](src/7c07c9d6-34cd-4491-934a-ef0a83f414c0) | [Code](src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/code.php) | [Settings](src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/settings.json) | [7c07c9d6-34cd-4491-934a-ef0a83f414c0](src/7c07c9d6-34cd-4491-934a-ef0a83f414c0) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Customview](#vdm-joomla-componentbuilder-compiler-customview) + + - **class Data** | [Details](src/3b6895da-d9eb-4164-90b1-4632a4cc2474) | [Code](src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php) | [Settings](src/3b6895da-d9eb-4164-90b1-4632a4cc2474/settings.json) | [3b6895da-d9eb-4164-90b1-4632a4cc2474](src/3b6895da-d9eb-4164-90b1-4632a4cc2474) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Dynamicget](#vdm-joomla-componentbuilder-compiler-dynamicget) + + - **class Data** | [Details](src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46) | [Code](src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php) | [Settings](src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/settings.json) | [05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46](src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46) + - **class Selection** | [Details](src/5b021139-dad0-4e9b-882a-2b4d807795af) | [Code](src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php) | [Settings](src/5b021139-dad0-4e9b-882a-2b4d807795af/settings.json) | [5b021139-dad0-4e9b-882a-2b4d807795af](src/5b021139-dad0-4e9b-882a-2b4d807795af) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Field](#vdm-joomla-componentbuilder-compiler-field) + + - **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) | [a356d103-74f3-49ca-8e4f-3bd37746f089](src/a356d103-74f3-49ca-8e4f-3bd37746f089) + - **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) | [ce826b66-0f2d-43da-8005-41b8e4cb21ee](src/ce826b66-0f2d-43da-8005-41b8e4cb21ee) + - **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) | [99368a6f-2f64-4d4e-ad3a-544d4020ecc6](src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6) + - **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) | [9387215f-a965-4421-acf3-5e8f9d11382f](src/9387215f-a965-4421-acf3-5e8f9d11382f) + - **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) | [eb33420d-359d-44a5-852e-613aef1feaae](src/eb33420d-359d-44a5-852e-613aef1feaae) + - **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) | [8c018533-e967-4bf2-9bd9-9e92966fcb5e](src/8c018533-e967-4bf2-9bd9-9e92966fcb5e) + - **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) | [c871fb4a-4c33-4302-bb79-a9cd7ef4a557](src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557) +- **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) | [33bdc535-0ff1-40c8-bb22-b5d44f1731c4](src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4) + - **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) | [20ed72b0-fcac-4344-aee1-8a65e3bf221d](src/20ed72b0-fcac-4344-aee1-8a65e3bf221d) + - **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) | [2e6731ba-3a03-4836-b2c2-4e50e38cb890](src/2e6731ba-3a03-4836-b2c2-4e50e38cb890) + - **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) | [4325745f-da1f-4d4d-a591-3189fe8c06e5](src/4325745f-da1f-4d4d-a591-3189fe8c06e5) + - **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) | [d6592c9b-93a6-41b3-83c7-c43a0a80cb83](src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83) + - **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) | [a6cdd935-c038-4a54-8446-54bed87f003c](src/a6cdd935-c038-4a54-8446-54bed87f003c) + - **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) | [1133c2d7-ba7e-4c95-8cde-01f084d04682](src/1133c2d7-ba7e-4c95-8cde-01f084d04682) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaThree](#vdm-joomla-componentbuilder-compiler-joomlathree) + + - **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) | [4b86f62e-ce41-4325-a11a-08148807d0df](src/4b86f62e-ce41-4325-a11a-08148807d0df) + - **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) | [87db51b9-1126-4c21-858b-53dbd3a68b61](src/87db51b9-1126-4c21-858b-53dbd3a68b61) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Joomlamodule](#vdm-joomla-componentbuilder-compiler-joomlamodule) + + - **class Data** | [Details](src/cb11e8d9-69c2-4095-831c-59908ea402e7) | [Code](src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php) | [Settings](src/cb11e8d9-69c2-4095-831c-59908ea402e7/settings.json) | [cb11e8d9-69c2-4095-831c-59908ea402e7](src/cb11e8d9-69c2-4095-831c-59908ea402e7) + - **class Structure** | [Details](src/071c7cff-4c88-4b80-bd99-066c572dcb71) | [Code](src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php) | [Settings](src/071c7cff-4c88-4b80-bd99-066c572dcb71/settings.json) | [071c7cff-4c88-4b80-bd99-066c572dcb71](src/071c7cff-4c88-4b80-bd99-066c572dcb71) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin](#vdm-joomla-componentbuilder-compiler-joomlaplugin) + + - **class Data** | [Details](src/766a9524-37df-4604-91a7-b98a6150ee26) | [Code](src/766a9524-37df-4604-91a7-b98a6150ee26/code.php) | [Settings](src/766a9524-37df-4604-91a7-b98a6150ee26/settings.json) | [766a9524-37df-4604-91a7-b98a6150ee26](src/766a9524-37df-4604-91a7-b98a6150ee26) + - **class Structure** | [Details](src/a900b836-f2eb-4f13-8f28-b7cac839c7ff) | [Code](src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php) | [Settings](src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/settings.json) | [a900b836-f2eb-4f13-8f28-b7cac839c7ff](src/a900b836-f2eb-4f13-8f28-b7cac839c7ff) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Language](#vdm-joomla-componentbuilder-compiler-language) + + - **class Extractor** | [Details](src/d33b9278-c409-4aec-a047-b72f56712391) | [Code](src/d33b9278-c409-4aec-a047-b72f56712391/code.php) | [Settings](src/d33b9278-c409-4aec-a047-b72f56712391/settings.json) | [d33b9278-c409-4aec-a047-b72f56712391](src/d33b9278-c409-4aec-a047-b72f56712391) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Library](#vdm-joomla-componentbuilder-compiler-library) + + - **class Data** | [Details](src/7175c1cd-2071-4cd7-b499-23881e168c3f) | [Code](src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php) | [Settings](src/7175c1cd-2071-4cd7-b499-23881e168c3f/settings.json) | [7175c1cd-2071-4cd7-b499-23881e168c3f](src/7175c1cd-2071-4cd7-b499-23881e168c3f) + - **class Structure** | [Details](src/d3ce5763-4d00-4245-a175-54fc2e80e9b7) | [Code](src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/code.php) | [Settings](src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/settings.json) | [d3ce5763-4d00-4245-a175-54fc2e80e9b7](src/d3ce5763-4d00-4245-a175-54fc2e80e9b7) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Model](#vdm-joomla-componentbuilder-compiler-model) + + - **class Adminviews** | [Details](src/cebdcccb-24c5-46db-92de-63453852dcb8) | [Code](src/cebdcccb-24c5-46db-92de-63453852dcb8/code.php) | [Settings](src/cebdcccb-24c5-46db-92de-63453852dcb8/settings.json) | [cebdcccb-24c5-46db-92de-63453852dcb8](src/cebdcccb-24c5-46db-92de-63453852dcb8) + - **class Ajaxadmin** | [Details](src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad) | [Code](src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/code.php) | [Settings](src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/settings.json) | [4f575bd6-de97-41f8-80d6-259c8a6dd9ad](src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad) + - **class Ajaxcustomview** | [Details](src/592aed4e-2c5f-4fc5-8f7a-409203d1af82) | [Code](src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/code.php) | [Settings](src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/settings.json) | [592aed4e-2c5f-4fc5-8f7a-409203d1af82](src/592aed4e-2c5f-4fc5-8f7a-409203d1af82) + - **class Conditions** | [Details](src/55e61314-ba10-4e2b-92dd-b44adebabce9) | [Code](src/55e61314-ba10-4e2b-92dd-b44adebabce9/code.php) | [Settings](src/55e61314-ba10-4e2b-92dd-b44adebabce9/settings.json) | [55e61314-ba10-4e2b-92dd-b44adebabce9](src/55e61314-ba10-4e2b-92dd-b44adebabce9) + - **class Createdate** | [Details](src/53cf9828-7ad4-4856-aac1-7c4c67bd3121) | [Code](src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/code.php) | [Settings](src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/settings.json) | [53cf9828-7ad4-4856-aac1-7c4c67bd3121](src/53cf9828-7ad4-4856-aac1-7c4c67bd3121) + - **class Cssadminview** | [Details](src/e79842d3-51b7-4282-93c7-3487cd8b61ab) | [Code](src/e79842d3-51b7-4282-93c7-3487cd8b61ab/code.php) | [Settings](src/e79842d3-51b7-4282-93c7-3487cd8b61ab/settings.json) | [e79842d3-51b7-4282-93c7-3487cd8b61ab](src/e79842d3-51b7-4282-93c7-3487cd8b61ab) + - **class Csscustomview** | [Details](src/3283a89c-329a-47fb-a011-0df6c31a5c73) | [Code](src/3283a89c-329a-47fb-a011-0df6c31a5c73/code.php) | [Settings](src/3283a89c-329a-47fb-a011-0df6c31a5c73/settings.json) | [3283a89c-329a-47fb-a011-0df6c31a5c73](src/3283a89c-329a-47fb-a011-0df6c31a5c73) + - **class Customadminviews** | [Details](src/e0e24173-a808-4dd5-8e26-de971d014f86) | [Code](src/e0e24173-a808-4dd5-8e26-de971d014f86/code.php) | [Settings](src/e0e24173-a808-4dd5-8e26-de971d014f86/settings.json) | [e0e24173-a808-4dd5-8e26-de971d014f86](src/e0e24173-a808-4dd5-8e26-de971d014f86) + - **class Customalias** | [Details](src/5f8e8fa6-3793-44af-882d-9cfb209434e9) | [Code](src/5f8e8fa6-3793-44af-882d-9cfb209434e9/code.php) | [Settings](src/5f8e8fa6-3793-44af-882d-9cfb209434e9/settings.json) | [5f8e8fa6-3793-44af-882d-9cfb209434e9](src/5f8e8fa6-3793-44af-882d-9cfb209434e9) + - **class Custombuttons** | [Details](src/ebe3287d-bfa0-4519-b663-f442f4dea432) | [Code](src/ebe3287d-bfa0-4519-b663-f442f4dea432/code.php) | [Settings](src/ebe3287d-bfa0-4519-b663-f442f4dea432/settings.json) | [ebe3287d-bfa0-4519-b663-f442f4dea432](src/ebe3287d-bfa0-4519-b663-f442f4dea432) + - **class Customimportscripts** | [Details](src/037c7274-fb16-455d-989a-bf1da022620b) | [Code](src/037c7274-fb16-455d-989a-bf1da022620b/code.php) | [Settings](src/037c7274-fb16-455d-989a-bf1da022620b/settings.json) | [037c7274-fb16-455d-989a-bf1da022620b](src/037c7274-fb16-455d-989a-bf1da022620b) + - **class Customtabs** | [Details](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c) | [Code](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php) | [Settings](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json) | [fa8c1125-d370-4cb6-a7ff-eb32193c198c](src/fa8c1125-d370-4cb6-a7ff-eb32193c198c) + - **class Dynamicget** | [Details](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6) | [Code](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/code.php) | [Settings](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/settings.json) | [79740ee8-4d10-4b51-9ff5-18e1386ec1c6](src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6) + - **class Fields** | [Details](src/e6a64c41-405e-4bbc-9722-27402c22bbea) | [Code](src/e6a64c41-405e-4bbc-9722-27402c22bbea/code.php) | [Settings](src/e6a64c41-405e-4bbc-9722-27402c22bbea/settings.json) | [e6a64c41-405e-4bbc-9722-27402c22bbea](src/e6a64c41-405e-4bbc-9722-27402c22bbea) + - **class Filesfolders** | [Details](src/f4578c04-a81e-4218-b80d-b0612196eaf0) | [Code](src/f4578c04-a81e-4218-b80d-b0612196eaf0/code.php) | [Settings](src/f4578c04-a81e-4218-b80d-b0612196eaf0/settings.json) | [f4578c04-a81e-4218-b80d-b0612196eaf0](src/f4578c04-a81e-4218-b80d-b0612196eaf0) + - **class Historyadminview** | [Details](src/6dfbf568-f3cd-4ea7-af04-6859447b5462) | [Code](src/6dfbf568-f3cd-4ea7-af04-6859447b5462/code.php) | [Settings](src/6dfbf568-f3cd-4ea7-af04-6859447b5462/settings.json) | [6dfbf568-f3cd-4ea7-af04-6859447b5462](src/6dfbf568-f3cd-4ea7-af04-6859447b5462) + - **class Historycomponent** | [Details](src/17a728e9-d6cf-4060-9efb-241b0ff2f981) | [Code](src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php) | [Settings](src/17a728e9-d6cf-4060-9efb-241b0ff2f981/settings.json) | [17a728e9-d6cf-4060-9efb-241b0ff2f981](src/17a728e9-d6cf-4060-9efb-241b0ff2f981) + - **class Javascriptadminview** | [Details](src/dfd3c893-0296-46eb-9ae4-a0348713cd8f) | [Code](src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/code.php) | [Settings](src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/settings.json) | [dfd3c893-0296-46eb-9ae4-a0348713cd8f](src/dfd3c893-0296-46eb-9ae4-a0348713cd8f) + - **class Javascriptcustomview** | [Details](src/29455d3b-df2b-4e41-8684-1608060e37a4) | [Code](src/29455d3b-df2b-4e41-8684-1608060e37a4/code.php) | [Settings](src/29455d3b-df2b-4e41-8684-1608060e37a4/settings.json) | [29455d3b-df2b-4e41-8684-1608060e37a4](src/29455d3b-df2b-4e41-8684-1608060e37a4) + - **class Joomlamodules** | [Details](src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0) | [Code](src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/code.php) | [Settings](src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/settings.json) | [bfdc4ce5-cb12-4fc6-9023-51cede25edd0](src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0) + - **class Joomlaplugins** | [Details](src/ef97b03e-1018-447a-8d7e-30401b0257bb) | [Code](src/ef97b03e-1018-447a-8d7e-30401b0257bb/code.php) | [Settings](src/ef97b03e-1018-447a-8d7e-30401b0257bb/settings.json) | [ef97b03e-1018-447a-8d7e-30401b0257bb](src/ef97b03e-1018-447a-8d7e-30401b0257bb) + - **class Libraries** | [Details](src/59895f37-50c8-4af3-9dad-230e18841953) | [Code](src/59895f37-50c8-4af3-9dad-230e18841953/code.php) | [Settings](src/59895f37-50c8-4af3-9dad-230e18841953/settings.json) | [59895f37-50c8-4af3-9dad-230e18841953](src/59895f37-50c8-4af3-9dad-230e18841953) + - **class Linkedviews** | [Details](src/ae1fa148-91be-4f80-89a9-69d91ba9d575) | [Code](src/ae1fa148-91be-4f80-89a9-69d91ba9d575/code.php) | [Settings](src/ae1fa148-91be-4f80-89a9-69d91ba9d575/settings.json) | [ae1fa148-91be-4f80-89a9-69d91ba9d575](src/ae1fa148-91be-4f80-89a9-69d91ba9d575) + - **class Loader** | [Details](src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7) | [Code](src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/code.php) | [Settings](src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/settings.json) | [0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7](src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7) + - **class Modifieddate** | [Details](src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3) | [Code](src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/code.php) | [Settings](src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/settings.json) | [9127e428-5dee-46cb-b3a9-ab5b91ea6df3](src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3) + - **class Mysqlsettings** | [Details](src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e) | [Code](src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/code.php) | [Settings](src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/settings.json) | [35191b0c-f7f3-44d6-8ec1-c816b997bd4e](src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e) + - **class Permissions** | [Details](src/0dabc67c-abec-4541-82bf-279abd3c9be1) | [Code](src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php) | [Settings](src/0dabc67c-abec-4541-82bf-279abd3c9be1/settings.json) | [0dabc67c-abec-4541-82bf-279abd3c9be1](src/0dabc67c-abec-4541-82bf-279abd3c9be1) + - **class Phpadminview** | [Details](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe) | [Code](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/code.php) | [Settings](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/settings.json) | [c20a63e0-0eeb-4424-9d08-b1bf0f049dfe](src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe) + - **class Phpcustomview** | [Details](src/489da602-27c7-418c-bf59-1d45ad42bdcc) | [Code](src/489da602-27c7-418c-bf59-1d45ad42bdcc/code.php) | [Settings](src/489da602-27c7-418c-bf59-1d45ad42bdcc/settings.json) | [489da602-27c7-418c-bf59-1d45ad42bdcc](src/489da602-27c7-418c-bf59-1d45ad42bdcc) + - **class Relations** | [Details](src/a8eb2fb1-88ed-4af8-842d-898eb915b588) | [Code](src/a8eb2fb1-88ed-4af8-842d-898eb915b588/code.php) | [Settings](src/a8eb2fb1-88ed-4af8-842d-898eb915b588/settings.json) | [a8eb2fb1-88ed-4af8-842d-898eb915b588](src/a8eb2fb1-88ed-4af8-842d-898eb915b588) + - **class Siteviews** | [Details](src/e0075978-315d-4807-8507-ce9c6922a885) | [Code](src/e0075978-315d-4807-8507-ce9c6922a885/code.php) | [Settings](src/e0075978-315d-4807-8507-ce9c6922a885/settings.json) | [e0075978-315d-4807-8507-ce9c6922a885](src/e0075978-315d-4807-8507-ce9c6922a885) + - **class Sql** | [Details](src/d4b418a7-bf9b-4768-969d-e07c36916fd2) | [Code](src/d4b418a7-bf9b-4768-969d-e07c36916fd2/code.php) | [Settings](src/d4b418a7-bf9b-4768-969d-e07c36916fd2/settings.json) | [d4b418a7-bf9b-4768-969d-e07c36916fd2](src/d4b418a7-bf9b-4768-969d-e07c36916fd2) + - **class Sqldump** | [Details](src/a6e1227c-1efe-407d-84ef-03c6989a6a88) | [Code](src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php) | [Settings](src/a6e1227c-1efe-407d-84ef-03c6989a6a88/settings.json) | [a6e1227c-1efe-407d-84ef-03c6989a6a88](src/a6e1227c-1efe-407d-84ef-03c6989a6a88) + - **class Sqltweaking** | [Details](src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26) | [Code](src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/code.php) | [Settings](src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/settings.json) | [e50cbac5-9c9d-4fd4-aa7a-5e830719ed26](src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26) + - **class Tabs** | [Details](src/143ac6ea-b64f-4331-9a97-31e3fce2bb69) | [Code](src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/code.php) | [Settings](src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/settings.json) | [143ac6ea-b64f-4331-9a97-31e3fce2bb69](src/143ac6ea-b64f-4331-9a97-31e3fce2bb69) + - **class Updateserver** | [Details](src/1d0fd857-12ec-4f47-ab1c-124d85748e24) | [Code](src/1d0fd857-12ec-4f47-ab1c-124d85748e24/code.php) | [Settings](src/1d0fd857-12ec-4f47-ab1c-124d85748e24/settings.json) | [1d0fd857-12ec-4f47-ab1c-124d85748e24](src/1d0fd857-12ec-4f47-ab1c-124d85748e24) + - **class Updatesql** | [Details](src/b80296eb-4718-4ed3-894d-69f3ac293733) | [Code](src/b80296eb-4718-4ed3-894d-69f3ac293733/code.php) | [Settings](src/b80296eb-4718-4ed3-894d-69f3ac293733/settings.json) | [b80296eb-4718-4ed3-894d-69f3ac293733](src/b80296eb-4718-4ed3-894d-69f3ac293733) + - **class Whmcs** | [Details](src/af5beb21-214a-44f6-9090-7ea24c22e649) | [Code](src/af5beb21-214a-44f6-9090-7ea24c22e649/code.php) | [Settings](src/af5beb21-214a-44f6-9090-7ea24c22e649/settings.json) | [af5beb21-214a-44f6-9090-7ea24c22e649](src/af5beb21-214a-44f6-9090-7ea24c22e649) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Placeholder](#vdm-joomla-componentbuilder-compiler-placeholder) + + - **class Reverse** | [Details](src/ca111518-e47c-4049-b1b2-cb010f23866f) | [Code](src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php) | [Settings](src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json) | [ca111518-e47c-4049-b1b2-cb010f23866f](src/ca111518-e47c-4049-b1b2-cb010f23866f) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power](#vdm-joomla-componentbuilder-compiler-power) + + - **final class Parser** | [Details](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205) | [Code](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php) | [Settings](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json) | [95d0e03f-24fd-4412-bc2e-f0899fcc3205](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205) + - **class Autoloader** | [Details](src/6e64917c-d687-4ef3-a655-811319f5a81e) | [Code](src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php) | [Settings](src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json) | [6e64917c-d687-4ef3-a655-811319f5a81e](src/6e64917c-d687-4ef3-a655-811319f5a81e) + - **class Infusion** | [Details](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c) | [Code](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php) | [Settings](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json) | [0419081e-4cb3-4c65-8c6a-ffe941fb0f1c](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c) + - **class Plantuml** | [Details](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096) | [Code](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php) | [Settings](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json) | [ff5e9e63-86d0-4691-ab59-d4b9d9154096](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096) + - **class Structure** | [Details](src/324566de-0f7d-4b6e-9caf-8424d55013ae) | [Code](src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php) | [Settings](src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json) | [324566de-0f7d-4b6e-9caf-8424d55013ae](src/324566de-0f7d-4b6e-9caf-8424d55013ae) +- **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) | [2dd1289a-4000-43cc-8c62-77ff32de56bf](src/2dd1289a-4000-43cc-8c62-77ff32de56bf) + - **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) | [2c76c06e-a371-4b73-9fbe-b4d9b4df55d7](src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7) + - **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) | [ea5ed06e-72ae-4906-9167-1cc0fa32fe69](src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69) + - **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) | [8a63e87b-b39b-4a15-8044-9b2a2f4fb61c](src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c) + - **class Customcode** | [Details](src/a74ac3b7-bb79-4639-8f14-54a8021be68b) | [Code](src/a74ac3b7-bb79-4639-8f14-54a8021be68b/code.php) | [Settings](src/a74ac3b7-bb79-4639-8f14-54a8021be68b/settings.json) | [a74ac3b7-bb79-4639-8f14-54a8021be68b](src/a74ac3b7-bb79-4639-8f14-54a8021be68b) + - **class Customview** | [Details](src/87faa133-4cac-4816-ae41-5c3f9a2f76aa) | [Code](src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/code.php) | [Settings](src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/settings.json) | [87faa133-4cac-4816-ae41-5c3f9a2f76aa](src/87faa133-4cac-4816-ae41-5c3f9a2f76aa) + - **class Database** | [Details](src/4815e1c7-a433-443d-a112-d1e03d7df84b) | [Code](src/4815e1c7-a433-443d-a112-d1e03d7df84b/code.php) | [Settings](src/4815e1c7-a433-443d-a112-d1e03d7df84b/settings.json) | [4815e1c7-a433-443d-a112-d1e03d7df84b](src/4815e1c7-a433-443d-a112-d1e03d7df84b) + - **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) | [b94aaedb-6774-4739-a63f-8f87141a85db](src/b94aaedb-6774-4739-a63f-8f87141a85db) + - **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) | [ed9591cb-0a03-400a-bf47-eaf78ab19b9d](src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d) + - **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) | [c6c30d66-3106-44eb-9272-b2cf7ec74613](src/c6c30d66-3106-44eb-9272-b2cf7ec74613) + - **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) | [63782f74-7b03-4745-aa40-0adf8ed4e704](src/63782f74-7b03-4745-aa40-0adf8ed4e704) + - **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) | [295186de-5954-4a65-a4c1-2f79ef305743](src/295186de-5954-4a65-a4c1-2f79ef305743) + - **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) | [9eba241c-af90-42dd-ae05-92ff4d8391d3](src/9eba241c-af90-42dd-ae05-92ff4d8391d3) + - **class Language** | [Details](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0) | [Code](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php) | [Settings](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json) | [9f00e793-86f8-4ef9-b775-a3eb129f83c0](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0) + - **class Library** | [Details](src/253317c7-3c3b-48a0-aec8-8af5e7a86504) | [Code](src/253317c7-3c3b-48a0-aec8-8af5e7a86504/code.php) | [Settings](src/253317c7-3c3b-48a0-aec8-8af5e7a86504/settings.json) | [253317c7-3c3b-48a0-aec8-8af5e7a86504](src/253317c7-3c3b-48a0-aec8-8af5e7a86504) + - **class Mapper** | [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) | [23f2ca33-440a-4941-8e9a-4bc67522c0cb](src/23f2ca33-440a-4941-8e9a-4bc67522c0cb) + - **class Model** | [Details](src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45) | [Code](src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php) | [Settings](src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json) | [0601fee8-d51e-4af0-9ad3-b5f8700c4a45](src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45) + - **class Placeholder** | [Details](src/2f7b1998-bb93-4055-ae82-aa659ce8a37f) | [Code](src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/code.php) | [Settings](src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/settings.json) | [2f7b1998-bb93-4055-ae82-aa659ce8a37f](src/2f7b1998-bb93-4055-ae82-aa659ce8a37f) + - **class Power** | [Details](src/de01527a-6586-46ea-92e7-11ea3de1cedb) | [Code](src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php) | [Settings](src/de01527a-6586-46ea-92e7-11ea3de1cedb/settings.json) | [de01527a-6586-46ea-92e7-11ea3de1cedb](src/de01527a-6586-46ea-92e7-11ea3de1cedb) + - **class Templatelayout** | [Details](src/fff3255d-c493-4c21-a48f-73b3ebf8ba05) | [Code](src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/code.php) | [Settings](src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/settings.json) | [fff3255d-c493-4c21-a48f-73b3ebf8ba05](src/fff3255d-c493-4c21-a48f-73b3ebf8ba05) + - **class Utilities** | [Details](src/516f93b8-5fff-41c6-aeaf-2d93180a12cc) | [Code](src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php) | [Settings](src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json) | [516f93b8-5fff-41c6-aeaf-2d93180a12cc](src/516f93b8-5fff-41c6-aeaf-2d93180a12cc) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Templatelayout](#vdm-joomla-componentbuilder-compiler-templatelayout) + + - **class Data** | [Details](src/39ea8150-f124-4e47-909d-641bf1c96d5e) | [Code](src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php) | [Settings](src/39ea8150-f124-4e47-909d-641bf1c96d5e/settings.json) | [39ea8150-f124-4e47-909d-641bf1c96d5e](src/39ea8150-f124-4e47-909d-641bf1c96d5e) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Utilities](#vdm-joomla-componentbuilder-compiler-utilities) + + - **abstract class FieldHelper** | [Details](src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec) | [Code](src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/code.php) | [Settings](src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/settings.json) | [7a5fd3f3-199e-43ba-a8e8-f473d6c030ec](src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec) + - **abstract class Indent** | [Details](src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6) | [Code](src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/code.php) | [Settings](src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/settings.json) | [a68c010b-e92e-47d5-8a44-d23cfddeb6c6](src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6) + - **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) | [4e6ff11d-bebf-42f5-8fd7-b2f882857222](src/4e6ff11d-bebf-42f5-8fd7-b2f882857222) + - **abstract class Minify** | [Details](src/b591855d-d106-4fe5-90ad-8e706f6267cf) | [Code](src/b591855d-d106-4fe5-90ad-8e706f6267cf/code.php) | [Settings](src/b591855d-d106-4fe5-90ad-8e706f6267cf/settings.json) | [b591855d-d106-4fe5-90ad-8e706f6267cf](src/b591855d-d106-4fe5-90ad-8e706f6267cf) + - **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) | [500f3a7f-c16d-4dd4-81b2-2df6776b5388](src/500f3a7f-c16d-4dd4-81b2-2df6776b5388) + - **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) | [f02fb1df-f4b6-4be1-9595-2e72084a5e6e](src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e) + - **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) | [e6d871a6-bbe7-497d-af01-68f6bb9a87f4](src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4) + - **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) | [268b85ef-49f3-4c39-8187-bb12e38d19ee](src/268b85ef-49f3-4c39-8187-bb12e38d19ee) + - **class File** | [Details](src/5c75b455-3d4c-452a-867e-e90424a64c88) | [Code](src/5c75b455-3d4c-452a-867e-e90424a64c88/code.php) | [Settings](src/5c75b455-3d4c-452a-867e-e90424a64c88/settings.json) | [5c75b455-3d4c-452a-867e-e90424a64c88](src/5c75b455-3d4c-452a-867e-e90424a64c88) + - **class Folder** | [Details](src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1) | [Code](src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/code.php) | [Settings](src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/settings.json) | [6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1](src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1) + - **class Pathfix** | [Details](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f) | [Code](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php) | [Settings](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json) | [cdc9b06d-8333-4fa7-ab4d-b810dd90f95f](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f) + - **class Paths** | [Details](src/6f20369a-8536-4870-a1a3-cda254c939c8) | [Code](src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php) | [Settings](src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json) | [6f20369a-8536-4870-a1a3-cda254c939c8](src/6f20369a-8536-4870-a1a3-cda254c939c8) + - **class Structure** | [Details](src/1efdded5-d6c8-452c-8f37-0374483a7b3f) | [Code](src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php) | [Settings](src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json) | [1efdded5-d6c8-452c-8f37-0374483a7b3f](src/1efdded5-d6c8-452c-8f37-0374483a7b3f) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Builder\Update](#vdm-joomla-componentbuilder-compiler-builder-update) + + - **class Mysql** | [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) | [2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9](src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9) +- **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) | [053803e6-1251-4aed-aefe-46a8e84198d2](src/053803e6-1251-4aed-aefe-46a8e84198d2) +- **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) | [1d929017-a5de-4e0f-9b5a-838934857e26](src/1d929017-a5de-4e0f-9b5a-838934857e26) +- **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) | [24da9672-e47f-4bb1-b6c0-0ebfc17f0957](src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957) +- **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) | [97698747-c2ce-4e09-a470-acf6d8e86281](src/97698747-c2ce-4e09-a470-acf6d8e86281) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode](#vdm-joomla-componentbuilder-compiler-interfaces-customcode) + + - **interface DispenserInterface** | [Details](src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0) | [Code](src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/code.php) | [Settings](src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/settings.json) | [ef687e42-dc25-4423-9dd4-ec6e9743cfb0](src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0) + - **interface ExternalInterface** | [Details](src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a) | [Code](src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/code.php) | [Settings](src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/settings.json) | [1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a](src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a) + - **interface ExtractorInterface** | [Details](src/6da2afa5-6087-46dd-80a0-74c6434bcb18) | [Code](src/6da2afa5-6087-46dd-80a0-74c6434bcb18/code.php) | [Settings](src/6da2afa5-6087-46dd-80a0-74c6434bcb18/settings.json) | [6da2afa5-6087-46dd-80a0-74c6434bcb18](src/6da2afa5-6087-46dd-80a0-74c6434bcb18) + - **interface GuiInterface** | [Details](src/2cc8517d-1105-4697-9743-048b4b7c089c) | [Code](src/2cc8517d-1105-4697-9743-048b4b7c089c/code.php) | [Settings](src/2cc8517d-1105-4697-9743-048b4b7c089c/settings.json) | [2cc8517d-1105-4697-9743-048b4b7c089c](src/2cc8517d-1105-4697-9743-048b4b7c089c) + - **interface LockBaseInterface** | [Details](src/a3c515f5-4adf-4eb3-b637-0a1add550da6) | [Code](src/a3c515f5-4adf-4eb3-b637-0a1add550da6/code.php) | [Settings](src/a3c515f5-4adf-4eb3-b637-0a1add550da6/settings.json) | [a3c515f5-4adf-4eb3-b637-0a1add550da6](src/a3c515f5-4adf-4eb3-b637-0a1add550da6) +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension](#vdm-joomla-componentbuilder-compiler-interfaces-extension) + + - **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) | [1aefb8f5-486f-4f00-adf9-696340b3254e](src/1aefb8f5-486f-4f00-adf9-696340b3254e) +- **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) | [b9f05dc4-d23a-499a-a826-9749b81818ed](src/b9f05dc4-d23a-499a-a826-9749b81818ed) +- **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) | [efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5](src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5) +- **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) | [0d08c583-04d5-454e-b756-48ca05e1651a](src/0d08c583-04d5-454e-b756-48ca05e1651a) + +# Class Diagrams + +## VDM Joomla Componentbuilder Compiler +> namespace VDM\Joomla\Componentbuilder\Compiler +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler #Olive { + + + abstract Factory #Orange { + # static $container + # static $JoomlaVersion + + {static} _() : mixed + + {static} _J() : mixed + + {static} getContainer() : Container + # {static} createContainer() : Container + } + + class Component #Gold { + + __construct() + + __get() + } + + class Config #Gold { + # JoomlaRegistry $config + + __construct() + # getAddcontributors() : bool + # getAddajax() : bool + # getAddsiteajax() : bool + # getAddeximport() : bool + # getAddcheckin() : bool + # getComponentid() : int + # getComponentversion() : string + # getComponentcodename() : string + # getComponentcontext() : string + # getComponentcodenamelength() : int + # getJoomlaversion() : int + # getJoomlaversions() : array + # getJoomlaversionname() : string + # getSetjoomlafields() : bool + # getShowadvancedoptions() : bool + # getIndentationvalue() : string + # getAddbuilddate() : int + # getBuilddate() : string + # getBackup() : int + # getRepository() : int + # getDebuglinenr() : int + # getMinify() : int + # getRemovelinebreaks() : bool + # getTidy() : bool + # getSettidywarning() : bool + # getSettaghistory() : bool + # getLangtag() : string + # getLangprefix() : string + # getLangtarget() : string + # getLangstringtargets() : array + # getLangstringkeytargets() : array + # getFieldbuildertype() : int + # getDefaultfields() : array + # getTmppath() : string + # getCompilerpath() : string + # getJcbpowerspath() : string + # getLocalpowersrepositorypath() : string + # getBompath() : string + # getCustomfolderpath() : string + # getAddassetstablefix() : int + # getAddassetstablenamefix() : bool + # getAccessworsecase() : int + # getMysqltablekeys() : array + # getAddplaceholders() : bool + # getAddpower() : bool + # getAddsuperpowers() : bool + # getBuildtarget() : string + # getCryptiontypes() : array + # getBasicencryption() : bool + # getMediumencryption() : bool + # getWhmcsencryption() : bool + # getRemovesitefolder() : bool + # getRemovesiteeditfolder() : bool + # getUikit() : int + # getGooglechart() : bool + # getFootable() : bool + # getFootableversion() : int + } + + class Content #Gold { + # key() : string + # firstKey() : string + # secondKey() : string + } + + class Customcode #Gold { + + array $functionNameMemory + + $active + + $memory + # $data + # Config $config + # Placeholder $placeholder + # Extractor $extractor + # External $external + # $db + + __construct() + + update() : string + + set() : string + + get() : bool + # insert() : string + # buildPlaceholders() : void + # check() : Mixed + } + + class Field #Gold { + # Data $data + # Name $name + # TypeName $typeName + # UniqueName $uniqueName + + __construct() + + set() : void + } + + class Language #Gold { + # array $content + # Config $config + + __construct() + + key() : string + + exist() : bool + + get() : string + + getTarget() : array + + setTarget() : void + + set() : void + # fix() : string + } + + class Placeholder #Gold { + + array $active + # Config $config + + __construct() + + set() : void + + get() : mixed + + exist() : bool + + add() : void + + remove() : void + + set_() : void + + get_() : mixed + + exist_() : bool + + add_() : void + + remove_() : void + + set_h() : void + + get_h() : mixed + + exist_h() : bool + + add_h() : void + + remove_h() : void + + setType() : void + + clearType() : void + + update() : string + + update_() : string + + keys() : array + } + + class Power #Gold { + + array $active + + array $namespace + + array $composer + + array $superpowers + # string $fixUrl + # array $state + # Config $config + # Placeholder $placeholder + # Customcode $customcode + # Gui $gui + # \JDatabaseDriver $db + # CMSApplication $app + + __construct() + + load() : void + + get() : ?object + - set() : bool + - isPowerSet() : bool + - isGuidValid() : bool + - getPowerData() : ?object + - setNamespace() : bool + - setUseSelection() : void + - setLoadSelection() : void + - setComposer() : void + - setImplements() : void + - setExtend() : void + - setUseAs() : void + - getCleanNamespace() : string + - getUseNamespace() : string + - addToHeader() : void + - setLicensingTemplate() : void + - setHeader() : void + - setMainClassCode() : void + - setSuperPowers() : void + } + + class Registry #Gold { + # $indent + + varExport() : ?string + # convertIndent() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Interfaces +> namespace VDM\Joomla\Componentbuilder\Interfaces +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Interfaces #Olive { + + + interface Cryptinterface #Lavender { + + encrypt() : string + + decrypt() : string + } + + interface FactoryInterface #Lavender { + + {static} _() : Mixed + + {static} getContainer() : Container + } + + interface InsertInterface #Lavender { + + rows() : bool + + items() : bool + + row() : bool + } + + interface LoadInterface #Lavender { + + rows() : ?array + + items() : ?array + + row() : ?array + + item() : ?object + + value() : mixed + } + + interface Mapperdoubleinterface #Lavender { + + isActive_() : bool + + set_() : void + + get_() : mixed + + exist_() : bool + + add_() : void + + remove_() : void + } + + interface Mappersingleinterface #Lavender { + + isActive() : bool + + set() : void + + get() : mixed + + exist() : bool + + add() : void + + remove() : void + } + + interface ModelInterface #Lavender { + + value() : mixed + + item() : ?object + + items() : ?array + + last() : ?int + } + + interface Serverinterface #Lavender { + + set() : self + + move() : bool + } + + interface Tableinterface #Lavender { + + get() : mixed + + title() : ?array + + titleName() : string + + tables() : array + + exist() : bool + + fields() : ?array + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Adminview +> namespace VDM\Joomla\Componentbuilder\Compiler\Adminview +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Adminview #LightGreen { + + + class Data #Gold { + # array $data + # Config $config + # Registry $registry + # EventInterface $event + # Placeholder $placeholder + # Dispenser $dispenser + # Customtabs $customtabs + # Tabs $tabs + # Fields $fields + # Historyadminview $history + # Permissions $permissions + # Conditions $conditions + # Relations $relations + # Linkedviews $linkedviews + # Javascriptadminview $javascript + # Cssadminview $css + # Phpadminview $php + # Custombuttons $custombuttons + # Customimportscripts $customimportscripts + # Ajaxadmin $ajax + # Customalias $customalias + # Sql $sql + # Mysqlsettings $mysqlsettings + # \JDatabaseDriver $db + + __construct() + + get() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Alias +> namespace VDM\Joomla\Componentbuilder\Compiler\Alias +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Alias #LightGreen { + + + class Data #Gold { + # Config $config + # Registry $registry + # Customcode $customcode + # Gui $gui + # Loader $loader + # Libraries $libraries + # \JDatabaseDriver $db + + __construct() + + get() : ?array + # set() : void + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Component +> namespace VDM\Joomla\Componentbuilder\Compiler\Component +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Component #LightGreen { + + + class Dashboard #Gold { + # Registry $registry + # Component $component + # CMSApplication $app + + __construct() + + set() : void + } + + class Data #Gold { + # Config $config + # EventInterface $event + # Placeholder $placeholder + # ComponentPlaceholder $componentPlaceholder + # Dispenser $dispenser + # Customcode $customcode + # Gui $gui + # Field $field + # FieldName $fieldName + # UniqueName $uniqueName + # Filesfolders $filesFolders + # Historycomponent $history + # Whmcs $whmcs + # Sqltweaking $sqltweaking + # Adminviews $adminviews + # Siteviews $siteviews + # Customadminviews $customadminviews + # Updateserver $updateserver + # Joomlamodules $modules + # Joomlaplugins $plugins + # \JDatabaseDriver $db + + __construct() + + get() : ?object + } + + class Placeholder #Gold { + # $placeholders + # $config + # $db + + __construct() + + get() : array + } + + class Settings #Gold { + # array $standardFolders + # array $standardRootFiles + # ?object $data + # Config $config + # Registry $registry + # EventInterface $event + # Placeholder $placeholder + # Component $component + # Paths $paths + # Dynamicpath $dynamicpath + # Pathfix $pathfix + + __construct() + + exists() : bool + + structure() : object + + multiple() : object + + single() : object + + standardFolder() : bool + + standardRootFile() : bool + - isSet() : bool + - get() : ?object + - readJsonFile() : ?object + - isValidData() : bool + - loadExtraFolders() : void + - addImportViewFolder() : void + - addPhpSpreadsheetFolder() : void + - addUikitFolder() : void + - addFooTableFolder() : void + - loadExtraFiles() : void + - addGoogleChartFiles() : void + - addFolders() : void + - addFiles() : void + } + + class Structure #Gold { + # Settings $settings + # Paths $paths + # Folder $folder + + __construct() + + build() : bool + # folders() : void + } + + class Structuremultiple #Gold { + # Config $config + # Registry $registry + # Settings $settings + # Component $component + # Createdate $createdate + # Modifieddate $modifieddate + # Structure $structure + + __construct() + + build() : bool + # admin() : bool + # site() : bool + # custom() : bool + - isValidAdminView() : bool + - isValidView() : bool + - buildAdminView() : void + - buildView() : void + } + + class Structuresingle #Gold { + # string $newName + # string $currentFullPath + # string $packageFullPath + # string $zipFullPath + # Config $config + # Registry $registry + # Settings $settings + # Component $component + # Content $content + # Counter $counter + # Paths $paths + # Files $files + # CMSApplication $app + + __construct() + + build() : bool + - doLicenseCheck() : bool + - doReadmeCheck() : bool + - doChangelogCheck() : bool + - setNewName() : void + - setPaths() : void + - pathExist() : bool + - setTarget() : void + - moveFile() : void + - registerFile() : void + - setDynamicTarget() : void + - setDynamicFolders() : void + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Customcode +> namespace VDM\Joomla\Componentbuilder\Compiler\Customcode +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode #LightGreen { + + + class Dispenser #Gold { + + array $hub + # Placeholder $placeholder + # Customcode $customcode + # Gui $gui + # Hash $hash + # LockBase $base64 + + __construct() + + set() : bool + + get() : mixed + } + + class External #Gold { + # array $code + # array $cutter + # Placeholder $placeholder + # \JDatabaseDriver $db + # User $user + # CMSApplication $app + + __construct() + + set() : string + # getCode() : void + # cut() : string + } + + class Extractor #Gold { + # array $existing + # array $new + # array $done + # array $counter + # array $fileTypes + # array $placeholders + # string $today + # Config $config + # Gui $gui + # Paths $paths + # Reverse $reverse + # Placeholder $componentPlaceholder + # Pathfix $pathfix + # User $user + # \JDatabaseDriver $db + # CMSApplication $app + + __construct() + + run() : void + # searchFileContent() : array + # insert() : void + # update() : void + # setStartReplace() : string + # addLineChecker() : bool|int + # getSystemID() : mixed + } + + class Gui #Gold { + # Config $config + # Reverse $reverse + # \JDatabaseDriver $db + # CMSApplication $app + + __construct() + + set() : string + + search() : void + # check() : bool + } + + class Hash #Gold { + # Placeholder $placeholder + + __construct() + + set() : string + } + + class LockBase #Gold { + # Placeholder $placeholder + + __construct() + + set() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Customview +> namespace VDM\Joomla\Componentbuilder\Compiler\Customview +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Customview #LightGreen { + + + class Data #Gold { + # array $data + # Config $config + # EventInterface $event + # Customcode $customcode + # Gui $gui + # Libraries $libraries + # Templatelayout $templateLayout + # Dynamicget $dynamic + # Loader $loader + # Javascriptcustomview $javascript + # Csscustomview $css + # Phpcustomview $php + # Custombuttons $custombuttons + # Ajaxcustomview $ajax + # \JDatabaseDriver $db + + __construct() + + get() : ?object + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Dynamicget +> namespace VDM\Joomla\Componentbuilder\Compiler\Dynamicget +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Dynamicget #LightGreen { + + + class Data #Gold { + # array $guiMapper + # Config $config + # Registry $registry + # EventInterface $event + # Customcode $customcode + # Dispenser $dispenser + # Gui $gui + # Dynamicget $dynamic + # \JDatabaseDriver $db + + __construct() + + get() : ?array + } + + class Selection #Gold { + # array $name + # Config $config + # Registry $registry + # \JDatabaseDriver $db + + __construct() + + get() : ?array + # name() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Field +> namespace VDM\Joomla\Componentbuilder\Compiler\Field +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Field #LightGreen { + + + class Customcode #Gold { + # array $views + # Dispenser $dispenser + + __construct() + + update() : void + } + + class Data #Gold { + # array $fields + # Config $config + # EventInterface $event + # HistoryInterface $history + # Placeholder $placeholder + # Customcode $customcode + # FieldCustomcode $fieldCustomcode + # Validation $validation + # \JDatabaseDriver $db + + __construct() + + get() : ?object + } + + class DatabaseName #Gold { + # Registry $registry + + __construct() + + get() : ?string + } + + class Name #Gold { + # Registry $registry + # array $unique + # Placeholder $placeholder + # UniqueName $uniqueName + + __construct() + + get() : string + } + + class TypeName #Gold { + + get() : string + } + + class UniqueName #Gold { + # Registry $registry + + __construct() + + set() : void + + get() : string + } + + class Validation #Gold { + # Registry $registry + # Gui $gui + # Placeholder $placeholder + # Customcode $customcode + # CoreValidationInterface $validation + + __construct() + + set() : void + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Interfaces +> namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces #LightGreen { + + + interface CustomcodeInterface #Lavender { + + update() : string + + set() : string + + get() : bool + } + + interface EventInterface #Lavender { + + trigger() : void + } + + interface GetScriptInterface #Lavender { + + get() : string + } + + interface HistoryInterface #Lavender { + + get() : ?object + } + + interface LanguageInterface #Lavender { + + key() : string + + exist() : bool + + get() : string + + getTarget() : array + + setTarget() : void + + set() : void + } + + interface PlaceholderInterface #Lavender { + + set() : void + + get() : mixed + + exist() : bool + + add() : void + + remove() : void + + set_() : void + + get_() : mixed + + exist_() : bool + + add_() : void + + remove_() : void + + set_h() : void + + get_h() : mixed + + exist_h() : bool + + add_h() : void + + remove_h() : void + + setType() : void + + clearType() : void + + update() : string + + update_() : string + + keys() : array + } + + interface PowerInterface #Lavender { + + load() : void + + get() : mixed + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler JoomlaThree +> namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree #LightGreen { + + + class Event #Gold { + # $activePlugins + + __construct() + + trigger() : void + } + + class History #Gold { + # ?object $tmp + # Config $config + # \JDatabaseDriver $db + + __construct() + + get() : ?object + # set() : bool + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Joomlamodule +> namespace VDM\Joomla\Componentbuilder\Compiler\Joomlamodule +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Joomlamodule #LightGreen { + + + class Data #Gold { + # array $data + # Config $config + # Customcode $customcode + # Gui $gui + # Placeholder $placeholder + # Language $language + # Field $field + # FieldName $fieldName + # Filesfolders $filesFolders + # Libraries $libraries + # Dynamicget $dynamic + # \JDatabaseDriver $db + + __construct() + + get() : object|array|null + + exists() : bool + + set() : bool + } + + class Structure #Gold { + # Module $module + # Component $component + # Config $config + # Registry $registry + # Dispenser $dispenser + # EventInterface $event + # Counter $counter + # Folder $folder + # File $file + # Files $files + + __construct() + + build() : void + # getXML() : string + # getCustomScriptField() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Joomlaplugin +> namespace VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin #LightGreen { + + + class Data #Gold { + # array $data + # Config $config + # Customcode $customcode + # Gui $gui + # Placeholder $placeholder + # Language $language + # Field $field + # FieldName $fieldName + # Filesfolders $filesFolders + # \JDatabaseDriver $db + + __construct() + + get() : object|array|null + + exists() : bool + + set() : bool + } + + class Structure #Gold { + # Plugin $plugin + # Component $component + # Config $config + # Registry $registry + # Dispenser $dispenser + # EventInterface $event + # Counter $counter + # Folder $folder + # File $file + # Files $files + + __construct() + + build() : void + # getXML() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Language +> namespace VDM\Joomla\Componentbuilder\Compiler\Language +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Language #LightGreen { + + + class Extractor #Gold { + + array $langKeys + + array $langMismatch + + array $langMatch + # Config $config + # Placeholder $placeholder + # Language $language + + __construct() + + engine() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Library +> namespace VDM\Joomla\Componentbuilder\Compiler\Library +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Library #LightGreen { + + + class Data #Gold { + # Config $config + # Registry $registry + # Customcode $customcode + # Gui $gui + # FieldData $field + # Filesfolders $filesFolders + # \JDatabaseDriver $db + + __construct() + + get() : object|bool + } + + class Structure #Gold { + # Config $config + # Registry $registry + # EventInterface $event + # Component $component + # Content $content + # Counter $counter + # Paths $paths + # Folder $folder + # File $file + + __construct() + + build() : void + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Model +> namespace VDM\Joomla\Componentbuilder\Compiler\Model +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Model #LightGreen { + + + class Adminviews #Gold { + # Adminview $admin + # Registry $registry + # Config $config + + __construct() + + set() : void + } + + class Ajaxadmin #Gold { + # array $guiMapper + # Config $config + # Registry $registry + # Dispenser $dispenser + + __construct() + + set() : void + } + + class Ajaxcustomview #Gold { + # array $guiMapper + # Config $config + # Dispenser $dispenser + + __construct() + + set() : void + } + + class Conditions #Gold { + # TypeName $typeName + # FieldName $fieldName + + __construct() + + set() : void + } + + class Createdate #Gold { + + get() : string + } + + class Cssadminview #Gold { + # array $areas + # Dispenser $dispenser + + __construct() + + set() : void + } + + class Csscustomview #Gold { + # array $areas + # Customcode $customcode + + __construct() + + set() : void + } + + class Customadminviews #Gold { + # Customview $customadmin + # Config $config + + __construct() + + set() : void + } + + class Customalias #Gold { + # Registry $registry + # FieldName $fieldName + + __construct() + + set() : void + } + + class Custombuttons #Gold { + # array $areas + # array $guiMapper + # Customcode $customcode + # Gui $gui + # Templatelayout $templateLayout + + __construct() + + set() : void + } + + class Customimportscripts #Gold { + # array $areas + # array $guiMapper + # Dispenser $dispenser + + __construct() + + set() : void + } + + class Customtabs #Gold { + # Config $config + # Registry $registry + # Language $language + # Placeholder $placeholder + # Customcode $customcode + + __construct() + + set() : void + } + + class Dynamicget #Gold { + # array $jointer + # array $operator + # array $guiMapper + # Config $config + # Registry $registry + # Customcode $customcode + # Gui $gui + # Placeholder $placeholder + # Selection $selection + + __construct() + + set() : void + } + + class Fields #Gold { + # Config $config + # Registry $registry + # HistoryInterface $history + # Customcode $customcode + # Field $field + # FieldName $fieldName + # UpdateSql $updateSql + # CMSApplication $app + + __construct() + + set() : void + } + + class Filesfolders #Gold { + # array $keys + + set() : void + } + + class Historyadminview #Gold { + # Config $config + # HistoryInterface $history + # Updatesql $updatesql + + __construct() + + set() : void + } + + class Historycomponent #Gold { + # Config $config + # HistoryInterface $history + # Updatesql $updatesql + + __construct() + + set() : void + - setAdminView() : void + - setComponent() : void + } + + class Javascriptadminview #Gold { + # array $scripter + # array $guiMapper + # Dispenser $dispenser + + __construct() + + set() : void + } + + class Javascriptcustomview #Gold { + # array $areas + # array $guiMapper + # Customcode $customcode + # Gui $gui + + __construct() + + set() : void + } + + class Joomlamodules #Gold { + # Module $module + + __construct() + + set() : void + } + + class Joomlaplugins #Gold { + # Plugin $plugin + + __construct() + + set() : void + } + + class Libraries #Gold { + # Config $config + # Registry $registry + # Library $library + + __construct() + + set() : void + } + + class Linkedviews #Gold { + # Registry $registry + + __construct() + + set() : void + } + + class Loader #Gold { + # Config $config + # Registry $registry + + __construct() + + set() : void + + uikit() : void + # getFootableScripts() : bool + # getGetModule() : bool + # getGoogleChart() : bool + } + + class Modifieddate #Gold { + # array $last + + get() : string + # getDate() : int + # getModified() : int + # getKey() : string + } + + class Mysqlsettings #Gold { + # Config $config + # Registry $registry + + __construct() + + set() : void + } + + class Permissions #Gold { + + set() : void + } + + class Phpadminview #Gold { + # array $areas + # array $guiMapper + # Dispenser $dispenser + # Templatelayout $templateLayout + + __construct() + + set() : void + } + + class Phpcustomview #Gold { + # array $areas + # array $guiMapper + # Customcode $customcode + # Gui $gui + # Loader $loader + # Templatelayout $templateLayout + + __construct() + + set() : void + } + + class Relations #Gold { + # Config $config + # Registry $registry + # Language $language + # Customcode $customcode + + __construct() + + set() : void + } + + class Siteviews #Gold { + # Customview $site + # Config $config + + __construct() + + set() : void + } + + class Sql #Gold { + # Dispenser $dispenser + # Sqldump $dump + + __construct() + + set() : void + } + + class Sqldump #Gold { + # Registry $registry + # \JDatabaseDriver $db + + __construct() + + get() : ?string + # escape() : string|array + } + + class Sqltweaking #Gold { + # Registry $registry + + __construct() + + set() : void + # tweak() : void + } + + class Tabs #Gold { + + set() : void + } + + class Updateserver #Gold { + + set() : void + # changelog() : void + } + + class Updatesql #Gold { + # array $name + # Registry $registry + + __construct() + + set() : void + # add() : void + # name() : string + } + + class Whmcs #Gold { + + set() : void + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Placeholder +> namespace VDM\Joomla\Componentbuilder\Compiler\Placeholder +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Placeholder #LightGreen { + + + class Reverse #Gold { + # Config $config + # Placeholder $placeholder + # Language $language + # Extractor $extractor + + __construct() + + engine() : string + # setReverse() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Power +> namespace VDM\Joomla\Componentbuilder\Compiler\Power +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Power #LightGreen { + + + class Parser << (F,LightGreen) >> #Green { + + code() : array + - properties() : ?array + - methods() : ?array + - extractDocBlock() : ?string + - extractFunctionArgumentDetails() : ?array + - extractReturnType() : ?string + - extractArgTypesFromComment() : ?array + - extractArgTypesArguments() : ?array + - extractReturnTypeFromComment() : ?string + - extractSinceVersion() : ?string + - extractDeprecatedVersion() : ?string + - removeWhiteSpaceFromComment() : string + - mergeArgumentTypes() : array + } + + class Autoloader #Gold { + # Power $power + # Config $config + # Content $content + # string $helper + + __construct() + + set() : void + - loadPluginAutoloader() : bool + - loadHelperAutoloader() : bool + - loadSiteAutoloader() : bool + - getPluginAutoloader() : string + - getHelperAutoloader() : string + - getBLockSiteLoading() : ?string + - getAutoloader() : ?string + - getComposer() : ?string + } + + class Infusion #Gold { + # Config $config + # Power $power + # Content $content + # Autoloader $autoloader + # Parser $parser + # RepoReadme $reporeadme + # ReposReadme $reposreadme + # Placeholder $placeholder + # Event $event + # array $linker + + __construct() + + set() : void + - parsePowers() : void + - setSuperPowers() : void + - setPowers() : void + - index() : string + - code() : string + - linker() : string + } + + class Plantuml #Gold { + + namespaceDiagram() : string + + classBasicDiagram() : string + + classDetailedDiagram() : string + - generatePropertiesPlantUML() : string + - generateDetailedMethodsPlantUML() : array + - generateBasicMethodsPlantUML() : string + - generateMethodArgumentsAndNotes() : array + - generateMethodNotes() : array + - generateNotesPlantUML() : string + - getAccessSign() : string + - getClassTypeLable() : string + - getClassTypeTag() : string + - getClassColor() : string + - getNamespaceColor() : string + } + + class Structure #Gold { + # array $htaccess + # Power $power + # Config $config + # Registry $registry + # EventInterface $event + # Counter $counter + # Paths $paths + # Folder $folder + # File $file + # Files $files + # CMSApplication $app + + __construct() + + build() : void + - createFile() : void + - setHtaccess() : void + - setDynamicFolders() : void + - setSuperPowerDetails() : void + - setSuperPowerFiles() : void + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Service +> namespace VDM\Joomla\Componentbuilder\Compiler\Service +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Service #LightGreen { + + + class Adminview #Gold { + + register() : void + + getAdminviewData() : AdminviewData + } + + class Builder #Gold { + + register() : void + + getMysql() : Mysql + } + + class Compiler #Gold { + + register() : void + + getConfig() : Config + + getRegistry() : Registry + + getTable() : Table + } + + class Component #Gold { + + register() : void + + getComponent() : CompilerComponent + + getSettings() : Settings + + getDashboard() : Dashboard + + getPlaceholder() : Placeholder + + getData() : Data + + getStructure() : Structure + + getStructuresingle() : Structuresingle + + getStructuremultiple() : Structuremultiple + } + + class Customcode #Gold { + + register() : void + + getCustomcode() : CustomcodeInterface + + getExternal() : External + + getGui() : Gui + + getHash() : Hash + + getLockBase() : LockBase + + getDispenser() : Dispenser + + getPaths() : Paths + + getExtractor() : Extractor + } + + class Customview #Gold { + + register() : void + + getCustomviewData() : CustomviewData + + getDynamicgetData() : DynamicgetData + + getDynamicgetSelection() : DynamicgetSelection + } + + class Database #Gold { + + register() : void + + getLoad() : Load + + getInsert() : Insert + } + + class Event #Gold { + # $currentVersion + + register() : void + + getEvent() : EventInterface + + getJ3Event() : J3Event + } + + class Extension #Gold { + # $targetVersion + + register() : void + + getJ3ExtensionInstallScript() : J3InstallScript + + getExtensionInstallScript() : GetScriptInterface + } + + class Field #Gold { + # $targetVersion + + register() : void + + getField() : CompilerField + + getData() : Data + + getValidation() : Validation + + getJ3CoreValidation() : J3CoreValidation + + getCoreValidation() : CoreValidationInterface + + getCustomcode() : Customcode + + getFieldName() : Name + + getFieldTypeName() : TypeName + + getFieldUniqueName() : UniqueName + + getFieldDatabaseName() : DatabaseName + } + + class History #Gold { + # $currentVersion + + register() : void + + getHistory() : HistoryInterface + + getJ3History() : J3History + } + + class Joomlamodule #Gold { + + register() : void + + getData() : Data + + getStructure() : Structure + } + + class Joomlaplugin #Gold { + + register() : void + + getData() : Data + + getStructure() : Structure + } + + class Language #Gold { + + register() : void + + getLanguage() : CompilerLanguage + + getLanguageExtractor() : Extractor + } + + class Library #Gold { + + register() : void + + getData() : Data + + getStructure() : Structure + } + + class Mapper #Gold { + + register() : void + + getContent() : Content + } + + class Model #Gold { + + register() : void + + getModelJoomlaplugins() : Joomlaplugins + + getModelJoomlamodules() : Joomlamodules + + getModelHistorycomponent() : Historycomponent + + getModelCustomadminviews() : Customadminviews + + getModelAjaxcustomview() : Ajaxcustomview + + getModelJavascriptcustomview() : Javascriptcustomview + + getModelCsscustomview() : Csscustomview + + getModelPhpcustomview() : Phpcustomview + + getModelDynamicget() : Dynamicget + + getModelLibraries() : Libraries + + getModelSiteviews() : Siteviews + + getModelPermissions() : Permissions + + getModelHistoryadminview() : Historyadminview + + getModelMysqlsettings() : Mysqlsettings + + getModelSql() : Sql + + getModelCustomalias() : Customalias + + getModelAjaxadmin() : Ajaxadmin + + getModelCustomimportscripts() : Customimportscripts + + getModelCustombuttons() : Custombuttons + + getModelLoader() : Loader + + getModelPhpadminview() : Phpadminview + + getModelCssadminview() : Cssadminview + + getModelJavascriptadminview() : Javascriptadminview + + getModelLinkedviews() : Linkedviews + + getModelRelations() : Relations + + getModelConditions() : Conditions + + getModelFields() : Fields + + getModelUpdatesql() : Updatesql + + getModelTabs() : Tabs + + getModelCustomtabs() : Customtabs + + getModelAdminviews() : Adminviews + + getModelSqltweaking() : Sqltweaking + + getModelSqldump() : Sqldump + + getModelWhmcs() : Whmcs + + getModifieddate() : Modifieddate + + getCreatedate() : Createdate + + getUpdateserver() : Updateserver + + getModelFilesfolders() : Filesfolders + + getServerLoad() : ServerLoad + } + + class Placeholder #Gold { + + register() : void + + getPlaceholder() : CompilerPlaceholder + + getPlaceholderReverse() : Reverse + } + + class Power #Gold { + + register() : void + + getPowers() : Powers + + getAutoloader() : Autoloader + + getInfusion() : Infusion + + getStructure() : Structure + + getParser() : Parser + + getPlantuml() : Plantuml + + getRepoReadme() : RepoReadme + + getReposReadme() : ReposReadme + } + + class Templatelayout #Gold { + + register() : void + + getTemplatelayoutData() : TemplatelayoutData + + getAliasData() : AliasData + } + + class Utilities #Gold { + + register() : void + + getFolder() : Folder + + getFile() : File + + getCounter() : Counter + + getPaths() : Paths + + getFiles() : Files + + getConstantpaths() : Constantpaths + + getDynamicpath() : Dynamicpath + + getPathfix() : Pathfix + + getStructure() : Structure + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Templatelayout +> namespace VDM\Joomla\Componentbuilder\Compiler\Templatelayout +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Templatelayout #LightGreen { + + + class Data #Gold { + # Config $config + # Registry $registry + # Aliasdata $alias + + __construct() + + set() : bool + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Utilities +> namespace VDM\Joomla\Componentbuilder\Compiler\Utilities +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities #LightGreen { + + + abstract FieldHelper #Orange { + + {static} check() : bool + } + + abstract Indent #Orange { + + {static} _() : string + - {static} indent() : string + - {static} init() : void + } + + abstract Line #Orange { + - static $add + + {static} _() : string + - {static} add() : bool + - {static} init() : void + } + + abstract Minify #Orange { + + {static} js() : string + + {static} css() : string + } + + abstract Placefix #Orange { + + {static} _() : string + + {static} b() : string + + {static} d() : string + + {static} _h() : string + + {static} h() : string + } + + abstract Unique #Orange { + + {static} get() : string + + {static} code() : string + } + + class Counter #Gold { + + int $folder + + int $file + + int $page + + int $line + + int $field + # int $seconds + # float $actualSeconds + # int $folderSeconds + # int $fileSeconds + # int $lineSeconds + # float $secondsDebugging + # float $secondsPlanning + # float $secondsMapping + # float $secondsOffice + # int $totalHours + # int $debuggingHours + # int $planningHours + # int $mappingHours + # int $officeHours + # int $actualTotalHours + # int $actualHoursSpent + # int $actualDaysSpent + # int $totalDays + # int $actualTotalDays + # float $projectWeekTime + # float $projectMonthTime + # float $start + # float $end + # float $timer + # Content $content + + __construct() + + start() : void + + end() : void + + set() : void + # calculate() : void + } + + class Dynamicpath #Gold { + # Placeholder $placeholder + # array $paths + + __construct() + + update() : string + } + + class File #Gold { + # Counter $counter + # Paths $paths + + __construct() + + html() : void + + write() : bool + } + + class Folder #Gold { + # Counter $counter + # File $file + + __construct() + + create() : void + + remove() : bool + } + + class Pathfix #Gold { + + set() : void + } + + class Paths #Gold { + # Config $config + # Component $component + + __construct() + + __get() : string + # key() : string + - setTemplatePath() : void + - setComponentSalesName() : void + - setComponentBackupName() : void + - setComponentFolderName() : void + - setComponentPath() : void + - setTemplatePathCustom() : void + } + + class Structure #Gold { + # Settings $settings + # Paths $paths + # Counter $counter + # File $file + # Files $files + # CMSApplication $app + + __construct() + + build() : bool + - getFileDetails() : ?array + - getPath() : ?string + - getNewName() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Builder Update +> namespace VDM\Joomla\Componentbuilder\Compiler\Builder\Update +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder\Update #DeepSkyBlue { + + + class Mysql #Gold { + # key() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Customcode Extractor +> namespace VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor #DeepSkyBlue { + + + class Paths #Gold { + + array $active + # array $componentPlaceholder + # Config $config + # Placeholder $placeholder + # Customcode $customcode + # Extractor $extractor + # \JDatabaseDriver $db + + __construct() + # load() : void + # getModuleIDs() : mixed + # getModulePath() : mixed + # getPluginIDs() : mixed + # getPluginPath() : mixed + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Extension JoomlaThree +> namespace VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree #DeepSkyBlue { + + + class InstallScript #Gold { + # object $extension + # array $methods + # array $types + # array $construct + # array $install + # array $update + # array $uninstall + # bool $preflightActive + # bool $postflightActive + + get() : string + # build() : string + # head() : string + # construct() : string + # main() : string + # flight() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Field JoomlaThree +> namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree #DeepSkyBlue { + + + class CoreValidation #Gold { + # ?array $rules + # string $path + + __construct() + + get() : array + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Interfaces Component +> namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component #DeepSkyBlue { + + + interface PlaceholderInterface #Lavender { + + get() : array + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Interfaces Customcode +> namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode #DeepSkyBlue { + + + interface DispenserInterface #Lavender { + + set() : bool + + get() : mixed + } + + interface ExternalInterface #Lavender { + + set() : string + } + + interface ExtractorInterface #Lavender { + + run() : void + } + + interface GuiInterface #Lavender { + + set() : string + + search() : void + } + + interface LockBaseInterface #Lavender { + + set() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Interfaces Extension +> namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension #DeepSkyBlue { + + + interface InstallInterface #Lavender { + + getOfficialName() : string + + getClassName() : string + + getInstallerClassName() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Interfaces Field +> namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field #DeepSkyBlue { + + + interface CoreValidationInterface #Lavender { + + get() : array + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Power Repo +> namespace VDM\Joomla\Componentbuilder\Compiler\Power\Repo +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Power\Repo #DeepSkyBlue { + + + class Readme #Gold { + # Power $power + # Plantuml $plantuml + + __construct() + + get() : string + } +} + + +@enduml +``` + +## VDM Joomla Componentbuilder Compiler Power Repos +> namespace VDM\Joomla\Componentbuilder\Compiler\Power\Repos +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Compiler\Power\Repos #DeepSkyBlue { + + + class Readme #Gold { + # Power $power + # Plantuml $plantuml + + __construct() + + get() : string + - readmeBuilder() : string + - readmeModel() : string + - generateIndex() : string + - generateDiagramBucket() : string + - defineTypeOrder() : array + - sortClasses() : void + - compareNamespace() : int + - compareType() : int + - compareName() : int + - generateNamespaceDiagram() : string + - indexLinkPower() : string + - linkPowerRepo() : string + - linkPowerCode() : string + - linkPowerSettings() : string + - linkPowerGuid() : string + } +} + + +@enduml +``` + + +--- +``` + ██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗ + ██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗ + ██║██║ ██║██║ ██║██╔████╔██║██║ ███████║ +██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║ +╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║ + ╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ + ██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗ +██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝ +██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ +██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ +╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ + ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ +██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ +██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗ +██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝ +██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗ +██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║ +╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md new file mode 100644 index 0000000..531cef0 --- /dev/null +++ b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/README.md @@ -0,0 +1,134 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Extractor (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode** +```uml +@startuml +class Extractor #Gold { + # array $existing + # array $new + # array $done + # array $counter + # array $fileTypes + # array $placeholders + # string $today + # Config $config + # Gui $gui + # Paths $paths + # Reverse $reverse + # Placeholder $componentPlaceholder + # Pathfix $pathfix + # User $user + # \JDatabaseDriver $db + # CMSApplication $app + + __construct(?Config $config = null, ?Gui $gui = null, ...) + + run() : void + # searchFileContent(string $file, $target) : array + # insert(int $when = 1) : void + # update(int $when = 1) : void + # setStartReplace(int $id, int $commentType, ...) : string + # addLineChecker(string $replaceKey, int $type, ...) : bool|int + # getSystemID(string $lineContent, array $placeholders, ...) : mixed +} + +note right of Extractor::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?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 +end note + +note left of Extractor::run + get the custom code from the local files + + since: 3.2.0 + return: void +end note + +note right of Extractor::searchFileContent + search a file for placeholders and store result + + since: 3.2.0 + return: array +end note + +note left of Extractor::insert + Insert the code + + since: 3.2.0 + return: void +end note + +note right of Extractor::update + Update the code + + since: 3.2.0 + return: void +end note + +note left of Extractor::setStartReplace + set the start replace placeholder + + since: 3.2.0 + return: string + + arguments: + int $id + int $commentType + string $startReplace +end note + +note right of Extractor::addLineChecker + Check if this line should be added + + since: 3.2.0 + return: bool|int + + arguments: + string $replaceKey + int $type + string $lineContent +end note + +note left of Extractor::getSystemID + search for the system id in the line given + + since: 3.2.0 + return: mixed + + arguments: + string $lineContent + array $placeholders + int $commentType +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php new file mode 100644 index 0000000..bc52c68 --- /dev/null +++ b/src/01411bb1-fdd6-4cca-84d7-1b62d93c70c1/code.php @@ -0,0 +1,930 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +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 VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\ExtractorInterface; + + +/** + * Compiler Custom Code Extractor + * + * The custom script placeholders - we use the (xxx) to avoid detection it should be (***) + * ##################################---> PHP/JS ---#################################### + * + * New Insert Code = /xxx[INSERT>$$$$]xxx/ /xxx[/INSERT>$$$$]xxx/ + * New Replace Code = /xxx[REPLACE>$$$$]xxx/ /xxx[/REPLACE>$$$$]xxx/ + * + * //////////////////////////////// when JCB adds it back ////////////////////////////////// + * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//xx23xx/ /xxx[/INSERTED$$$$]xxx/ + * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//xx25xx/ /xxx[/REPLACED$$$$]xxx/ + * + * /////////////////////////////// changeing existing custom code ///////////////////////// + * Update Inserted Code = /xxx[INSERTED>$$$$]xxx//xx23xx/ /xxx[/INSERTED>$$$$]xxx/ + * Update Replaced Code = /xxx[REPLACED>$$$$]xxx//xx25xx/ /xxx[/REPLACED>$$$$]xxx/ + * + * The custom script placeholders - we use the (==) to avoid detection it should be (--) + * ###################################---> HTML ---##################################### + * + * New Insert Code = !==[INSERT>$$$$]==> !==[/INSERT>$$$$]==> + * New Replace Code = !==[REPLACE>$$$$]==> !==[/REPLACE>$$$$]==> + * + * ///////////////////////////////// when JCB adds it back /////////////////////////////// + * JCB Add Inserted Code = + * JCB Add Replaced Code = + * + * //////////////////////////// changeing existing custom code /////////////////////////// + * Update Inserted Code = !==[INSERTED>$$$$]==> !==[/INSERTED>$$$$]==> + * Update Replaced Code = !==[REPLACED>$$$$]==> !==[/REPLACED>$$$$]==> + * + * ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * More info read: https://git.vdm.dev/joomla/Component-Builder/wiki/TIPS:-Custom-Code + * + * @since 3.2.0 + */ +class Extractor implements ExtractorInterface +{ + /** + * The placeholder keys + * + * @var array + * @since 3.2.0 + */ + protected array $PKeys + = [ + 1 => 'REPLACE<>$$$$]', + 2 => 'INSERT<>$$$$]', + 3 => 'REPLACED<>$$$$]', + 4 => 'INSERTED<>$$$$]' + ]; + + /** + * The custom code in local files that already exist in system + * + * @var array + * @since 3.2.0 + */ + protected array $existing = []; + + /** + * The custom code in local files that are new + * + * @var array + * @since 3.2.0 + */ + protected array $new = []; + + /** + * The index of code already loaded + * + * @var array + * @since 3.2.0 + */ + protected array $done = []; + + /** + * The search counter + * + * @var array + * @since 3.2.0 + */ + protected array $counter = [1 => 0, 2 => 0]; + + /** + * The file types to search + * + * @var array + * @since 3.2.0 + */ + protected array $fileTypes = ['\.php', '\.js', '\.xml']; + + /** + * The local placeholders + * + * @var array + * @since 3.2.0 + */ + protected array $placeholders; + + /** + * Today's date in SQL format + * + * @var string + * @since 3.2.0 + */ + protected string $today; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Customcode Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Customcode Extractor Paths + * + * @var Paths + * @since 3.2.0 + **/ + protected Paths $paths; + + /** + * Compiler Placeholder Reverse + * + * @var Reverse + * @since 3.2.0 + **/ + protected Reverse $reverse; + + /** + * Compiler Component Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $componentPlaceholder; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Current User Object + * + * @var User + * @since 3.2.0 + **/ + protected User $user; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Gui|null $gui The compiler customcode gui object. + * @param Paths|null $paths The compiler customcode extractor paths object. + * @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) + { + $this->config = $config ?: Compiler::_('Config'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->paths = $paths ?: Compiler::_('Customcode.Extractor.Paths'); + $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(); + + // set today's date + $this->today = Factory::getDate()->toSql(); + + // set some local placeholders + $placeholders = array_flip( + $this->componentPlaceholder->get() + ); + + $placeholders[StringHelper::safe( + $this->config->component_code_name, 'F' + ) . 'Helper::'] = Placefix::_('Component') . 'Helper::'; + + $placeholders['COM_' . StringHelper::safe( + $this->config->component_code_name, 'U' + )] = 'COM_' . Placefix::_('COMPONENT'); + + $placeholders['com_' . $this->config->component_code_name] = 'com_' . Placefix::_('component'); + + // set the local placeholders + $this->placeholders = array_reverse($placeholders, true); + } + + /** + * get the custom code from the local files + * + * @return void + * @since 3.2.0 + */ + public function run() + { + // we must first store the current working directory + $joomla = getcwd(); + + foreach ($this->paths->active as $target => $path) + { + // we are changing the working directory to the component path + chdir($path); + foreach ($this->fileTypes as $type) + { + // get a list of files in the current directory tree (only PHP, JS and XML for now) + $files = Folder::files('.', $type, true, true); + + // check if files found + if (ArrayHelper::check($files)) + { + foreach ($files as $file) + { + // search the file + $this->searchFileContent($file, $target); + + // insert new code + $this->insert(100); + + // update existing custom code + $this->update(30); + } + } + } + } + + // change back to Joomla working directory + chdir($joomla); + + // make sure all code is stored + $this->insert(); + // update existing custom code + $this->update(); + } + + /** + * search a file for placeholders and store result + * + * @param string $file The file path to search + * + * @return array on success + * @since 3.2.0 + */ + protected function searchFileContent(&$file, &$target) + { + // we add a new search for the GUI CODE Blocks + $this->gui->search($file, $this->placeholders, $this->today, $target); + + // reset each time per file + $loadEndFingerPrint = false; + $endFingerPrint = []; + $fingerPrint = []; + $codeBucket = []; + $pointer = []; + $reading = []; + $reader = 0; + + // reset found Start type + $commentType = 0; + + // make sure we have the path correct (the script file is not in admin path for example) + // there may be more... will nead to keep our eye on this... since files could be moved during install + $file = str_replace('./', '', (string) $file); # TODO (windows path issues) + $path = $file !== 'script.php' ? $target . '/' . $file : $file; + + // now we go line by line + foreach (new \SplFileObject($file) as $lineNumber => $lineContent) + { + // we must keep last few lines to dynamic find target entry later + $fingerPrint[$lineNumber] = trim($lineContent); + + // load the end fingerprint + if ($loadEndFingerPrint) + { + $endFingerPrint[$lineNumber] = trim($lineContent); + } + + foreach ($this->PKeys as $type => $search) + { + $i = (int) ($type == 3 || $type == 4) ? 2 : 1; + $_type = (int) ($type == 1 || $type == 3) ? 1 : 2; + + if ($reader === 0 || $reader === $i) + { + $targetKey = $type; + + $start = '/***[' . $search . '***/'; + $end = '/***[/' . $search . '***/'; + $startHTML = ''; + $endHTML = ''; + + // check if the ending placeholder was found + if (isset($reading[$targetKey]) && $reading[$targetKey] + && ((trim((string) $lineContent) === $end + || strpos((string) $lineContent, $end) !== false) + || (trim((string) $lineContent) === $endHTML + || strpos((string) $lineContent, $endHTML) !== false))) + { + // trim the placeholder and if there is still data then load it + if (isset($endReplace) + && ($_line = $this->addLineChecker($endReplace, 2, $lineContent)) !== false) + { + $codeBucket[$pointer[$targetKey]][] = $_line; + } + + // deactivate the reader + $reading[$targetKey] = false; + + if ($_type == 2) + { + // deactivate search + $reader = 0; + } + else + { + // activate fingerPrint for replacement end target + $loadEndFingerPrint = true; + $backupTargetKey = $targetKey; + $backupI = $i; + } + + // all new records we can do a bulk insert + if ($i === 1) + { + // end the bucket info for this code block + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $lineNumber + ); // 'toline' + + // first reverse engineer this code block + $c0de = $this->reverse->engine( + implode('', $codeBucket[$pointer[$targetKey]]), + $this->placeholders, $target + ); + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + base64_encode((string) $c0de) + ); // 'code' + + if ($_type == 2) + { + // load the last value + $this->new[$pointer[$targetKey]][] + = $this->db->quote(0); // 'hashendtarget' + } + } + // the record already exist so we must update instead + elseif ($i === 2) + { + // end the bucket info for this code block + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('to_line') . ' = ' + . $this->db->quote($lineNumber); + + // first reverse engineer this code block + $c0de = $this->reverse->engine( + implode('', $codeBucket[$pointer[$targetKey]]), + $this->placeholders, $target, + $this->existing[$pointer[$targetKey]]['id'] + ); + + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('code') . ' = ' + . $this->db->quote(base64_encode((string) $c0de)); + + if ($_type == 2) + { + // load the last value + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') + . ' = ' . $this->db->quote(0); + } + } + } + + // check if the endfingerprint is ready to save + if (count((array) $endFingerPrint) === 3) + { + $hashendtarget = '3__' . md5( + implode('', $endFingerPrint) + ); + + // all new records we can do a bulk insert + if ($i === 1) + { + // load the last value + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $hashendtarget + ); // 'hashendtarget' + } + // the record already exist so we must update + elseif ($i === 2) + { + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') . ' = ' + . $this->db->quote($hashendtarget); + } + + // reset the needed values + $endFingerPrint = []; + $loadEndFingerPrint = false; + + // deactivate reader (to allow other search) + $reader = 0; + } + + // then read in the code + if (isset($reading[$targetKey]) && $reading[$targetKey]) + { + $codeBucket[$pointer[$targetKey]][] = $lineContent; + } + + // see if the custom code line starts now with PHP/JS comment type + if ((!isset($reading[$targetKey]) || !$reading[$targetKey]) + && (($i === 1 && trim((string) $lineContent) === $start) + || strpos((string) $lineContent, $start) !== false)) + { + $commentType = 1; // PHP/JS type + $startReplace = $start; + $endReplace = $end; + } + // see if the custom code line starts now with HTML comment type + elseif ((!isset($reading[$targetKey]) + || !$reading[$targetKey]) + && (($i === 1 && trim((string) $lineContent) === $startHTML) + || strpos((string) $lineContent, $startHTML) !== false)) + { + $commentType = 2; // HTML type + $startReplace = $startHTML; + $endReplace = $endHTML; + } + + // check if the starting place holder was found + if ($commentType > 0) + { + // if we have all on one line we have a problem (don't load it TODO) + if (strpos((string) $lineContent, (string) $endReplace) !== false) + { + // reset found comment type + $commentType = 0; + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE'), + 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS', + $path + ), 'Warning' + ); + continue; + } + + // do a quick check to insure we have an id + $id = false; + if ($i === 2) + { + $id = $this->getSystemID( + $lineContent, + array(1 => $start, 2 => $startHTML), + $commentType + ); + } + + if ($i === 2 && $id > 0) + { + // make sure we update it only once even if found again. + if (isset($this->done[$id])) + { + // reset found comment type + $commentType = 0; + continue; + } + // store the id to avoid duplication + $this->done[$id] = (int) $id; + } + + // start replace + $startReplace = $this->setStartReplace( + $id, $commentType, $startReplace + ); + + // set active reader (to lock out other search) + $reader = $i; + + // set pointer + $pointer[$targetKey] = $this->counter[$i]; + + // activate the reader + $reading[$targetKey] = true; + + // start code bucket + $codeBucket[$pointer[$targetKey]] = []; + + // trim the placeholder and if there is still data then load it + if ($_line = $this->addLineChecker( + $startReplace, 1, $lineContent + )) + { + $codeBucket[$pointer[$targetKey]][] = $_line; + } + + // get the finger print around the custom code + $inFinger = count($fingerPrint); + $getFinger = $inFinger - 1; + $hasharray = array_slice( + $fingerPrint, -$inFinger, $getFinger, true + ); + $hasleng = count($hasharray); + $hashtarget = $hasleng . '__' . md5( + implode('', $hasharray) + ); + + // for good practice + $this->pathfix->set($path); + + // all new records we can do a bulk insert + if ($i === 1 || !$id) + { + // start the bucket for this code + $this->new[$pointer[$targetKey]] = []; + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $path + ); // 'path' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $_type + ); // 'type' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'target' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $commentType + ); // 'comment_type' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $this->config->component_id + ); // 'component' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'published' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $this->today + ); // 'created' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $this->user->id + ); // 'created_by' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'version' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'access' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $hashtarget + ); // 'hashtarget' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $lineNumber + ); // 'fromline' + + } + // the record already exist so we must update instead + elseif ($i === 2 && $id > 0) + { + // start the bucket for this code + $this->existing[$pointer[$targetKey]] = []; + $this->existing[$pointer[$targetKey]]['id'] + = (int) $id; + $this->existing[$pointer[$targetKey]]['conditions'] = []; + $this->existing[$pointer[$targetKey]]['conditions'][] + = $this->db->quoteName('id') . ' = ' + . $this->db->quote($id); + $this->existing[$pointer[$targetKey]]['fields'] = []; + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('path') . ' = ' + . $this->db->quote($path); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('type') . ' = ' + . $this->db->quote($_type); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('comment_type') . ' = ' + . $this->db->quote($commentType); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('component') . ' = ' + . $this->db->quote($this->config->component_id); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('from_line') . ' = ' + . $this->db->quote($lineNumber); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('modified') . ' = ' + . $this->db->quote($this->today); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('modified_by') . ' = ' + . $this->db->quote($this->user->id); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashtarget') . ' = ' + . $this->db->quote($hashtarget); + } + else // this should actualy never happen + { + // de activate the reader + $reading[$targetKey] = false; + $reader = 0; + } + + // reset found comment type + $commentType = 0; + // update the counter + $this->counter[$i]++; + } + } + } + + // make sure only a few lines is kept at a time + if (count((array) $fingerPrint) > 10) + { + $fingerPrint = array_slice($fingerPrint, -6, 6, true); + } + } + + // if the code is at the end of the page and there were not three more lines + if (count((array) $endFingerPrint) > 0 || $loadEndFingerPrint) + { + if (count((array) $endFingerPrint) > 0) + { + $leng = count($endFingerPrint); + $hashendtarget = $leng . '__' . md5( + implode('', $endFingerPrint) + ); + } + else + { + $hashendtarget = 0; + } + + // all new records we can do a buldk insert + if ($backupI === 1) + { + // load the last value + $this->new[$pointer[$backupTargetKey]][] + = $this->db->quote($hashendtarget); // 'hashendtarget' + } + // the record already exist so we must use module to update + elseif ($backupI === 2) + { + $this->existing[$pointer[$backupTargetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') . ' = ' + . $this->db->quote($hashendtarget); + } + } + } + + /** + * Insert the code + * + * @param int $when To set when to update + * + * @return void + * @since 3.2.0 + */ + protected function insert(int $when = 1) + { + if (ArrayHelper::check($this->new) >= $when) + { + // Create a new query object. + $query = $this->db->getQuery(true); + $continue = false; + // Insert columns. + $columns = array('path', 'type', 'target', 'comment_type', + 'component', 'published', 'created', 'created_by', + 'version', 'access', 'hashtarget', 'from_line', + 'to_line', 'code', 'hashendtarget'); + // Prepare the insert query. + $query->insert( + $this->db->quoteName('#__componentbuilder_custom_code') + ); + $query->columns($this->db->quoteName($columns)); + foreach ($this->new as $values) + { + if (count((array) $values) == 15) + { + $query->values(implode(',', $values)); + $continue = true; + } + else + { + // TODO line mismatch... should not happen + } + } + // clear the values array + $this->new = []; + if (!$continue) + { + return; // insure we don't continue if no values were loaded + } + // Set the query using our newly populated query object and execute it. + $this->db->setQuery($query); + $this->db->execute(); + } + } + + /** + * Update the code + * + * @param int $when To set when to update + * + * @return void + * @since 3.2.0 + */ + protected function update(int $when = 1) + { + if (ArrayHelper::check($this->existing) >= $when) + { + foreach ($this->existing as $code) + { + // Create a new query object. + $query = $this->db->getQuery(true); + // Prepare the update query. + $query->update( + $this->db->quoteName('#__componentbuilder_custom_code') + )->set($code['fields'])->where($code['conditions']); + // Set the query using our newly populated query object and execute it. + $this->db->setQuery($query); + $this->db->execute(); + } + // clear the values array + $this->existing = []; + } + } + + /** + * set the start replace placeholder + * + * @param int $id The comment id + * @param int $commentType The comment type + * @param string $startReplace The main replace string + * + * @return string on success + * @since 3.2.0 + */ + protected function setStartReplace(int $id, int $commentType, string $startReplace): string + { + if ($id > 0) + { + switch ($commentType) + { + case 1: // the PHP & JS type + $startReplace .= '/*' . $id . '*/'; + break; + case 2: // the HTML type + $startReplace .= ''; + break; + } + } + + return $startReplace; + } + + /** + * Check if this line should be added + * + * @param string $replaceKey The key to remove from line + * @param int $type The line type + * @param string $lineContent The line to check + * + * @return bool|int true on success + * @since 3.2.0 + */ + protected function addLineChecker(string $replaceKey, int $type, string $lineContent) + { + $check = explode($replaceKey, $lineContent); + switch ($type) + { + case 1: + // beginning of code + if (isset($check[1]) && StringHelper::check($check[1])) + { + return trim($check[1]); + } + break; + case 2: + // end of code + if (isset($check[0]) && StringHelper::check($check[0])) + { + return trim($check[0]); + } + break; + } + + return false; + } + + /** + * search for the system id in the line given + * + * @param string $lineContent The file path to search + * @param array $placeholders The values to search for + * @param int $commentType The comment type + * + * @return mixed on success + * @since 3.2.0 + */ + protected function getSystemID(string &$lineContent, array $placeholders, int $commentType) + { + $trim = '/'; + if ($commentType == 2) + { + $trim = ' 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", + "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;" +} \ No newline at end of file diff --git a/src/037c7274-fb16-455d-989a-bf1da022620b/README.md b/src/037c7274-fb16-455d-989a-bf1da022620b/README.md new file mode 100644 index 0000000..e50e0f9 --- /dev/null +++ b/src/037c7274-fb16-455d-989a-bf1da022620b/README.md @@ -0,0 +1,47 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customimportscripts (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Customimportscripts #Gold { + # array $areas + # array $guiMapper + # Dispenser $dispenser + + __construct(?Dispenser $dispenser = null) + + set(object $item, string $table = 'admin_view') : void +} + +note right of Customimportscripts::__construct + Constructor + + since: 3.2.0 +end note + +note right of Customimportscripts::set + Set Custom Import Scripts + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/037c7274-fb16-455d-989a-bf1da022620b/code.php b/src/037c7274-fb16-455d-989a-bf1da022620b/code.php new file mode 100644 index 0000000..baa5ca3 --- /dev/null +++ b/src/037c7274-fb16-455d-989a-bf1da022620b/code.php @@ -0,0 +1,132 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\Component\Helper; + + +/** + * Model Custom Import Scripts Class + * + * @since 3.2.0 + */ +class Customimportscripts +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = [ + 'php_import_ext', + 'php_import_display', + 'php_import', + 'php_import_setdata', + 'php_import_save', + 'php_import_headers', + 'html_import_view' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'admin_view', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Set Custom Import Scripts + * + * @param object $item The item data + * @param string $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'admin_view') + { + // set custom import scripts + if (isset($item->add_custom_import) + && $item->add_custom_import == 1) + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + foreach ($this->areas as $area) + { + if (isset($item->$area) + && StringHelper::check($item->$area)) + { + // update GUI mapper field + $this->guiMapper['field'] = $area; + $this->guiMapper['type'] = 'php'; + + // Make sure html gets HTML comment for placeholder + if ('html_import_view' === $area) + { + $this->guiMapper['type'] = 'html'; + } + + $this->dispenser->set( + $item->$area, + $area, + 'import_' . $item->name_list_code, + null, + $this->guiMapper + ); + + unset($item->$area); + } + else + { + // load the default TODO: convert getDynamicScripts to a class + $this->dispenser->hub[$area]['import_' . $item->name_list_code] + = Helper::_('getDynamicScripts', [$area, true]); + } + } + } + } + +} + diff --git a/src/037c7274-fb16-455d-989a-bf1da022620b/settings.json b/src/037c7274-fb16-455d-989a-bf1da022620b/settings.json new file mode 100644 index 0000000..66a2f59 --- /dev/null +++ b/src/037c7274-fb16-455d-989a-bf1da022620b/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "037c7274-fb16-455d-989a-bf1da022620b", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Customimportscripts", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Customimportscripts", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection3": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Customimportscripts", + "description": "Model Custom Import Scripts Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md new file mode 100644 index 0000000..9b41647 --- /dev/null +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/README.md @@ -0,0 +1,113 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Infusion (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power** +```uml +@startuml +class Infusion #Gold { + # Config $config + # Power $power + # Content $content + # Autoloader $autoloader + # Parser $parser + # RepoReadme $reporeadme + # ReposReadme $reposreadme + # Placeholder $placeholder + # Event $event + # array $linker + + __construct(?Config $config = null, ?Power $power = null, ...) + + set() : void + - parsePowers() : void + - setSuperPowers() : void + - setPowers() : void + - index(array $powers) : string + - code(object $power) : string + - linker(object $power) : string +} + +note right of Infusion::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Power $power = null + ?Content $content = null + ?Autoloader $autoloader = null + ?Parser $parser = null + ?RepoReadme $reporeadme = null + ?ReposReadme $reposreadme = null + ?Placeholder $placeholder = null + ?Event $event = null +end note + +note left of Infusion::set + Infuse the powers data with the content + + since: 3.2.0 + return: void +end note + +note right of Infusion::parsePowers + We parse the powers to get the class map of all methods + + since: 3.2.0 + return: void +end note + +note left of Infusion::setSuperPowers + Set the Super Powers details + + since: 3.2.0 + return: void +end note + +note right of Infusion::setPowers + Set the Powers code + + since: 3.2.0 + return: void +end note + +note left of Infusion::index + Build the Super Power Index + + since: 3.2.0 + return: string +end note + +note right of Infusion::code + Get the Power code + + since: 3.2.0 + return: string +end note + +note left of Infusion::linker + Get the Power Linker + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php new file mode 100644 index 0000000..0656a9a --- /dev/null +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php @@ -0,0 +1,393 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Power; +use VDM\Joomla\Componentbuilder\Compiler\Content; +use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader; +use VDM\Joomla\Componentbuilder\Compiler\Power\Parser; +use VDM\Joomla\Componentbuilder\Compiler\Power\Repo\Readme as RepoReadme; +use VDM\Joomla\Componentbuilder\Compiler\Power\Repos\Readme as ReposReadme; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Compiler Power Infusion + * @since 3.2.0 + */ +class Infusion +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Power Objects + * + * @var Power + * @since 3.2.0 + **/ + protected Power $power; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Compiler Powers Autoloader + * + * @var Autoloader + * @since 3.2.0 + **/ + protected Autoloader $autoloader; + + /** + * Compiler Powers Parser + * + * @var Parser + * @since 3.2.0 + **/ + protected Parser $parser; + + /** + * Compiler Powers Repo Readme Builder + * + * @var RepoReadme + * @since 3.2.0 + **/ + protected RepoReadme $reporeadme; + + /** + * Compiler Powers Repos Readme Builder + * + * @var ReposReadme + * @since 3.2.0 + **/ + protected ReposReadme $reposreadme; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Event + * + * @var Event + * @since 3.2.0 + **/ + protected Event $event; + + /** + * Power linker values + * + * @var array + * @since 3.2.0 + **/ + protected array $linker = [ + 'add_head' => 'add_head', + 'unchanged_composer' => 'composer', + 'unchanged_description' => 'description', + 'extends' => 'extends', + 'extends_custom' => 'extends_custom', + 'guid' => 'guid', + 'unchanged_head' => 'head', + 'use_selection' => 'use_selection', + 'implements' => 'implements', + 'implements_custom' => 'implements_custom', + 'load_selection' => 'load_selection', + 'name' => 'name', + 'power_version' => 'power_version', + 'system_name' => 'system_name', + 'type' => 'type', + 'unchanged_namespace' => 'namespace' + ]; + + /** + * Constructor. + * + * @param Config|null $config The Config object. + * @param Power|null $power The power object. + * @param Content|null $content The compiler content object. + * @param Autoloader|null $autoloader The powers autoloader object. + * @param Parser|null $parser The powers parser object. + * @param RepoReadme|null $reporeadme The powers repo readme builder object. + * @param ReposReadme|null $reposreadme The powers repos readme builder object. + * @param Placeholder|null $placeholder The placeholder object. + * @param Event|null $event The events object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Power $power = null, ?Content $content = null, + ?Autoloader $autoloader = null, ?Parser $parser = null, ?RepoReadme $reporeadme = null, + ?ReposReadme $reposreadme = null, ?Placeholder $placeholder = null, ?Event $event = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->power = $power ?: Compiler::_('Power'); + $this->content = $content ?: Compiler::_('Content'); + $this->autoloader = $autoloader ?: Compiler::_('Power.Autoloader'); + $this->parser = $parser ?: Compiler::_('Power.Parser'); + $this->reporeadme = $reporeadme ?: Compiler::_('Power.Repo.Readme'); + $this->reposreadme = $reposreadme ?: Compiler::_('Power.Repos.Readme'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->event = $event ?: Compiler::_('Event'); + } + + /** + * Infuse the powers data with the content + * + * @return void + * @since 3.2.0 + */ + public function set() + { + // parse all powers main code + $this->parsePowers(); + + // set the powers + $this->setSuperPowers(); + + // set the powers + $this->setPowers(); + } + + /** + * We parse the powers to get the class map of all methods + * + * @return void + * @since 3.2.0 + */ + private function parsePowers() + { + // we only do this if super powers are active + if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) + { + foreach ($this->power->active as $n => &$power) + { + if (ObjectHelper::check($power) && isset($power->main_class_code) && + StringHelper::check($power->main_class_code)) + { + // only parse those approved + if ($power->approved == 1) + { + $power->main_class_code = $this->placeholder->update($power->main_class_code, $this->content->active); + $power->parsed_class_code = $this->parser->code($power->main_class_code); + } + } + } + } + } + + /** + * Set the Super Powers details + * + * @return void + * @since 3.2.0 + */ + private function setSuperPowers() + { + // 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) + ); + + // POWERREADME + $this->content->set_($key, 'POWERREADME', $this->reposreadme->get($powers)); + + // POWERINDEX + $this->content->set_($key, 'POWERINDEX', $this->index($powers)); + + // Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails + $this->event->trigger( + 'jcb_ce_onAfterInfuseSuperPowerDetails', + array(&$context, &$path, &$key, &$powers) + ); + } + } + } + + /** + * Set the Powers code + * + * @return void + * @since 3.2.0 + */ + private function setPowers() + { + // 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) + ); + + // POWERCODE + $this->content->set_($power->key, 'POWERCODE', $this->code($power)); + + // POWERLINKER + $this->content->set_($power->key, 'POWERLINKER', $this->linker($power)); + + // POWERLINKER + $this->content->set_($power->key, 'POWERREADME', $this->reporeadme->get($power)); + + // Trigger Event: jcb_ce_onAfterInfusePowerData + $this->event->trigger( + 'jcb_ce_onAfterInfusePowerData', + array(&$context, &$power) + ); + } + } + + // now set the power autoloader + $this->autoloader->set(); + } + } + + /** + * Build the Super Power Index + * + * @param array $powers All powers of this super power. + * + * @return string + * @since 3.2.0 + */ + private function index(array &$powers): string + { + return json_encode($powers, JSON_PRETTY_PRINT); + } + + /** + * Get the Power code + * + * @param object $power A power object. + * + * @return string + * @since 3.2.0 + */ + private function code(object &$power): string + { + $code = []; + + // set the name space + $code[] = 'namespace ' . $power->_namespace . ';' . PHP_EOL; + + // check if we have header data + if (StringHelper::check($power->head)) + { + $code[] = PHP_EOL . $power->head; + } + + // add description if set + if (StringHelper::check($power->description)) + { + // check if this is escaped + if (strpos((string) $power->description, '/*') === false) + { + // make this description escaped + $power->description = '/**' . PHP_EOL . ' * ' . implode(PHP_EOL . ' * ', explode(PHP_EOL, (string) $power->description)) . PHP_EOL . ' */'; + } + $code[] = PHP_EOL . $power->description; + } + + // build power declaration + $declaration = $power->type . ' ' . $power->class_name; + + // check if we have extends + if (StringHelper::check($power->extends_name)) + { + $declaration .= ' extends ' . $power->extends_name; + } + + // check if we have implements + if (ArrayHelper::check($power->implement_names)) + { + $declaration .= ' implements ' . implode(', ', $power->implement_names); + } + + $code[] = $declaration; + $code[] = '{'; + + // add the main code if set + if (StringHelper::check($power->main_class_code)) + { + $code[] = $power->main_class_code; + } + + $code[] = '}' . PHP_EOL; + + return $this->placeholder->update(implode(PHP_EOL, $code), $this->content->active); + } + + /** + * Get the Power Linker + * + * @param object $power A power object. + * + * @return string + * @since 3.2.0 + */ + private function linker(object &$power): string + { + $linker = []; + + // set the linking values + foreach ($power as $key => $value) + { + if (isset($this->linker[$key])) + { + $linker[$this->linker[$key]] = $value; + } + } + + return json_encode($linker, JSON_PRETTY_PRINT); + } + +} + diff --git a/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json new file mode 100644 index 0000000..7dfa76e --- /dev/null +++ b/src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json @@ -0,0 +1,69 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "0419081e-4cb3-4c65-8c6a-ffe941fb0f1c", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Infusion", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Infusion", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "as": "default" + }, + "use_selection3": { + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + }, + "use_selection4": { + "use": "6e64917c-d687-4ef3-a655-811319f5a81e", + "as": "default" + }, + "use_selection5": { + "use": "95d0e03f-24fd-4412-bc2e-f0899fcc3205", + "as": "default" + }, + "use_selection12": { + "use": "efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5", + "as": "RepoReadme" + }, + "use_selection6": { + "use": "0d08c583-04d5-454e-b756-48ca05e1651a", + "as": "ReposReadme" + }, + "use_selection7": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection8": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "Event" + }, + "use_selection9": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection10": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection11": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Infusion", + "description": "Compiler Power Infusion\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md b/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md new file mode 100644 index 0000000..f80b313 --- /dev/null +++ b/src/053803e6-1251-4aed-aefe-46a8e84198d2/README.md @@ -0,0 +1,90 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Paths (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor** +```uml +@startuml +class Paths #Gold { + + array $active + # array $componentPlaceholder + # Config $config + # Placeholder $placeholder + # Customcode $customcode + # Extractor $extractor + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Placeholder $placeholder = null, ...) + # load() : void + # getModuleIDs() : mixed + # getModulePath($id) : mixed + # getPluginIDs() : mixed + # getPluginPath($id) : mixed +} + +note right of Paths::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Placeholder $placeholder = null + ?ComponentPlaceholder $componentPlaceholder = null + ?Customcode $customcode = null + ?Extractor $extractor = null + ?\JDatabaseDriver $db = null +end note + +note right of Paths::load + get the local installed path of this component + + since: 3.2.0 + return: void +end note + +note right of Paths::getModuleIDs + get the Joomla Modules IDs + + since: 3.2.0 + return: mixed +end note + +note right of Paths::getModulePath + get the Joomla module path + + since: 3.2.0 + return: mixed +end note + +note right of Paths::getPluginIDs + get the Joomla plugins IDs + + since: 3.2.0 + return: mixed +end note + +note right of Paths::getPluginPath + get the Joomla plugin path + + return: mixed +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php b/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php new file mode 100644 index 0000000..6936554 --- /dev/null +++ b/src/053803e6-1251-4aed-aefe-46a8e84198d2/code.php @@ -0,0 +1,420 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as ComponentPlaceholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; + + +/** + * Compiler Custom Code Paths + * + * @since 3.2.0 + */ +class Paths +{ + /** + * The local paths + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * Compiler Component Placeholder + * + * @var array + * @since 3.2.0 + **/ + protected array $componentPlaceholder; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Language Extractor + * + * @var Extractor + * @since 3.2.0 + **/ + protected Extractor $extractor; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @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) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + /** @var ComponentPlaceholder $componentPlaceholder */ + $componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); + $this->db = $db ?: Factory::getDbo(); + + // load the placeholders to local array + $this->componentPlaceholder = $componentPlaceholder->get(); + + // load the paths on initialization + $this->load(); + } + + /** + * get the local installed path of this component + * + * @return void + * @since 3.2.0 + */ + protected function load() + { + // set the local paths to search + $local_paths = []; + + // admin path + $local_paths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' + . $this->config->component_code_name; + + // site path + $local_paths['site'] = JPATH_ROOT . '/components/com_' + . $this->config->component_code_name; + + // media path + $local_paths['media'] = JPATH_ROOT . '/media/com_' + . $this->config->component_code_name; + + // power path + $local_paths['power'] = JPATH_ROOT . '/' . $this->config->get('jcb_powers_path', 'libraries/jcb_powers'); + + // lets also go over the REPOS - TODO + + // Painful but we need to folder paths for the linked modules + if (($module_ids = $this->getModuleIDs()) !== false) + { + foreach ($module_ids as $module_id) + { + // get the module folder path + if (($path = $this->getModulePath($module_id)) !== false) + { + // set the path + $local_paths['module_' . str_replace('/', '_', (string) $path)] = $path; + } + } + } + + // Painful but we need to folder paths for the linked plugins + if (($plugin_ids = $this->getPluginIDs()) !== false) + { + foreach ($plugin_ids as $plugin_id) + { + // get the plugin group and folder name + if (($path = $this->getPluginPath($plugin_id)) !== false) + { + // set the path + $local_paths['plugin_' . str_replace('/', '_', (string) $path)] = JPATH_ROOT . '/plugins/' . $path; + } + } + } + + // check if the local install is found + foreach ($local_paths as $key => $localPath) + { + if (!Folder::exists($localPath)) + { + unset($local_paths[$key]); + } + } + + if (ArrayHelper::check($local_paths)) + { + $this->active = $local_paths; + } + } + + /** + * get the Joomla Modules IDs + * + * @return mixed of IDs on success + * @since 3.2.0 + */ + protected function getModuleIDs() + { + if (($addjoomla_modules = GetHelper::var( + 'component_modules', $this->config->component_id, 'joomla_component', + 'addjoomla_modules' + )) !== false) + { + $addjoomla_modules = (JsonHelper::check( + $addjoomla_modules + )) ? json_decode((string) $addjoomla_modules, true) : null; + + if (ArrayHelper::check($addjoomla_modules)) + { + $joomla_modules = array_filter( + array_values($addjoomla_modules), + // only load the modules whose target association call for it + fn($array): bool => !isset($array['target']) || $array['target'] != 2 + ); + // if we have values we return IDs + if (ArrayHelper::check($joomla_modules)) + { + return array_map( + fn($array) => (int) $array['module'], $joomla_modules + ); + } + } + } + + return false; + } + + /** + * get the Joomla module path + * + * @return mixed of module path and target site area on success + * @since 3.2.0 + */ + protected function getModulePath($id) + { + if (is_numeric($id) && $id > 0) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'a.name', + 'a.target' + ), array( + 'name', + 'target' + ) + ) + ); + // from these tables + $query->from('#__componentbuilder_joomla_module AS a'); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // get the module data + $module = $this->db->loadObject(); + // update the name if it has dynamic values + $module->name = $this->placeholder->update( + $this->customcode->update($module->name), + $this->componentPlaceholder + ); + + // set safe class function name + $module->code_name + = ClassfunctionHelper::safe( + $module->name + ); + // set module folder name + $module->folder_name = 'mod_' . strtolower((string) $module->code_name); + + // set the lang key + $this->extractor->langKeys[strtoupper($module->folder_name)] = + $module->id . '_M0dU|3'; + + // return the path + if ($module->target == 2) + { + // administrator client area + return JPATH_ADMINISTRATOR . '/modules/' + . $module->folder_name; + } + else + { + // default is the site client area + return JPATH_ROOT . '/modules/' . $module->folder_name; + } + } + } + + return false; + } + + /** + * get the Joomla plugins IDs + * + * @return mixed of IDs on success + * @since 3.2.0 + */ + protected function getPluginIDs() + { + if (($addjoomla_plugins = GetHelper::var( + 'component_plugins', $this->config->component_id, 'joomla_component', + 'addjoomla_plugins' + )) !== false) + { + $addjoomla_plugins = (JsonHelper::check( + $addjoomla_plugins + )) ? json_decode((string) $addjoomla_plugins, true) : null; + + if (ArrayHelper::check($addjoomla_plugins)) + { + $joomla_plugins = array_filter( + array_values($addjoomla_plugins), + function ($array) { + // only load the plugins whose target association call for it + if (!isset($array['target']) || $array['target'] != 2) + { + return true; + } + + return false; + } + ); + // if we have values we return IDs + if (ArrayHelper::check($joomla_plugins)) + { + return array_map( + fn($array) => (int) $array['plugin'], $joomla_plugins + ); + } + } + } + + return false; + } + + /** + * get the Joomla plugin path + * + * @return mixed of plugin path on success + * @deprecated 3.3 + */ + protected function getPluginPath($id) + { + if (is_numeric($id) && $id > 0) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'a.name', + 'g.name' + ), array( + 'name', + 'group' + ) + ) + ); + + // from these tables + $query->from('#__componentbuilder_joomla_plugin AS a'); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_group', 'g' + ) . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') + . ' = ' . $this->db->quoteName('g.id') . ')' + ); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + // get the plugin data + $plugin = $this->db->loadObject(); + + // update the name if it has dynamic values + $plugin->name = $this->placeholder->update( + $this->customcode->update($plugin->name), + $this->componentPlaceholder + ); + + // update the name if it has dynamic values + $plugin->code_name + = ClassfunctionHelper::safe( + $plugin->name + ); + + // set plugin folder name + $plugin->group = strtolower((string) $plugin->group); + // set plugin file name + $plugin->file_name = strtolower((string) $plugin->code_name); + + // set the lang key + $this->extractor->langKeys['PLG_' . strtoupper( + $plugin->group . '_' . $plugin->file_name + )] = $plugin->id . '_P|uG!n'; + + // return the path + return $plugin->group . '/' . $plugin->file_name; + } + } + + return false; + } + +} + diff --git a/src/053803e6-1251-4aed-aefe-46a8e84198d2/settings.json b/src/053803e6-1251-4aed-aefe-46a8e84198d2/settings.json new file mode 100644 index 0000000..67f0c28 --- /dev/null +++ b/src/053803e6-1251-4aed-aefe-46a8e84198d2/settings.json @@ -0,0 +1,58 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "053803e6-1251-4aed-aefe-46a8e84198d2", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Paths", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode.Extractor.Paths", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "30c5b4c2-f75f-4d15-869a-f8bfedd87358", + "as": "default" + }, + "use_selection4": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection5": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection6": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection7": { + "use": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", + "as": "ComponentPlaceholder" + }, + "use_selection8": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection9": { + "use": "d33b9278-c409-4aec-a047-b72f56712391", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.Extractor.Paths", + "description": "Compiler Custom Code Paths\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Filesystem\\Folder;" +} \ No newline at end of file diff --git a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md new file mode 100644 index 0000000..6f3e3d6 --- /dev/null +++ b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/README.md @@ -0,0 +1,68 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Dynamicget** +```uml +@startuml +class Data #Gold { + # array $guiMapper + # Config $config + # Registry $registry + # EventInterface $event + # Customcode $customcode + # Dispenser $dispenser + # Gui $gui + # Dynamicget $dynamic + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + get(array $ids, string $view_code, ...) : ?array +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Customcode $customcode = null + ?Dispenser $dispenser = null + ?Gui $gui = null + ?Dynamicget $dynamic = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get Dynamic Get Data + + since: 3.2.0 + return: ?array + + arguments: + array $ids + string $view_code + string $context +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php new file mode 100644 index 0000000..1d269f7 --- /dev/null +++ b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/code.php @@ -0,0 +1,324 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Dynamicget; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Model\Dynamicget; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Dynamic Get Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'dynamic_get', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Dynamicget Model + * + * @var Dynamicget + * @since 3.2.0 + */ + protected Dynamicget $dynamic; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Customcode|null $customcode The compiler customcode object. + * @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) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->dynamic = $dynamic ?: Compiler::_('Model.Dynamicget'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get Dynamic Get Data + * + * @param array $ids The ids of the dynamic get + * @param string $view_code The view code name + * @param string $context The context for events + * + * @return array|null array of object/s on success + * @since 3.2.0 + */ + public function get(array $ids, string $view_code, string $context): ?array + { + if ($ids === []) + { + return null; + } + + $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.*'); + $query->from('#__componentbuilder_dynamic_get AS a'); + $query->where('a.id IN (' . $ids . ')'); + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + $results = $this->db->loadObjectList(); + + foreach ($results as $_nr => &$result) + { + // Trigger Event: jcb_ce_onBeforeModelDynamicGetData + $this->event->trigger( + 'jcb_ce_onBeforeModelDynamicGetData', + array(&$component_context, &$result, &$result->id, &$view_code, &$context) + ); + + // set GUI mapper id + $this->guiMapper['id'] = (int) $result->id; + + // add calculations if set + if ($result->addcalculation == 1 + && StringHelper::check( + $result->php_calculation + )) + { + // set GUI mapper field + $guiMapper['field'] = 'php_calculation'; + $result->php_calculation = $this->gui->set( + $this->customcode->update( + base64_decode((string) $result->php_calculation) + ), + $this->guiMapper + ); + } + + // setup the router parse + if (isset($result->add_php_router_parse) + && $result->add_php_router_parse == 1 + && isset($result->php_router_parse) + && StringHelper::check( + $result->php_router_parse + )) + { + // set GUI mapper field + $this->guiMapper['field'] = 'php_router_parse'; + $result->php_router_parse = $this->gui->set( + $this->customcode->update( + base64_decode((string) $result->php_router_parse) + ), + $this->guiMapper + ); + } + else + { + $result->add_php_router_parse = 0; + } + + // The array of the php scripts that should be added to the script builder + $phpSripts = [ + 'php_before_getitem', + 'php_after_getitem', + 'php_before_getitems', + 'php_after_getitems', + 'php_getlistquery' + ]; + + // load the php scripts + foreach ($phpSripts as $script) + { + // add php script to the script builder + if (isset($result->{'add_' . $script}) + && $result->{'add_' . $script} == 1 + && isset($result->{$script}) + && StringHelper::check( + $result->{$script} + )) + { + // move all main gets out to the custom script builder + if ($result->gettype <= 2) + { + // set GUI mapper field + $this->guiMapper['field'] = $script; + $this->guiMapper['prefix'] = PHP_EOL . PHP_EOL; + $this->dispenser->set( + $result->{$script}, + $this->config->build_target . '_' . $script, + $view_code, + null, + $this->guiMapper, + true, + true, + true + ); + unset($this->guiMapper['prefix']); + // remove from local item + unset($result->{$script}); + unset($result->{'add_' . $script}); + } + else + { + // set GUI mapper field + $this->guiMapper['field'] = $script; + $this->guiMapper['prefix'] = PHP_EOL; + // only for custom gets + $result->{$script} = $this->gui->set( + $this->customcode->update( + base64_decode((string) $result->{$script}) + ), + $this->guiMapper + ); + unset($this->guiMapper['prefix']); + } + } + else + { + // remove from local item + unset($result->{$script}); + unset($result->{'add_' . $script}); + } + } + + // set the getmethod code name + $result->key = StringHelper::safe( + $view_code . ' ' . $result->name . ' ' . $result->id + ); + + // set the dynamic get + $this->dynamic->set($result, $view_code, $context); + + // load the events if any is set + if ($result->gettype == 1 + && JsonHelper::check( + $result->plugin_events + )) + { + $result->plugin_events = json_decode( + (string) $result->plugin_events, true + ); + } + else + { + $result->plugin_events = ''; + } + + // Trigger Event: jcb_ce_onAfterModelDynamicGetData + $this->event->trigger( + 'jcb_ce_onAfterModelDynamicGetData', + array(&$component_context, &$result, &$result->id, &$view_code, &$context) + ); + } + + return $results; + } + return null; + } + +} + diff --git a/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/settings.json b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/settings.json new file mode 100644 index 0000000..c9c7b61 --- /dev/null +++ b/src/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46/settings.json @@ -0,0 +1,58 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Dynamicget.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection4": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection5": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection6": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection7": { + "use": "79740ee8-4d10-4b51-9ff5-18e1386ec1c6", + "as": "default" + }, + "use_selection8": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection9": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Dynamicget.Data", + "description": "Dynamic Get Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md new file mode 100644 index 0000000..be459ba --- /dev/null +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/README.md @@ -0,0 +1,349 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Model (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Model #Gold { + + register(Container $container) : void + + getModelJoomlaplugins(Container $container) : Joomlaplugins + + getModelJoomlamodules(Container $container) : Joomlamodules + + getModelHistorycomponent(Container $container) : Historycomponent + + getModelCustomadminviews(Container $container) : Customadminviews + + getModelAjaxcustomview(Container $container) : Ajaxcustomview + + getModelJavascriptcustomview(Container $container) : Javascriptcustomview + + getModelCsscustomview(Container $container) : Csscustomview + + getModelPhpcustomview(Container $container) : Phpcustomview + + getModelDynamicget(Container $container) : Dynamicget + + getModelLibraries(Container $container) : Libraries + + getModelSiteviews(Container $container) : Siteviews + + getModelPermissions(Container $container) : Permissions + + getModelHistoryadminview(Container $container) : Historyadminview + + getModelMysqlsettings(Container $container) : Mysqlsettings + + getModelSql(Container $container) : Sql + + getModelCustomalias(Container $container) : Customalias + + getModelAjaxadmin(Container $container) : Ajaxadmin + + getModelCustomimportscripts(Container $container) : Customimportscripts + + getModelCustombuttons(Container $container) : Custombuttons + + getModelLoader(Container $container) : Loader + + getModelPhpadminview(Container $container) : Phpadminview + + getModelCssadminview(Container $container) : Cssadminview + + getModelJavascriptadminview(Container $container) : Javascriptadminview + + getModelLinkedviews(Container $container) : Linkedviews + + getModelRelations(Container $container) : Relations + + getModelConditions(Container $container) : Conditions + + getModelFields(Container $container) : Fields + + getModelUpdatesql(Container $container) : Updatesql + + getModelTabs(Container $container) : Tabs + + getModelCustomtabs(Container $container) : Customtabs + + getModelAdminviews(Container $container) : Adminviews + + getModelSqltweaking(Container $container) : Sqltweaking + + getModelSqldump(Container $container) : Sqldump + + getModelWhmcs(Container $container) : Whmcs + + getModifieddate(Container $container) : Modifieddate + + getCreatedate(Container $container) : Createdate + + getUpdateserver(Container $container) : Updateserver + + getModelFilesfolders(Container $container) : Filesfolders + + getServerLoad(Container $container) : ServerLoad +} + +note right of Model::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Model::getModelJoomlaplugins + Get the Joomla plugins Model + + since: 3.2.0 + return: Joomlaplugins +end note + +note right of Model::getModelJoomlamodules + Get the Joomla modules Model + + since: 3.2.0 + return: Joomlamodules +end note + +note left of Model::getModelHistorycomponent + Get the history component Model + + since: 3.2.0 + return: Historycomponent +end note + +note right of Model::getModelCustomadminviews + Get the custom admin views Model + + since: 3.2.0 + return: Customadminviews +end note + +note left of Model::getModelAjaxcustomview + Get the ajax custom view Model + + since: 3.2.0 + return: Ajaxcustomview +end note + +note right of Model::getModelJavascriptcustomview + Get the javascript custom view Model + + since: 3.2.0 + return: Javascriptcustomview +end note + +note left of Model::getModelCsscustomview + Get the css custom view Model + + since: 3.2.0 + return: Csscustomview +end note + +note right of Model::getModelPhpcustomview + Get the php custom view Model + + since: 3.2.0 + return: Phpcustomview +end note + +note left of Model::getModelDynamicget + Get the dynamic get Model + + since: 3.2.0 + return: Dynamicget +end note + +note right of Model::getModelLibraries + Get the libraries Model + + since: 3.2.0 + return: Libraries +end note + +note left of Model::getModelSiteviews + Get the site views Model + + since: 3.2.0 + return: Siteviews +end note + +note right of Model::getModelPermissions + Get the permissions Model + + since: 3.2.0 + return: Permissions +end note + +note left of Model::getModelHistoryadminview + Get the admin view history Model + + since: 3.2.0 + return: Historyadminview +end note + +note right of Model::getModelMysqlsettings + Get the MySQL settings Model + + since: 3.2.0 + return: Mysqlsettings +end note + +note left of Model::getModelSql + Get the Sql Model + + since: 3.2.0 + return: Sql +end note + +note right of Model::getModelCustomalias + Get the custom alias Model + + since: 3.2.0 + return: Customalias +end note + +note left of Model::getModelAjaxadmin + Get the Admin Ajax Model + + since: 3.2.0 + return: Ajaxadmin +end note + +note right of Model::getModelCustomimportscripts + Get the custom import scripts Model + + since: 3.2.0 + return: Customimportscripts +end note + +note left of Model::getModelCustombuttons + Get the custom import scripts Model + + since: 3.2.0 + return: Custombuttons +end note + +note right of Model::getModelLoader + Get the Model Auto Loader + + since: 3.2.0 + return: Loader +end note + +note left of Model::getModelPhpadminview + Get the php admin view Model + + since: 3.2.0 + return: Phpadminview +end note + +note right of Model::getModelCssadminview + Get the Css Adminview Model + + since: 3.2.0 + return: Cssadminview +end note + +note left of Model::getModelJavascriptadminview + Get the Javascript Adminview Model + + since: 3.2.0 + return: Javascriptadminview +end note + +note right of Model::getModelLinkedviews + Get the linked views Model + + since: 3.2.0 + return: Linkedviews +end note + +note left of Model::getModelRelations + Get the relations Model + + since: 3.2.0 + return: Relations +end note + +note right of Model::getModelConditions + Get the conditions Model + + since: 3.2.0 + return: Conditions +end note + +note left of Model::getModelFields + Get the fields Model + + since: 3.2.0 + return: Fields +end note + +note right of Model::getModelUpdatesql + Get the update sql Model + + since: 3.2.0 + return: Updatesql +end note + +note left of Model::getModelTabs + Get the tabs Model + + since: 3.2.0 + return: Tabs +end note + +note right of Model::getModelCustomtabs + Get the custom tabs Model + + since: 3.2.0 + return: Customtabs +end note + +note left of Model::getModelAdminviews + Get the admin views Model + + since: 3.2.0 + return: Adminviews +end note + +note right of Model::getModelSqltweaking + Get the SQL tweaking Model + + since: 3.2.0 + return: Sqltweaking +end note + +note left of Model::getModelSqldump + Get the SQL dump Model + + since: 3.2.0 + return: Sqldump +end note + +note right of Model::getModelWhmcs + Get the whmcs Model + + since: 3.2.0 + return: Whmcs +end note + +note left of Model::getModifieddate + Get the modified date Model + + since: 3.2.0 + return: Modifieddate +end note + +note right of Model::getCreatedate + Get the create date Model + + since: 3.2.0 + return: Createdate +end note + +note left of Model::getUpdateserver + Get the update server Model + + since: 3.2.0 + return: Updateserver +end note + +note right of Model::getModelFilesfolders + Get the files folders Model + + since: 3.2.0 + return: Filesfolders +end note + +note left of Model::getServerLoad + Get the Server Model Server Loader class + + since: 3.2.0 + return: ServerLoad +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php new file mode 100644 index 0000000..c7fd1d3 --- /dev/null +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/code.php @@ -0,0 +1,808 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Server\Model\Load as ServerLoad; +use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlaplugins; +use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlamodules; +use VDM\Joomla\Componentbuilder\Compiler\Model\Historycomponent; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customadminviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxcustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptcustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Csscustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Phpcustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Dynamicget; +use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries; +use VDM\Joomla\Componentbuilder\Compiler\Model\Siteviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Permissions; +use VDM\Joomla\Componentbuilder\Compiler\Model\Historyadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Mysqlsettings; +use VDM\Joomla\Componentbuilder\Compiler\Model\Sql; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customalias; +use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxadmin; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customimportscripts; +use VDM\Joomla\Componentbuilder\Compiler\Model\Custombuttons; +use VDM\Joomla\Componentbuilder\Compiler\Model\Loader; +use VDM\Joomla\Componentbuilder\Compiler\Model\Phpadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Cssadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Linkedviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Relations; +use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions; +use VDM\Joomla\Componentbuilder\Compiler\Model\Fields; +use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql; +use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking; +use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump; +use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs; +use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; +use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; + + +/** + * Model Service Provider + * + * @since 3.2.0 + */ +class Model implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Joomlaplugins::class, 'Model.Joomlaplugins') + ->share('Model.Joomlaplugins', [$this, 'getModelJoomlaplugins'], true); + + $container->alias(Joomlamodules::class, 'Model.Joomlamodules') + ->share('Model.Joomlamodules', [$this, 'getModelJoomlamodules'], true); + + $container->alias(Historycomponent::class, 'Model.Historycomponent') + ->share('Model.Historycomponent', [$this, 'getModelHistorycomponent'], true); + + $container->alias(Customadminviews::class, 'Model.Customadminviews') + ->share('Model.Customadminviews', [$this, 'getModelCustomadminviews'], true); + + $container->alias(Ajaxcustomview::class, 'Model.Ajaxcustomview') + ->share('Model.Ajaxcustomview', [$this, 'getModelAjaxcustomview'], true); + + $container->alias(Javascriptcustomview::class, 'Model.Javascriptcustomview') + ->share('Model.Javascriptcustomview', [$this, 'getModelJavascriptcustomview'], true); + + $container->alias(Csscustomview::class, 'Model.Csscustomview') + ->share('Model.Csscustomview', [$this, 'getModelCsscustomview'], true); + + $container->alias(Phpcustomview::class, 'Model.Phpcustomview') + ->share('Model.Phpcustomview', [$this, 'getModelPhpcustomview'], true); + + $container->alias(Dynamicget::class, 'Model.Dynamicget') + ->share('Model.Dynamicget', [$this, 'getModelDynamicget'], true); + + $container->alias(Libraries::class, 'Model.Libraries') + ->share('Model.Libraries', [$this, 'getModelLibraries'], true); + + $container->alias(Siteviews::class, 'Model.Siteviews') + ->share('Model.Siteviews', [$this, 'getModelSiteviews'], true); + + $container->alias(Permissions::class, 'Model.Permissions') + ->share('Model.Permissions', [$this, 'getModelPermissions'], true); + + $container->alias(Historyadminview::class, 'Model.Historyadminview') + ->share('Model.Historyadminview', [$this, 'getModelHistoryadminview'], true); + + $container->alias(Mysqlsettings::class, 'Model.Mysqlsettings') + ->share('Model.Mysqlsettings', [$this, 'getModelMysqlsettings'], true); + + $container->alias(Sql::class, 'Model.Sql') + ->share('Model.Sql', [$this, 'getModelSql'], true); + + $container->alias(Customalias::class, 'Model.Customalias') + ->share('Model.Customalias', [$this, 'getModelCustomalias'], true); + + $container->alias(Ajaxadmin::class, 'Model.Ajaxadmin') + ->share('Model.Ajaxadmin', [$this, 'getModelAjaxadmin'], true); + + $container->alias(Customimportscripts::class, 'Model.Customimportscripts') + ->share('Model.Customimportscripts', [$this, 'getModelCustomimportscripts'], true); + + $container->alias(Custombuttons::class, 'Model.Custombuttons') + ->share('Model.Custombuttons', [$this, 'getModelCustombuttons'], true); + + $container->alias(Loader::class, 'Model.Loader') + ->share('Model.Loader', [$this, 'getModelLoader'], true); + + $container->alias(Phpadminview::class, 'Model.Phpadminview') + ->share('Model.Phpadminview', [$this, 'getModelPhpadminview'], true); + + $container->alias(Cssadminview::class, 'Model.Cssadminview') + ->share('Model.Cssadminview', [$this, 'getModelCssadminview'], true); + + $container->alias(Javascriptadminview::class, 'Model.Javascriptadminview') + ->share('Model.Javascriptadminview', [$this, 'getModelJavascriptadminview'], true); + + $container->alias(Linkedviews::class, 'Model.Linkedviews') + ->share('Model.Linkedviews', [$this, 'getModelLinkedviews'], true); + + $container->alias(Relations::class, 'Model.Relations') + ->share('Model.Relations', [$this, 'getModelRelations'], true); + + $container->alias(Conditions::class, 'Model.Conditions') + ->share('Model.Conditions', [$this, 'getModelConditions'], true); + + $container->alias(Fields::class, 'Model.Fields') + ->share('Model.Fields', [$this, 'getModelFields'], true); + + $container->alias(Updatesql::class, 'Model.Updatesql') + ->share('Model.Updatesql', [$this, 'getModelUpdatesql'], true); + + $container->alias(Tabs::class, 'Model.Tabs') + ->share('Model.Tabs', [$this, 'getModelTabs'], true); + + $container->alias(Customtabs::class, 'Model.Customtabs') + ->share('Model.Customtabs', [$this, 'getModelCustomtabs'], true); + + $container->alias(Adminviews::class, 'Model.Adminviews') + ->share('Model.Adminviews', [$this, 'getModelAdminviews'], true); + + $container->alias(Sqltweaking::class, 'Model.Sqltweaking') + ->share('Model.Sqltweaking', [$this, 'getModelSqltweaking'], true); + + $container->alias(Sqldump::class, 'Model.Sqldump') + ->share('Model.Sqldump', [$this, 'getModelSqldump'], true); + + $container->alias(Whmcs::class, 'Model.Whmcs') + ->share('Model.Whmcs', [$this, 'getModelWhmcs'], true); + + $container->alias(Modifieddate::class, 'Model.Modifieddate') + ->share('Model.Modifieddate', [$this, 'getModifieddate'], true); + + $container->alias(Createdate::class, 'Model.Createdate') + ->share('Model.Createdate', [$this, 'getCreatedate'], true); + + $container->alias(Updateserver::class, 'Model.Updateserver') + ->share('Model.Updateserver', [$this, 'getUpdateserver'], true); + + $container->alias(Filesfolders::class, 'Model.Filesfolders') + ->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true); + + $container->alias(ServerLoad::class, 'Model.Server.Load') + ->share('Model.Server.Load', [$this, 'getServerLoad'], true); + } + + /** + * Get the Joomla plugins Model + * + * @param Container $container The DI container. + * + * @return Joomlaplugins + * @since 3.2.0 + */ + public function getModelJoomlaplugins(Container $container): Joomlaplugins + { + return new Joomlaplugins( + $container->get('Joomlaplugin.Data') + ); + } + + /** + * Get the Joomla modules Model + * + * @param Container $container The DI container. + * + * @return Joomlamodules + * @since 3.2.0 + */ + public function getModelJoomlamodules(Container $container): Joomlamodules + { + return new Joomlamodules( + $container->get('Joomlamodule.Data') + ); + } + + /** + * Get the history component Model + * + * @param Container $container The DI container. + * + * @return Historycomponent + * @since 3.2.0 + */ + public function getModelHistorycomponent(Container $container): Historycomponent + { + return new Historycomponent( + $container->get('Config'), + $container->get('History'), + $container->get('Model.Updatesql') + ); + } + + /** + * Get the custom admin views Model + * + * @param Container $container The DI container. + * + * @return Customadminviews + * @since 3.2.0 + */ + public function getModelCustomadminviews(Container $container): Customadminviews + { + return new Customadminviews( + $container->get('Customview.Data'), + $container->get('Config') + ); + } + + /** + * Get the ajax custom view Model + * + * @param Container $container The DI container. + * + * @return Ajaxcustomview + * @since 3.2.0 + */ + public function getModelAjaxcustomview(Container $container): Ajaxcustomview + { + return new Ajaxcustomview( + $container->get('Config'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the javascript custom view Model + * + * @param Container $container The DI container. + * + * @return Javascriptcustomview + * @since 3.2.0 + */ + public function getModelJavascriptcustomview(Container $container): Javascriptcustomview + { + return new Javascriptcustomview( + $container->get('Customcode'), + $container->get('Customcode.Gui') + ); + } + + /** + * Get the css custom view Model + * + * @param Container $container The DI container. + * + * @return Csscustomview + * @since 3.2.0 + */ + public function getModelCsscustomview(Container $container): Csscustomview + { + return new Csscustomview( + $container->get('Customcode') + ); + } + + /** + * Get the php custom view Model + * + * @param Container $container The DI container. + * + * @return Phpcustomview + * @since 3.2.0 + */ + public function getModelPhpcustomview(Container $container): Phpcustomview + { + return new Phpcustomview( + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Model.Loader'), + $container->get('Templatelayout.Data') + ); + } + + /** + * Get the dynamic get Model + * + * @param Container $container The DI container. + * + * @return Dynamicget + * @since 3.2.0 + */ + public function getModelDynamicget(Container $container): Dynamicget + { + return new Dynamicget( + $container->get('Config'), + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Dynamicget.Selection') + ); + } + + /** + * Get the libraries Model + * + * @param Container $container The DI container. + * + * @return Libraries + * @since 3.2.0 + */ + public function getModelLibraries(Container $container): Libraries + { + return new Libraries( + $container->get('Config'), + $container->get('Registry'), + $container->get('Library.Data') + ); + } + + /** + * Get the site views Model + * + * @param Container $container The DI container. + * + * @return Siteviews + * @since 3.2.0 + */ + public function getModelSiteviews(Container $container): Siteviews + { + return new Siteviews( + $container->get('Customview.Data'), + $container->get('Config') + ); + } + + /** + * Get the permissions Model + * + * @param Container $container The DI container. + * + * @return Permissions + * @since 3.2.0 + */ + public function getModelPermissions(Container $container): Permissions + { + return new Permissions(); + } + + /** + * Get the admin view history Model + * + * @param Container $container The DI container. + * + * @return Historyadminview + * @since 3.2.0 + */ + public function getModelHistoryadminview(Container $container): Historyadminview + { + return new Historyadminview( + $container->get('Config'), + $container->get('History'), + $container->get('Model.Updatesql') + ); + } + + /** + * Get the MySQL settings Model + * + * @param Container $container The DI container. + * + * @return Mysqlsettings + * @since 3.2.0 + */ + public function getModelMysqlsettings(Container $container): Mysqlsettings + { + return new Mysqlsettings( + $container->get('Config'), + $container->get('Registry') + ); + } + /** + * Get the Sql Model + * + * @param Container $container The DI container. + * + * @return Sql + * @since 3.2.0 + */ + public function getModelSql(Container $container): Sql + { + return new Sql( + $container->get('Customcode.Dispenser'), + $container->get('Model.Sqldump') + ); + } + + /** + * Get the custom alias Model + * + * @param Container $container The DI container. + * + * @return Customalias + * @since 3.2.0 + */ + public function getModelCustomalias(Container $container): Customalias + { + return new Customalias( + $container->get('Registry'), + $container->get('Field.Name') + ); + } + + /** + * Get the Admin Ajax Model + * + * @param Container $container The DI container. + * + * @return Ajaxadmin + * @since 3.2.0 + */ + public function getModelAjaxadmin(Container $container): Ajaxadmin + { + return new Ajaxadmin( + $container->get('Config'), + $container->get('Registry'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the custom import scripts Model + * + * @param Container $container The DI container. + * + * @return Customimportscripts + * @since 3.2.0 + */ + public function getModelCustomimportscripts(Container $container): Customimportscripts + { + return new Customimportscripts( + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the custom import scripts Model + * + * @param Container $container The DI container. + * + * @return Custombuttons + * @since 3.2.0 + */ + public function getModelCustombuttons(Container $container): Custombuttons + { + return new Custombuttons( + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Templatelayout.Data') + ); + } + + /** + * Get the Model Auto Loader + * + * @param Container $container The DI container. + * + * @return Loader + * @since 3.2.0 + */ + public function getModelLoader(Container $container): Loader + { + return new Loader( + $container->get('Config'), + $container->get('Registry') + ); + } + + /** + * Get the php admin view Model + * + * @param Container $container The DI container. + * + * @return Phpadminview + * @since 3.2.0 + */ + public function getModelPhpadminview(Container $container): Phpadminview + { + return new Phpadminview( + $container->get('Customcode.Dispenser'), + $container->get('Templatelayout.Data') + ); + } + + /** + * Get the Css Adminview Model + * + * @param Container $container The DI container. + * + * @return Cssadminview + * @since 3.2.0 + */ + public function getModelCssadminview(Container $container): Cssadminview + { + return new Cssadminview( + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the Javascript Adminview Model + * + * @param Container $container The DI container. + * + * @return Javascriptadminview + * @since 3.2.0 + */ + public function getModelJavascriptadminview(Container $container): Javascriptadminview + { + return new Javascriptadminview( + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the linked views Model + * + * @param Container $container The DI container. + * + * @return Linkedviews + * @since 3.2.0 + */ + public function getModelLinkedviews(Container $container): Linkedviews + { + return new Linkedviews( + $container->get('Registry') + ); + } + + /** + * Get the relations Model + * + * @param Container $container The DI container. + * + * @return Relations + * @since 3.2.0 + */ + public function getModelRelations(Container $container): Relations + { + return new Relations( + $container->get('Config'), + $container->get('Registry'), + $container->get('Language'), + $container->get('Customcode') + ); + } + + /** + * Get the conditions Model + * + * @param Container $container The DI container. + * + * @return Conditions + * @since 3.2.0 + */ + public function getModelConditions(Container $container): Conditions + { + return new Conditions( + $container->get('Field.Type.Name'), + $container->get('Field.Name') + ); + } + + /** + * Get the fields Model + * + * @param Container $container The DI container. + * + * @return Fields + * @since 3.2.0 + */ + public function getModelFields(Container $container): Fields + { + return new Fields( + $container->get('Config'), + $container->get('Registry'), + $container->get('History'), + $container->get('Customcode'), + $container->get('Field'), + $container->get('Field.Name'), + $container->get('Model.Updatesql') + ); + } + + /** + * Get the update sql Model + * + * @param Container $container The DI container. + * + * @return Updatesql + * @since 3.2.0 + */ + public function getModelUpdatesql(Container $container): Updatesql + { + return new Updatesql( + $container->get('Registry') + ); + } + + /** + * Get the tabs Model + * + * @param Container $container The DI container. + * + * @return Updatesql + * @since 3.2.0 + */ + public function getModelTabs(Container $container): Tabs + { + return new Tabs(); + } + + /** + * Get the custom tabs Model + * + * @param Container $container The DI container. + * + * @return Customtabs + * @since 3.2.0 + */ + public function getModelCustomtabs(Container $container): Customtabs + { + return new Customtabs( + $container->get('Config'), + $container->get('Registry'), + $container->get('Language'), + $container->get('Placeholder'), + $container->get('Customcode') + ); + } + + /** + * Get the admin views Model + * + * @param Container $container The DI container. + * + * @return Adminviews + * @since 3.2.0 + */ + public function getModelAdminviews(Container $container): Adminviews + { + return new Adminviews( + $container->get('Adminview.Data'), + $container->get('Registry'), + $container->get('Config') + ); + } + + /** + * Get the SQL tweaking Model + * + * @param Container $container The DI container. + * + * @return Sqltweaking + * @since 3.2.0 + */ + public function getModelSqltweaking(Container $container): Sqltweaking + { + return new Sqltweaking( + $container->get('Registry') + ); + } + + /** + * Get the SQL dump Model + * + * @param Container $container The DI container. + * + * @return Sqldump + * @since 3.2.0 + */ + public function getModelSqldump(Container $container): Sqldump + { + return new Sqldump( + $container->get('Registry') + ); + } + + /** + * Get the whmcs Model + * + * @param Container $container The DI container. + * + * @return Whmcs + * @since 3.2.0 + */ + public function getModelWhmcs(Container $container): Whmcs + { + return new Whmcs(); + } + + /** + * Get the modified date Model + * + * @param Container $container The DI container. + * + * @return Modifieddate + * @since 3.2.0 + */ + public function getModifieddate(Container $container): Modifieddate + { + return new Modifieddate(); + } + + /** + * Get the create date Model + * + * @param Container $container The DI container. + * + * @return Createdate + * @since 3.2.0 + */ + public function getCreatedate(Container $container): Createdate + { + return new Createdate(); + } + + /** + * Get the update server Model + * + * @param Container $container The DI container. + * + * @return Updateserver + * @since 3.2.0 + */ + public function getUpdateserver(Container $container): Updateserver + { + return new Updateserver(); + } + + /** + * Get the files folders Model + * + * @param Container $container The DI container. + * + * @return Filesfolders + * @since 3.2.0 + */ + public function getModelFilesfolders(Container $container): Filesfolders + { + return new Filesfolders(); + } + + /** + * Get the Server Model Server Loader class + * + * @param Container $container The DI container. + * + * @return ServerLoad + * @since 3.2.0 + */ + public function getServerLoad(Container $container): ServerLoad + { + return new ServerLoad( + $container->get('Crypt'), + $container->get('Table') + ); + } + +} + diff --git a/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json new file mode 100644 index 0000000..4e07769 --- /dev/null +++ b/src/0601fee8-d51e-4af0-9ad3-b5f8700c4a45/settings.json @@ -0,0 +1,175 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "0601fee8-d51e-4af0-9ad3-b5f8700c4a45", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Model", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Model", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "f37ee8b7-2909-4319-bdf8-769bd7635490", + "as": "ServerLoad" + }, + "use_selection1": { + "use": "ef97b03e-1018-447a-8d7e-30401b0257bb", + "as": "default" + }, + "use_selection2": { + "use": "bfdc4ce5-cb12-4fc6-9023-51cede25edd0", + "as": "default" + }, + "use_selection3": { + "use": "17a728e9-d6cf-4060-9efb-241b0ff2f981", + "as": "default" + }, + "use_selection4": { + "use": "e0e24173-a808-4dd5-8e26-de971d014f86", + "as": "default" + }, + "use_selection5": { + "use": "592aed4e-2c5f-4fc5-8f7a-409203d1af82", + "as": "default" + }, + "use_selection6": { + "use": "29455d3b-df2b-4e41-8684-1608060e37a4", + "as": "default" + }, + "use_selection7": { + "use": "3283a89c-329a-47fb-a011-0df6c31a5c73", + "as": "default" + }, + "use_selection8": { + "use": "489da602-27c7-418c-bf59-1d45ad42bdcc", + "as": "default" + }, + "use_selection9": { + "use": "79740ee8-4d10-4b51-9ff5-18e1386ec1c6", + "as": "default" + }, + "use_selection10": { + "use": "59895f37-50c8-4af3-9dad-230e18841953", + "as": "default" + }, + "use_selection11": { + "use": "e0075978-315d-4807-8507-ce9c6922a885", + "as": "default" + }, + "use_selection12": { + "use": "0dabc67c-abec-4541-82bf-279abd3c9be1", + "as": "default" + }, + "use_selection13": { + "use": "6dfbf568-f3cd-4ea7-af04-6859447b5462", + "as": "default" + }, + "use_selection14": { + "use": "35191b0c-f7f3-44d6-8ec1-c816b997bd4e", + "as": "default" + }, + "use_selection15": { + "use": "d4b418a7-bf9b-4768-969d-e07c36916fd2", + "as": "default" + }, + "use_selection16": { + "use": "5f8e8fa6-3793-44af-882d-9cfb209434e9", + "as": "default" + }, + "use_selection17": { + "use": "4f575bd6-de97-41f8-80d6-259c8a6dd9ad", + "as": "default" + }, + "use_selection18": { + "use": "037c7274-fb16-455d-989a-bf1da022620b", + "as": "default" + }, + "use_selection19": { + "use": "ebe3287d-bfa0-4519-b663-f442f4dea432", + "as": "default" + }, + "use_selection20": { + "use": "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7", + "as": "default" + }, + "use_selection21": { + "use": "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe", + "as": "default" + }, + "use_selection22": { + "use": "e79842d3-51b7-4282-93c7-3487cd8b61ab", + "as": "default" + }, + "use_selection23": { + "use": "dfd3c893-0296-46eb-9ae4-a0348713cd8f", + "as": "default" + }, + "use_selection24": { + "use": "ae1fa148-91be-4f80-89a9-69d91ba9d575", + "as": "default" + }, + "use_selection25": { + "use": "a8eb2fb1-88ed-4af8-842d-898eb915b588", + "as": "default" + }, + "use_selection26": { + "use": "55e61314-ba10-4e2b-92dd-b44adebabce9", + "as": "default" + }, + "use_selection27": { + "use": "e6a64c41-405e-4bbc-9722-27402c22bbea", + "as": "default" + }, + "use_selection28": { + "use": "b80296eb-4718-4ed3-894d-69f3ac293733", + "as": "default" + }, + "use_selection29": { + "use": "143ac6ea-b64f-4331-9a97-31e3fce2bb69", + "as": "default" + }, + "use_selection30": { + "use": "fa8c1125-d370-4cb6-a7ff-eb32193c198c", + "as": "default" + }, + "use_selection31": { + "use": "cebdcccb-24c5-46db-92de-63453852dcb8", + "as": "default" + }, + "use_selection32": { + "use": "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26", + "as": "default" + }, + "use_selection33": { + "use": "a6e1227c-1efe-407d-84ef-03c6989a6a88", + "as": "default" + }, + "use_selection34": { + "use": "af5beb21-214a-44f6-9090-7ea24c22e649", + "as": "default" + }, + "use_selection35": { + "use": "f4578c04-a81e-4218-b80d-b0612196eaf0", + "as": "default" + }, + "use_selection36": { + "use": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3", + "as": "default" + }, + "use_selection37": { + "use": "53cf9828-7ad4-4856-aac1-7c4c67bd3121", + "as": "default" + }, + "use_selection38": { + "use": "1d0fd857-12ec-4f47-ab1c-124d85748e24", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Model", + "description": "Model Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/README.md b/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/README.md new file mode 100644 index 0000000..ca6d5e2 --- /dev/null +++ b/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/README.md @@ -0,0 +1,217 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Placeholder (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Placeholder #Gold { + + array $active + # Config $config + + __construct(?Config $config = null) + + set(string $key, mixed $value, ...) : void + + get(string $key) : mixed + + exist(string $key) : bool + + add(string $key, mixed $value, ...) : void + + remove(string $key) : void + + set_(string $key, mixed $value) : void + + get_(string $key) : mixed + + exist_(string $key) : bool + + add_(string $key, mixed $value) : void + + remove_(string $key) : void + + set_h(string $key, mixed $value) : void + + get_h(string $key) : mixed + + exist_h(string $key) : bool + + add_h(string $key, mixed $value) : void + + remove_h(string $key) : void + + setType(string $key, array $values) : void + + clearType(string $key) : void + + update(string $data, array $placeholder, ...) : string + + update_(string $data) : string + + keys(int $type, ?int $id = null) : array +} + +note right of Placeholder::__construct + Constructor. + + since: 3.2.0 +end note + +note left of Placeholder::set + Set content + + since: 3.2.0 + return: void + + arguments: + string $key + mixed $value + bool $hash = true +end note + +note right of Placeholder::get + Get content by key + + since: 3.2.0 + return: mixed +end note + +note left of Placeholder::exist + Does key exist at all in any variation + + since: 3.2.0 + return: bool +end note + +note right of Placeholder::add + Add content + + since: 3.2.0 + return: void + + arguments: + string $key + mixed $value + bool $hash = true +end note + +note left of Placeholder::remove + Remove content + + since: 3.2.0 + return: void +end note + +note right of Placeholder::set_ + Set content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: void +end note + +note left of Placeholder::get_ + Get content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: mixed +end note + +note right of Placeholder::exist_ + Does key exist with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: bool +end note + +note left of Placeholder::add_ + Add content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: void +end note + +note right of Placeholder::remove_ + Remove content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: void +end note + +note left of Placeholder::set_h + Set content with # # # hash + + since: 3.2.0 + return: void +end note + +note right of Placeholder::get_h + Get content with # # # hash + + since: 3.2.0 + return: mixed +end note + +note left of Placeholder::exist_h + Does key exist with # # # hash + + since: 3.2.0 + return: bool +end note + +note right of Placeholder::add_h + Add content with # # # hash + + since: 3.2.0 + return: void +end note + +note left of Placeholder::remove_h + Remove content with # # # hash + + since: 3.2.0 + return: void +end note + +note right of Placeholder::setType + Set a type of placeholder with set of values + + since: 3.2.0 + return: void +end note + +note left of Placeholder::clearType + Remove a type of placeholder by main key + + since: 3.2.0 + return: void +end note + +note right of Placeholder::update + Update the data with the placeholders +THE ACTION OPTIONS ARE +1 -> Just replace (default) +2 -> Check if data string has placeholders +3 -> Remove placeholders not in data string + + since: 3.2.0 + return: string + + arguments: + string $data + array $placeholder + int $action = 1 +end note + +note left of Placeholder::update_ + Update the data with the active placeholders + + since: 3.2.0 + return: string +end note + +note right of Placeholder::keys + return the placeholders for inserted and replaced code + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/code.php b/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/code.php new file mode 100644 index 0000000..cb10955 --- /dev/null +++ b/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/code.php @@ -0,0 +1,508 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\PlaceholderInterface; + + +/** + * Compiler Placeholder + * + * @since 3.2.0 + */ +class Placeholder implements PlaceholderInterface +{ + /** + * The active placeholders + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Set content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, $value, bool $hash = true) + { + if ($hash) + { + $this->set_($key, $value); + $this->set_h($key, $value); + } + else + { + $this->active[$key] = $value; + } + } + + /** + * Get content by key + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $key) + { + return $this->active[$key] ?? $this->get_($key) ?? $this->get_h($key) ?? null; + } + + /** + * Does key exist at all in any variation + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $key): bool + { + return isset($this->active[$key]) || $this->exist_($key) || $this->exist_h($key); + } + + /** + * Add content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function add(string $key, $value, bool $hash = true) + { + if ($hash) + { + $this->add_($key, $value); + $this->add_h($key, $value); + } + elseif (isset($this->active[$key])) + { + $this->active[$key] .= $value; + } + else + { + $this->active[$key] = $value; + } + } + + /** + * Remove content + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove(string $key) + { + if (isset($this->active[$key])) + { + unset($this->active[$key]); + } + else + { + $this->remove_($key); + $this->remove_h($key); + } + } + + /** + * Set content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_(string $key, $value) + { + $this->active[Placefix::_($key)] = $value; + } + + /** + * Get content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_(string $key) + { + return $this->active[Placefix::_($key)] ?? null; + } + + /** + * Does key exist with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_(string $key): bool + { + return isset($this->active[Placefix::_($key)]); + } + + /** + * Add content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_(string $key, $value) + { + if (isset($this->active[Placefix::_($key)])) + { + $this->active[Placefix::_($key)] .= $value; + } + else + { + $this->active[Placefix::_($key)] = $value; + } + } + + /** + * Remove content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_(string $key) + { + if ($this->exist_($key)) + { + unset($this->active[Placefix::_($key)]); + } + } + + /** + * Set content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_h(string $key, $value) + { + $this->active[Placefix::_h($key)] = $value; + } + + /** + * Get content with # # # hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_h(string $key) + { + return $this->active[Placefix::_h($key)] ?? null; + } + + /** + * Does key exist with # # # hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_h(string $key): bool + { + return isset($this->active[Placefix::_h($key)]); + } + + /** + * Add content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_h(string $key, $value) + { + if ($this->exist_h($key)) + { + $this->active[Placefix::_h($key)] .= $value; + } + else + { + $this->active[Placefix::_h($key)] = $value; + } + } + + /** + * Remove content with # # # hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_h(string $key) + { + if ($this->exist_h($key)) + { + unset($this->active[Placefix::_h($key)]); + } + } + + /** + * Set a type of placeholder with set of values + * + * @param string $key The main string for placeholder key + * @param array $values The values to add + * + * @return void + * @since 3.2.0 + */ + public function setType(string $key, array $values) + { + // always fist reset the type + $this->clearType($key); + + // only add if there are values + if (ArrayHelper::check($values)) + { + $number = 0; + foreach ($values as $value) + { + $this->set($key . $number, $value); + $number++; + } + } + } + + /** + * Remove a type of placeholder by main key + * + * @param string $key The main string for placeholder key + * + * @return void + * @since 3.2.0 + */ + public function clearType(string $key) + { + $keys = [Placefix::_($key), Placefix::_h($key), $key]; + + foreach ($keys as $_key) + { + $this->active = array_filter( + $this->active, + fn(string $k) => preg_replace('/\d/', '', $k) !== $_key, + ARRAY_FILTER_USE_KEY + ); + } + } + + /** + * Update the data with the placeholders + * + * @param string $data The actual data + * @param array $placeholder The placeholders + * @param int $action The action to use + * + * THE ACTION OPTIONS ARE + * 1 -> Just replace (default) + * 2 -> Check if data string has placeholders + * 3 -> Remove placeholders not in data string + * + * @return string + * @since 3.2.0 + */ + public function update(string $data, array $placeholder, int $action = 1): string + { + // make sure the placeholders is an array + if (!ArrayHelper::check($placeholder)) + { + return $data; + } + + // continue with the work of replacement + if (1 == $action) // <-- just replace (default) + { + return str_replace( + array_keys($placeholder), array_values($placeholder), $data + ); + } + elseif (2 == $action) // <-- check if data string has placeholders + { + $replace = false; + foreach (array_keys($placeholder) as $key) + { + if (strpos($data, $key) !== false) + { + $replace = true; + break; + } + } + // only replace if the data has these placeholder values + if ($replace) + { + return str_replace( + array_keys($placeholder), array_values($placeholder), $data + ); + } + } + elseif (3 == $action) // <-- remove placeholders not in data string + { + $replace = $placeholder; + foreach (array_keys($replace) as $key) + { + if (strpos($data, $key) === false) + { + unset($replace[$key]); + } + } + // only replace if the data has these placeholder values + if (ArrayHelper::check($replace)) + { + return str_replace( + array_keys($replace), array_values($replace), $data + ); + } + } + + return $data; + } + + /** + * Update the data with the active placeholders + * + * @param string $data The actual data + * + * @return string + * @since 3.2.0 + */ + public function update_(string $data): string + { + // just replace the placeholders in data + return str_replace( + array_keys($this->active), array_values($this->active), $data + ); + } + + /** + * return the placeholders for inserted and replaced code + * + * @param int $type The type of placement + * @param int|null $id The code id in the system + * + * @return array with start and end keys + * @since 3.2.0 + */ + public function keys(int $type, ?int $id = null): array + { + switch ($type) + { + case 11: + //***[REPLACED$$$$]***//**1**/ + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '/***[REPLACED$$$$]***//**' . $id . '**/', + 'end' => '/***[/REPLACED$$$$]***/' + ]; + } + break; + case 12: + //***[INSERTED$$$$]***//**1**/ + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '/***[INSERTED$$$$]***//**' . $id . '**/', + 'end' => '/***[/INSERTED$$$$]***/' + ]; + } + break; + case 21: + // + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '', + 'end' => '' + ]; + } + break; + case 22: + // + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '', + 'end' => '' + ]; + } + break; + case 33: + return ['start' => Placefix::h(), 'end' => Placefix::h()]; + break; + case 66: + return ['start' => Placefix::b(), 'end' => Placefix::d()]; + break; + } + + return [ 'start' => "", 'end' => ""]; + } + +} + diff --git a/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/settings.json b/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/settings.json new file mode 100644 index 0000000..d499e71 --- /dev/null +++ b/src/06453ada-e370-49f0-b262-e3f5a8ed0c2c/settings.json @@ -0,0 +1,35 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "implements": [ + "a6cdd935-c038-4a54-8446-54bed87f003c" + ], + "implements_custom": "", + "load_selection": null, + "name": "Placeholder", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Placeholder", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection2": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection3": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Placeholder", + "description": "Compiler Placeholder\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/README.md b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/README.md new file mode 100644 index 0000000..db27df1 --- /dev/null +++ b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/README.md @@ -0,0 +1,82 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structure (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Joomlamodule** +```uml +@startuml +class Structure #Gold { + # Module $module + # Component $component + # Config $config + # Registry $registry + # Dispenser $dispenser + # EventInterface $event + # Counter $counter + # Folder $folder + # File $file + # Files $files + + __construct(?Module $module = null, ?Component $component = null, ...) + + build() : void + # getXML(object $module) : string + # getCustomScriptField(array $fieldScriptBucket) : string +} + +note right of Structure::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Module $module = null + ?Component $component = null + ?Config $config = null + ?Registry $registry = null + ?Dispenser $dispenser = null + ?EventInterface $event = null + ?Counter $counter = null + ?Folder $folder = null + ?File $file = null + ?Files $files = null +end note + +note right of Structure::build + Build the Modules files, folders, url's and config + + since: 3.2.0 + return: void +end note + +note right of Structure::getXML + get the module xml template + + since: 3.2.0 + return: string +end note + +note right of Structure::getCustomScriptField + get the module admin custom script field + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php new file mode 100644 index 0000000..d3d0d14 --- /dev/null +++ b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/code.php @@ -0,0 +1,884 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Joomlamodule; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Data as Module; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\FileHelper; + + +/** + * Joomla Module Structure Builder Class + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Joomla Module Data Class + * + * @var Module + * @since 3.2.0 + */ + protected Module $module; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities Folder + * + * @var Folder + * @since 3.2.0 + */ + protected Folder $folder; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Constructor + * + * @param Module|null $module The compiler Joomla module data object. + * @param Component|null $component The component class. + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Dispenser|null $dispenser The compiler customcode dispenser object. + * @param EventInterface|null $event The compiler event api object. + * @param Counter|null $counter The compiler counter object. + * @param Folder|null $folder The compiler folder object. + * @param File|null $file The compiler file object. + * @param Files|null $files The compiler files object. + * + * @since 3.2.0 + */ + public function __construct(?Module $module = null, ?Component $component = null, + ?Config $config = null, ?Registry $registry = null, + ?Dispenser $dispenser = null, ?EventInterface $event = null, + ?Counter $counter = null, ?Folder $folder = null, + ?File $file = null, ?Files $files = null) + { + $this->module = $module ?: Compiler::_('Joomlamodule.Data'); + $this->component = $component ?: Compiler::_('Component'); + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->event = $event ?: Compiler::_('Event'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->folder = $folder ?: Compiler::_('Utilities.Folder'); + $this->file = $file ?: Compiler::_('Utilities.File'); + $this->files = $files ?: Compiler::_('Utilities.Files'); + } + + /** + * Build the Modules files, folders, url's and config + * + * @return void + * @since 3.2.0 + */ + public function build() + { + if ($this->module->exists()) + { + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + $modules = $this->module->get(); + // Trigger Event: jcb_ce_onBeforeSetModules + $this->event->trigger( + 'jcb_ce_onBeforeBuildModules', + array(&$component_context, &$modules) + ); + + foreach ($modules as $module) + { + if (ObjectHelper::check($module) + && isset($module->folder_name) + && StringHelper::check( + $module->folder_name + )) + { + // module path + $module->folder_path = $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + . $module->folder_name; + + // set the module paths + $this->registry->set('dynamic_paths.' . $module->key, $module->folder_path); + + // make sure there is no old build + $this->folder->remove($module->folder_path); + + // creat the main module folder + $this->folder->create($module->folder_path); + + // set main mod file + $fileDetails = array('path' => $module->folder_path . '/' + . $module->file_name . '.php', + 'name' => $module->file_name . '.php', + 'zip' => $module->file_name . '.php'); + $this->file->write( + $fileDetails['path'], + 'files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // set custom_get + if ($module->custom_get) + { + $fileDetails = array( + 'path' => $module->folder_path . '/data.php', + 'name' => 'data.php', + 'zip' => 'data.php' + ); + $this->file->write( + $fileDetails['path'], + 'official_name . ' Data' + . PHP_EOL . + ' */' . PHP_EOL . + "class " . $module->class_data_name + . ' extends \JObject' . PHP_EOL . + "{" . Placefix::_h('DYNAMICGETS') . "}" + . PHP_EOL + ); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + + // set helper file + if ($module->add_class_helper >= 1) + { + $fileDetails = array('path' => $module->folder_path + . '/helper.php', + 'name' => 'helper.php', + 'zip' => 'helper.php'); + $this->file->write( + $fileDetails['path'], + 'files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + + // set main xml file + $fileDetails = array('path' => $module->folder_path . '/' + . $module->file_name . '.xml', + 'name' => $module->file_name . '.xml', + 'zip' => $module->file_name . '.xml'); + $this->file->write( + $fileDetails['path'], + $this->getXML($module) + ); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // set tmpl folder + $this->folder->create($module->folder_path . '/tmpl'); + + // set default file + $fileDetails = array('path' => $module->folder_path + . '/tmpl/default.php', + 'name' => 'default.php', + 'zip' => 'tmpl/default.php'); + $this->file->write( + $fileDetails['path'], + 'files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // set install script if needed + if ($module->add_install_script) + { + $fileDetails = [ + 'path' => $module->folder_path . '/script.php', + 'name' => 'script.php', + 'zip' => 'script.php' + ]; + $this->file->write( + $fileDetails['path'], + 'files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + + // set readme if found + if ($module->addreadme) + { + $fileDetails = [ + 'path' => $module->folder_path . '/README.md', + 'name' => 'README.md', + 'zip' => 'README.md' + ]; + $this->file->write($fileDetails['path'], $module->readme); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + + // set the folders target path + $target_path = ''; + if ($module->target_client === 'administrator') + { + $target_path = '/administrator'; + } + + // check if we have custom fields needed for scripts + $module->add_scripts_field = false; + $field_script_bucket = []; + + // add any css from the fields + if (($css = $this->dispenser->get( + 'css_view', $module->key + )) !== null + && StringHelper::check($css)) + { + // make sure this script does not have PHP + if (strpos((string) $css, 'add_scripts_field = true; + + // create the css folder + $this->folder->create($module->folder_path . '/css'); + + // add the CSS file + $fileDetails = [ + 'path' => $module->folder_path . '/css/mod_admin.css', + 'name' => 'mod_admin.css', + 'zip' => 'mod_admin.css' + ]; + $this->file->write( + $fileDetails['path'], + Placefix::_h('BOM') . PHP_EOL + . PHP_EOL . $css + ); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // add the field script + $field_script_bucket[] = Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Custom CSS"; + $field_script_bucket[] = Indent::_(2) + . "\$document->addStyleSheet('" . $target_path + . "/modules/" . $module->folder_name + . "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);"; + } + } + + // add any JavaScript from the fields + if (($javascript = $this->dispenser->get( + 'view_footer', $module->key + )) !== null + && StringHelper::check($javascript)) + { + // make sure this script does not have PHP + if (strpos((string) $javascript, 'add_scripts_field = true; + + // add the JavaScript file + $this->folder->create($module->folder_path . '/js'); + + // add the CSS file + $fileDetails = [ + 'path' => $module->folder_path . '/js/mod_admin.js', + 'name' => 'mod_admin.js', + 'zip' => 'mod_admin.js' + ]; + $this->file->write( + $fileDetails['path'], + Placefix::_h('BOM') . PHP_EOL + . PHP_EOL . $javascript + ); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // add the field script + $field_script_bucket[] = Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Custom JS"; + $field_script_bucket[] = Indent::_(2) + . "\$document->addScript('" . $target_path + . "/modules/" . $module->folder_name + . "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);"; + } + } + + // set fields folders if needed + if ($module->add_scripts_field + || (isset($module->fields_rules_paths) + && $module->fields_rules_paths == 2)) + { + // create fields folder + $this->folder->create($module->folder_path . '/fields'); + + // add the custom script field + if ($module->add_scripts_field) + { + $fileDetails = [ + 'path' => $module->folder_path + . '/fields/modadminvvvvvvvdm.php', + 'name' => 'modadminvvvvvvvdm.php', + 'zip' => 'modadminvvvvvvvdm.php' + ]; + $this->file->write( + $fileDetails['path'], + $this->getCustomScriptField( + $field_script_bucket + ) + ); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + } + + // set rules folders if needed + if (isset($module->fields_rules_paths) + && $module->fields_rules_paths == 2) + { + // create rules folder + $this->folder->create($module->folder_path . '/rules'); + } + + // set forms folder if needed + if (isset($module->form_files) + && ArrayHelper::check( + $module->form_files + )) + { + // create forms folder + $this->folder->create($module->folder_path . '/forms'); + + // set the template files + foreach ($module->form_files as $file => $fields) + { + // set file details + $fileDetails = [ + 'path' => $module->folder_path . '/forms/' . $file . '.xml', + 'name' => $file . '.xml', + 'zip' => 'forms/' . $file . '.xml' + ]; + + // build basic XML + $xml = ''; + $xml .= PHP_EOL . ''; + + // search if we must add the component path + $add_component_path = false; + foreach ($fields as $field_name => $fieldsets) + { + if (!$add_component_path) + { + foreach ($fieldsets as $fieldset => $field) + { + if (!$add_component_path + && isset( + $module->fieldsets_paths[$file + . $field_name . $fieldset] + ) + && $module->fieldsets_paths[$file + . $field_name . $fieldset] == 1) + { + $add_component_path = true; + } + } + } + } + + // only add if part of the component field types path is required + if ($add_component_path) + { + $xml .= PHP_EOL . ''; + } + else + { + $xml .= PHP_EOL . '
'; + } + + // add the fields + foreach ($fields as $field_name => $fieldsets) + { + // check if we have an double fields naming set + $field_name_inner = ''; + $field_name_outer = $field_name; + if (strpos((string) $field_name, '.') !== false) + { + $field_names = explode('.', (string) $field_name); + if (count((array) $field_names) == 2) + { + $field_name_outer = $field_names[0]; + $field_name_inner = $field_names[1]; + } + } + $xml .= PHP_EOL . Indent::_(1) + . ''; + foreach ($fieldsets as $fieldset => $field) + { + // default to the field set name + $label = $fieldset; + if (isset($module->fieldsets_label[$file . $field_name . $fieldset])) + { + $label = $module->fieldsets_label[$file . $field_name . $fieldset]; + } + + // add path to module rules and custom fields + if (isset($module->fieldsets_paths[$file . $field_name . $fieldset]) + && ($module->fieldsets_paths[$file . $field_name . $fieldset] == 2 + || $module->fieldsets_paths[$file . $field_name . $fieldset] == 3)) + { + if ($module->target == 2) + { + if (!isset($module->add_rule_path[$file . $field_name . $fieldset])) + { + $module->add_rule_path[$file . $field_name . $fieldset] = + '/administrator/modules/' + . $module->file_name . '/rules'; + } + + if (!isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $module->add_field_path[$file . $field_name . $fieldset] = + '/administrator/modules/' + . $module->file_name . '/fields'; + } + } + else + { + if (!isset($module->add_rule_path[$file . $field_name . $fieldset])) + { + $module->add_rule_path[$file . $field_name . $fieldset] = + '/modules/' . $module->file_name + . '/rules'; + } + + if (!isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $module->add_field_path[$file . $field_name . $fieldset] = + '/modules/' . $module->file_name + . '/fields'; + } + } + } + + // add path to module rules and custom fields + if (isset($module->add_rule_path[$file . $field_name . $fieldset]) + || isset($module->add_field_path[$file . $field_name . $fieldset])) + { + + $xml .= PHP_EOL . Indent::_(1) . ''; + + $xml .= PHP_EOL . Indent::_(1) . '
add_rule_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . Indent::_(2) + . 'addrulepath="' . $module->add_rule_path[$file . $field_name . $fieldset] . '"'; + } + + if (isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . Indent::_(2) + . 'addfieldpath="' . $module->add_field_path[$file . $field_name . $fieldset] . '"'; + } + + $xml .= PHP_EOL . Indent::_(1) . '>'; + } + else + { + $xml .= PHP_EOL . Indent::_(1) . '
'; + } + + // check if we have an inner field set + if (StringHelper::check( + $field_name_inner + )) + { + $xml .= PHP_EOL . Indent::_(1) + . ''; + } + + // add the placeholder of the fields + $xml .= Placefix::_h('FIELDSET_' . $file + . $field_name . $fieldset ); + + // check if we have an inner field set + if (StringHelper::check( + $field_name_inner + )) + { + $xml .= PHP_EOL . Indent::_(1) + . ''; + } + $xml .= PHP_EOL . Indent::_(1) + . '
'; + } + $xml .= PHP_EOL . Indent::_(1) . ''; + } + $xml .= PHP_EOL . ''; + + // add xml to file + $this->file->write($fileDetails['path'], $xml); + $this->files->appendArray($module->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + } + + // set SQL stuff if needed + if ($module->add_sql || $module->add_sql_uninstall) + { + // create SQL folder + $this->folder->create($module->folder_path . '/sql'); + + // create mysql folder + $this->folder->create( + $module->folder_path . '/sql/mysql' + ); + + // now set the install file + if ($module->add_sql) + { + $this->file->write( + $module->folder_path . '/sql/mysql/install.sql', + $module->sql + ); + + // count the file created + $this->counter->file++; + } + + // now set the uninstall file + if ($module->add_sql_uninstall) + { + $this->file->write( + $module->folder_path + . '/sql/mysql/uninstall.sql', + $module->sql_uninstall + ); + + // count the file created + $this->counter->file++; + } + } + + // creat the language folder + $this->folder->create($module->folder_path . '/language'); + // also create the lang tag folder + $this->folder->create( + $module->folder_path . '/language/' . $this->config->get('lang_tag', 'en-GB') + ); + + // check if this lib has files + if (isset($module->files) + && ArrayHelper::check($module->files)) + { + // add to component files + foreach ($module->files as $file) + { + // set the pathfinder + $file['target_type'] = $module->target_type; + $file['target_id'] = $module->id; + $this->component->appendArray('files', $file); + } + } + + // check if this lib has folders + if (isset($module->folders) + && ArrayHelper::check($module->folders)) + { + // add to component folders + foreach ($module->folders as $folder) + { + // set the pathfinder + $folder['target_type'] = $module->target_type; + $folder['target_id'] = $module->id; + $this->component->appendArray('folders', $folder); + } + } + + // check if this module has urls + if (isset($module->urls) + && ArrayHelper::check($module->urls)) + { + // add to component urls + foreach ($module->urls as $n => &$url) + { + // should we add the local folder + if (isset($url['type']) && $url['type'] > 1 + && isset($url['url']) + && StringHelper::check( + $url['url'] + )) + { + // set file name + $fileName = basename((string) $url['url']); + + // get the file contents + $data = FileHelper::getContent( + $url['url'] + ); + + // build sub path + if (strpos($fileName, '.js') !== false) + { + $path = '/js'; + } + elseif (strpos($fileName, '.css') !== false) + { + $path = '/css'; + } + else + { + $path = ''; + } + + // create sub media path if not set + $this->folder->create( + $module->folder_path . $path + ); + + // set the path to module file + $url['path'] = $module->folder_path . $path + . '/' . $fileName; // we need this for later + + // write data to path + $this->file->write($url['path'], $data); + + // count the file created + $this->counter->file++; + } + } + } + } + } + } + } + + /** + * get the module xml template + * + * @param object $module The module object + * + * @return string + * @since 3.2.0 + */ + protected function getXML(object &$module): string + { + $xml = ''; + $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $module->lang_prefix + . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOR') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOREMAIL') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHORWEBSITE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('COPYRIGHT') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('LICENSE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $module->module_version + . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $module->lang_prefix + . '_XML_DESCRIPTION'; + $xml .= Placefix::_h('MAINXML'); + $xml .= PHP_EOL . ''; + + return $xml; + } + + /** + * get the module admin custom script field + * + * @param array $fieldScriptBucket The field + * + * @return string + * @since 3.2.0 + * + */ + protected function getCustomScriptField(array $fieldScriptBucket): string + { + $form_field_class = []; + $form_field_class[] = Placefix::_h('BOM') . PHP_EOL; + $form_field_class[] = "//" . Line::_(__Line__, __Class__) + . " No direct access to this file"; + $form_field_class[] = "defined('_JEXEC') or die('Restricted access');"; + $form_field_class[] = PHP_EOL . "use Joomla\CMS\Form\FormField;"; + $form_field_class[] = "use Joomla\CMS\Factory;"; + $form_field_class[] = PHP_EOL + . "class JFormFieldModadminvvvvvvvdm extends FormField"; + $form_field_class[] = "{"; + $form_field_class[] = Indent::_(1) + . "protected \$type = 'modadminvvvvvvvdm';"; + $form_field_class[] = PHP_EOL . Indent::_(1) + . "protected function getLabel()"; + $form_field_class[] = Indent::_(1) . "{"; + $form_field_class[] = Indent::_(2) . "return;"; + $form_field_class[] = Indent::_(1) . "}"; + $form_field_class[] = PHP_EOL . Indent::_(1) + . "protected function getInput()"; + $form_field_class[] = Indent::_(1) . "{"; + $form_field_class[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " Get the document"; + $form_field_class[] = Indent::_(2) + . "\$document = Factory::getDocument();"; + $form_field_class[] = implode(PHP_EOL, $fieldScriptBucket); + $form_field_class[] = Indent::_(2) . "return; // noting for now :)"; + $form_field_class[] = Indent::_(1) . "}"; + $form_field_class[] = "}"; + + return implode(PHP_EOL, $form_field_class); + } + +} + diff --git a/src/071c7cff-4c88-4b80-bd99-066c572dcb71/settings.json b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/settings.json new file mode 100644 index 0000000..f717b52 --- /dev/null +++ b/src/071c7cff-4c88-4b80-bd99-066c572dcb71/settings.json @@ -0,0 +1,89 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "071c7cff-4c88-4b80-bd99-066c572dcb71", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structure", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Joomlamodule.Structure", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "cb11e8d9-69c2-4095-831c-59908ea402e7", + "as": "Module" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection4": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection5": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection6": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection7": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection8": { + "use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "as": "default" + }, + "use_selection9": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection10": { + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "as": "default" + }, + "use_selection11": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection12": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection13": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection14": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection15": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection16": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection17": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Joomlamodule.Structure", + "description": "Joomla Module Structure Builder Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/0d08c583-04d5-454e-b756-48ca05e1651a/README.md b/src/0d08c583-04d5-454e-b756-48ca05e1651a/README.md new file mode 100644 index 0000000..db6ae51 --- /dev/null +++ b/src/0d08c583-04d5-454e-b756-48ca05e1651a/README.md @@ -0,0 +1,168 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Readme (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power\Repos** +```uml +@startuml +class Readme #Gold { + # Power $power + # Plantuml $plantuml + + __construct(?Power $power = null, ?Plantuml $plantuml = null) + + get(array $powers) : string + - readmeBuilder($powers) : string + - readmeModel(array $classes) : string + - generateIndex(array $classes) : string + - generateDiagramBucket(array $classes) : string + - defineTypeOrder() : array + - sortClasses(array $classes, array $typeOrder) : void + - compareNamespace(array $a, array $b) : int + - compareType(array $a, array $b, ...) : int + - compareName(array $a, array $b) : int + - generateNamespaceDiagram(string $current_namespace, string $diagrams) : string + - indexLinkPower(string $power) : string + - linkPowerRepo(string $power) : string + - linkPowerCode(string $power) : string + - linkPowerSettings(string $power) : string + - linkPowerGuid(string $power) : string +} + +note right of Readme::__construct + Constructor. + + since: 3.2.0 +end note + +note left of Readme::get + Get Super Power Readme + + since: 3.2.0 + return: string +end note + +note right of Readme::readmeBuilder + The readme builder + + since: 3.2.0 + return: string +end note + +note left of Readme::readmeModel + Sort and model the readme classes + + since: 3.2.0 + return: string +end note + +note right of Readme::generateIndex + Generate the index string for classes + + return: string +end note + +note left of Readme::generateDiagramBucket + Generate the diagram bucket string for classes + + return: string +end note + +note right of Readme::defineTypeOrder + Define the order of types for sorting purposes + + since: 3.2.0 + return: array +end note + +note left of Readme::sortClasses + Sort the flattened array using a single sorting function + + since: 3.2.0 + return: void +end note + +note right of Readme::compareNamespace + Compare the namespace of two classes + + since: 3.2.0 + return: int +end note + +note left of Readme::compareType + Compare the type of two classes + + since: 3.2.0 + return: int + + arguments: + array $a + array $b + array $typeOrder +end note + +note right of Readme::compareName + Compare the name of two classes + + since: 3.2.0 + return: int +end note + +note left of Readme::generateNamespaceDiagram + Generate a namespace diagram string + + return: string +end note + +note right of Readme::indexLinkPower + Build the Link to the power in this repository + + since: 3.2.0 + return: string +end note + +note left of Readme::linkPowerRepo + Build the Link to the power in this repository + + since: 3.2.0 + return: string +end note + +note right of Readme::linkPowerCode + Build the Link to the power settings in this repository + + since: 3.2.0 + return: string +end note + +note left of Readme::linkPowerSettings + Build the Link to the power settings in this repository + + since: 3.2.0 + return: string +end note + +note right of Readme::linkPowerGuid + Build the Link with GUID text to the power in this repository + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0d08c583-04d5-454e-b756-48ca05e1651a/code.php b/src/0d08c583-04d5-454e-b756-48ca05e1651a/code.php new file mode 100644 index 0000000..26a423f --- /dev/null +++ b/src/0d08c583-04d5-454e-b756-48ca05e1651a/code.php @@ -0,0 +1,407 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power\Repos; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Power; +use VDM\Joomla\Componentbuilder\Compiler\Power\Plantuml; + + +/** + * Compiler Power Repos Readme + * @since 3.2.0 + */ +class Readme +{ + /** + * Power Objects + * + * @var Power + * @since 3.2.0 + **/ + protected Power $power; + + /** + * Compiler Powers Plantuml Builder + * + * @var Plantuml + * @since 3.2.0 + **/ + protected Plantuml $plantuml; + + /** + * Constructor. + * + * @param Power|null $power The power object. + * @param Plantuml|null $plantuml The powers plantuml builder object. + * + * @since 3.2.0 + */ + public function __construct(?Power $power = null, ?Plantuml $plantuml = null) + { + $this->power = $power ?: Compiler::_('Power'); + $this->plantuml = $plantuml ?: Compiler::_('Power.Plantuml'); + } + + /** + * Get Super Power Readme + * + * @param array $powers All powers of this super power. + * + * @return string + * @since 3.2.0 + */ + public function get(array $powers): string + { + // build readme + $readme = ["``` +███████╗██╗ ██╗██████╗ ███████╗██████╗ +██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗ +███████╗██║ ██║██████╔╝█████╗ ██████╔╝ +╚════██║██║ ██║██╔═══╝ ██╔══╝ ██╔══██╗ +███████║╚██████╔╝██║ ███████╗██║ ██║ +╚══════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ ███████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗██╔════╝ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝███████╗ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗╚════██║ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║███████║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝╚══════╝ +```"]; + + // default description of super powers + $readme[] = "\n### What is JCB Super Powers?\nThe Joomla Component Builder (JCB) Super Power features are designed to enhance JCB's functionality and streamline the development process. These Super Powers enable developers to efficiently manage and share their custom powers across multiple JCB instances through repositories hosted on [https://git.vdm.dev/[username]/[repository-name]](https://git.vdm.dev). JCB Super Powers are managed using a combination of layers, events, tasks, methods, switches, and algorithms, which work together to provide powerful customization and extensibility options. More details on JCB Super Powers can be found in the [Super Powers Documentation](https://git.vdm.dev/joomla/super-powers/wiki).\n\nIn summary, JCB Super Powers offer a flexible and efficient way to manage and share functionalities between JCB instances. By utilizing a sophisticated system of layers, events, tasks, methods, switches, and algorithms, developers can seamlessly integrate JCB core powers and their custom powers. For more information on how to work with JCB Super Powers, refer to the [Super Powers User Guide](https://git.vdm.dev/joomla/super-powers/wiki).\n\n### What can I find here?\nThis repository contains an index (see below) of all the approved powers within the JCB GUI. During the compilation of a component, these powers are automatically added to the repository, ensuring a well-organized and accessible collection of functionalities.\n"; + + // get the readme body + $readme[] = $this->readmeBuilder($powers); + + // yes you can remove this, but why? + $readme[] = "\n---\n``` + ██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗ + ██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗ + ██║██║ ██║██║ ██║██╔████╔██║██║ ███████║ +██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║ +╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║ + ╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ + ██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗ +██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝ +██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║ +██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║ +╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║ + ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝ +██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ +██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗ +██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝ +██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗ +██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║ +╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝ +```\n> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)\n\n"; + + return implode("\n", $readme); + } + + /** + * The readme builder + * + * @param array $classes The powers. + * + * @return string + * @since 3.2.0 + */ + private function readmeBuilder(array &$powers): string + { + $classes = []; + foreach ($powers as $guid => $power) + { + $power_object = $this->power->get($guid); + if (is_array($power_object->parsed_class_code)) + { + // add to the sort bucket + $classes[] = [ + 'namespace' => $power['namespace'], + 'type' => $power['type'], + 'name' => $power['name'], + 'link' => $this->indexLinkPower($power), + 'diagram' => $this->plantuml->classBasicDiagram($power, $power_object->parsed_class_code) + ]; + } + } + + return $this->readmeModel($classes); + } + + /** + * Sort and model the readme classes + * + * @param array $classes The powers. + * + * @return string + * @since 3.2.0 + */ + private function readmeModel(array &$classes): string + { + $this->sortClasses($classes, $this->defineTypeOrder()); + + $result = $this->generateIndex($classes); + + $diagram_bucket = $this->generateDiagramBucket($classes); + + return $result . $diagram_bucket; + } + + /** + * Generate the index string for classes + * + * @param array $classes The sorted classes + * + * @return string The index string + */ + private function generateIndex(array &$classes): string + { + $result = "# Index of powers\n"; + $current_namespace = null; + + foreach ($classes as $class) + { + if ($class['namespace'] !== $current_namespace) + { + $current_namespace = $class['namespace']; + $result .= "\n- **Namespace**: [{$current_namespace}](#" . + strtolower(str_replace('\\', '-', $current_namespace)) . ")\n"; + } + + // Add the class details + $result .= "\n - " . $class['link']; + } + + return $result; + } + + /** + * Generate the diagram bucket string for classes + * + * @param array $classes The sorted classes + * + * @return string The diagram bucket string + */ + private function generateDiagramBucket(array &$classes): string + { + $diagram_bucket = "\n\n# Class Diagrams\n"; + $current_namespace = null; + $diagrams = ''; + + foreach ($classes as $class) + { + if ($class['namespace'] !== $current_namespace) + { + if ($current_namespace !== null) + { + $diagram_bucket .= $this->generateNamespaceDiagram($current_namespace, $diagrams); + } + $current_namespace = $class['namespace']; + $diagrams = ''; + } + + $diagrams .= $class['diagram']; + } + + // Add the last namespace diagram + $diagram_bucket .= $this->generateNamespaceDiagram($current_namespace, $diagrams); + + return $diagram_bucket; + } + + /** + * Define the order of types for sorting purposes + * + * @return array The order of types + * @since 3.2.0 + */ + private function defineTypeOrder(): array + { + return [ + 'interface' => 1, + 'abstract' => 2, + 'final' => 3, + 'class' => 4, + 'trait' => 5 + ]; + } + + /** + * Sort the flattened array using a single sorting function + * + * @param array $classes The classes to sort + * @param array $typeOrder The order of types + * @since 3.2.0 + */ + private function sortClasses(array &$classes, array $typeOrder): void + { + usort($classes, function ($a, $b) use ($typeOrder) { + $namespaceDiff = $this->compareNamespace($a, $b); + + if ($namespaceDiff !== 0) + { + return $namespaceDiff; + } + + $typeDiff = $this->compareType($a, $b, $typeOrder); + + if ($typeDiff !== 0) + { + return $typeDiff; + } + + return $this->compareName($a, $b); + }); + } + + /** + * Compare the namespace of two classes + * + * @param array $a First class + * @param array $b Second class + * + * @return int Comparison result + * @since 3.2.0 + */ + private function compareNamespace(array $a, array $b): int + { + $namespaceDepthDiff = substr_count($a['namespace'], '\\') - substr_count($b['namespace'], '\\'); + + if ($namespaceDepthDiff === 0) + { + return strcmp($a['namespace'], $b['namespace']); + } + + return $namespaceDepthDiff; + } + + /** + * Compare the type of two classes + * + * @param array $a First class + * @param array $b Second class + * @param array $typeOrder The order of types + * + * @return int Comparison result + * @since 3.2.0 + */ + private function compareType(array $a, array $b, array $typeOrder): int + { + return $typeOrder[$a['type']] - $typeOrder[$b['type']]; + } + + /** + * Compare the name of two classes + * + * @param array $a First class + * @param array $b Second class + * + * @return int Comparison result + * @since 3.2.0 + */ + private function compareName(array $a, array $b): int + { + return strcmp($a['name'], $b['name']); + } + + /** + * Generate a namespace diagram string + * + * @param string $current_namespace The current namespace + * @param string $diagrams The diagrams for the namespace + * + * @return string The namespace diagram string + */ + private function generateNamespaceDiagram(string $current_namespace, string $diagrams): string + { + $namespace_title = str_replace('\\', ' ', $current_namespace); + $diagram_code = "\n## {$namespace_title}\n> namespace {$current_namespace}\n"; + $diagram_code .= "```uml\n@startuml\n\n" . + $this->plantuml->namespaceDiagram($current_namespace, $diagrams) . "\n\n@enduml\n```\n"; + + return $diagram_code; + } + + /** + * Build the Link to the power in this repository + * + * @param string $power The power details. + * + * @return string + * @since 3.2.0 + */ + private function indexLinkPower(array &$power): string + { + return '**' . $power['type'] . ' ' . $power['name'] . "** | " + . $this->linkPowerRepo($power) . ' | ' + . $this->linkPowerCode($power) . ' | ' + . $this->linkPowerSettings($power) . ' | ' + . $this->linkPowerGuid($power); + } + + /** + * Build the Link to the power in this repository + * + * @param string $power The power details. + * + * @return string + * @since 3.2.0 + */ + private function linkPowerRepo(array &$power): string + { + return '[Details](' . $power['path'] . ')'; + } + + /** + * Build the Link to the power settings in this repository + * + * @param string $power The power details. + * + * @return string + * @since 3.2.0 + */ + private function linkPowerCode(array &$power): string + { + return '[Code](' . $power['code'] . ')'; + } + + /** + * Build the Link to the power settings in this repository + * + * @param string $power The power details. + * + * @return string + * @since 3.2.0 + */ + private function linkPowerSettings(array &$power): string + { + return '[Settings](' . $power['settings'] . ')'; + } + + /** + * Build the Link with GUID text to the power in this repository + * + * @param string $power The power details. + * + * @return string + * @since 3.2.0 + */ + private function linkPowerGuid(array &$power): string + { + return '[' . $power['guid'] . '](' . $power['path'] . ')'; + } + +} + diff --git a/src/0d08c583-04d5-454e-b756-48ca05e1651a/settings.json b/src/0d08c583-04d5-454e-b756-48ca05e1651a/settings.json new file mode 100644 index 0000000..582681c --- /dev/null +++ b/src/0d08c583-04d5-454e-b756-48ca05e1651a/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "0d08c583-04d5-454e-b756-48ca05e1651a", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Readme", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Repos.Readme", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "as": "default" + }, + "use_selection2": { + "use": "ff5e9e63-86d0-4691-ab59-d4b9d9154096", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Repos.Readme", + "description": "Compiler Power Repos Readme\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/README.md b/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/README.md new file mode 100644 index 0000000..a442283 --- /dev/null +++ b/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/README.md @@ -0,0 +1,83 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Loader (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Loader #Gold { + # Config $config + # Registry $registry + + __construct(?Config $config = null, ?Registry $registry = null) + + set(string $key, string $content, ...) : void + + uikit(string $key, string $content) : void + # getFootableScripts(string $content) : bool + # getGetModule(string $content) : bool + # getGoogleChart(string $content) : bool +} + +note right of Loader::__construct + Constructor + + since: 3.2.0 +end note + +note right of Loader::set + Automatically load some stuff + + since: 3.2.0 + return: void + + arguments: + string $key + string $content + ?string $target = null +end note + +note right of Loader::uikit + Automatically load uikit version 2 data files + + since: 3.2.0 + return: void +end note + +note right of Loader::getFootableScripts + Check for footable scripts + + since: 3.2.0 + return: bool +end note + +note right of Loader::getGetModule + Check for getModules script + + since: 3.2.0 + return: bool +end note + +note right of Loader::getGoogleChart + Check for get Google Chart script + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/code.php b/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/code.php new file mode 100644 index 0000000..d371c44 --- /dev/null +++ b/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/code.php @@ -0,0 +1,185 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\Component\Helper; + + +/** + * Model Auto Loader Class + * + * @since 3.2.0 + */ +class Loader +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Automatically load some stuff + * + * @param string $key The key mapper + * @param string $content The content to search through + * @param string|null $target The area being targeted + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, string $content, ?string $target = null) + { + // set the target + $target = $target ?: $this->config->build_target; + + // check for footable + if (!$this->registry-> + exists('builder.footable_scripts.' . $target . '.' . $key)) + { + if ($this->getFootableScripts($content)) + { + $this->registry-> + set('builder.footable_scripts.' . $target . '.' . $key, true); + + $this->config->set('footable', true); + } + } + + // check for google chart + if (!$this->registry-> + exists('builder.google_chart.' . $target . '.' . $key)) + { + if ($this->getGoogleChart($content)) + { + $this->registry-> + set('builder.google_chart.' . $target . '.' . $key, true); + + $this->config->set('google_chart', true); + } + } + + // check for get module + if (!$this->registry-> + exists('builder.get_module.' . $target . '.' . $key)) + { + if ($this->getGetModule($content)) + { + $this->registry-> + set('builder.get_module.' . $target . '.' . $key, true); + } + } + } + + /** + * Automatically load uikit version 2 data files + * + * @param string $key The key mapper + * @param string $content The content to search through + * + * @return void + * @since 3.2.0 + */ + public function uikit(string $key, string $content) + { + // get/set uikit state + $uikit = false; + $uikit_ = $this->config->get('uikit', 0); + + // add uikit if required + if (2 == $uikit_ || 1 == $uikit_) + { + $uikit = true; + } + + // load uikit + if ($uikit) + { + // set uikit to views TODO: convert this getUikitComp to a class + if (($found = Helper::_('getUikitComp', + [$content, (array) $this->registry->get('builder.uikit_comp.' . $key, [])] + )) !== false) + { + $this->registry->set('builder.uikit_comp.' . $key, $found); + } + } + } + + /** + * Check for footable scripts + * + * @param string $content The content to check + * + * @return boolean True if found + * @since 3.2.0 + */ + protected function getFootableScripts(string &$content): bool + { + return strpos($content, 'footable') !== false; + } + + /** + * Check for getModules script + * + * @param string $content The content to check + * + * @return boolean True if found + * @since 3.2.0 + */ + protected function getGetModule(string &$content): bool + { + return strpos($content, 'this->getModules(') !== false; + } + + /** + * Check for get Google Chart script + * + * @param string $content The content to check + * + * @return boolean True if found + * @since 3.2.0 + */ + protected function getGoogleChart(string &$content): bool + { + return strpos($content, 'Chartbuilder(') !== false; + } + +} + diff --git a/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/settings.json b/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/settings.json new file mode 100644 index 0000000..a13af62 --- /dev/null +++ b/src/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Loader", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Loader", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Loader", + "description": "Model Auto Loader Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/README.md b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/README.md new file mode 100644 index 0000000..c69a501 --- /dev/null +++ b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Permissions (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Permissions #Gold { + + set(object $item) : void +} + +note right of Permissions::set + Set the local tabs + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php new file mode 100644 index 0000000..3c03e49 --- /dev/null +++ b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/code.php @@ -0,0 +1,49 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Permissions Class + * + * @since 3.2.0 + */ +class Permissions +{ + /** + * Set the local tabs + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addpermissions = (isset($item->addpermissions) + && JsonHelper::check($item->addpermissions)) + ? json_decode((string) $item->addpermissions, true) : null; + + if (ArrayHelper::check($item->addpermissions)) + { + $item->permissions = array_values($item->addpermissions); + } + + unset($item->addpermissions); + } + +} + diff --git a/src/0dabc67c-abec-4541-82bf-279abd3c9be1/settings.json b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/settings.json new file mode 100644 index 0000000..993a5f9 --- /dev/null +++ b/src/0dabc67c-abec-4541-82bf-279abd3c9be1/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "0dabc67c-abec-4541-82bf-279abd3c9be1", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Permissions", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Permissions", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Permissions", + "description": "Model Permissions Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/README.md b/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/README.md new file mode 100644 index 0000000..81e7550 --- /dev/null +++ b/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface PowerInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface PowerInterface #Lavender { + + load(array $guids) : void + + get(string $guid, int $build) : mixed +} + +note right of PowerInterface::load + load all the powers linked to this component + + since: 3.2.0 + return: void +end note + +note right of PowerInterface::get + Get a power + + since: 3.2.0 + return: mixed +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/code.php b/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/code.php new file mode 100644 index 0000000..88a3ec3 --- /dev/null +++ b/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/code.php @@ -0,0 +1,43 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler Power Interface + * + * @since 3.2.0 + */ +interface PowerInterface +{ + /** + * load all the powers linked to this component + * + * @param array $guids The global unique ids of the linked powers + * + * @return void + * @since 3.2.0 + */ + public function load(array $guids); + + /** + * Get a power + * + * @param string $guid The global unique id of the power + * @param int $build Force build switch (to override global switch) + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $guid, int $build = 0); +} + diff --git a/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/settings.json b/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/settings.json new file mode 100644 index 0000000..374c3b9 --- /dev/null +++ b/src/1133c2d7-ba7e-4c95-8cde-01f084d04682/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "Registry", + "guid": "1133c2d7-ba7e-4c95-8cde-01f084d04682", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "PowerInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.PowerInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.PowerInterface", + "description": "Compiler Power Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/README.md b/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/README.md new file mode 100644 index 0000000..9e7109c --- /dev/null +++ b/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Tabs (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Tabs #Gold { + + set(object $item) : void +} + +note right of Tabs::set + Set the local tabs + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/code.php b/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/code.php new file mode 100644 index 0000000..f882ffc --- /dev/null +++ b/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/code.php @@ -0,0 +1,71 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Tabs Class + * + * @since 3.2.0 + */ +class Tabs +{ + /** + * Set the local tabs + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addtabs = (isset($item->addtabs) + && JsonHelper::check($item->addtabs)) + ? json_decode((string) $item->addtabs, true) : null; + + if (ArrayHelper::check($item->addtabs)) + { + $nr = 1; + foreach ($item->addtabs as $tab) + { + $item->tabs[$nr] = trim((string) $tab['name']); + $nr++; + } + } + + // if Details tab is not set, then set it here + if (!isset($item->tabs[1])) + { + $item->tabs[1] = 'Details'; + } + + // always make sure that publishing is lowercase + if (($removeKey = array_search( + 'publishing', array_map('strtolower', $item->tabs) + )) !== false) + { + $item->tabs[$removeKey] = 'publishing'; + } + + // make sure to set the publishing tab (just in case we need it) + $item->tabs[15] = 'publishing'; + + unset($item->addtabs); + } + +} + diff --git a/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/settings.json b/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/settings.json new file mode 100644 index 0000000..a6a9181 --- /dev/null +++ b/src/143ac6ea-b64f-4331-9a97-31e3fce2bb69/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "143ac6ea-b64f-4331-9a97-31e3fce2bb69", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Tabs", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Tabs", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Tabs", + "description": "Model Tabs Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/README.md b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/README.md new file mode 100644 index 0000000..2a574fe --- /dev/null +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/README.md @@ -0,0 +1,68 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Historycomponent (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Historycomponent #Gold { + # Config $config + # HistoryInterface $history + # Updatesql $updatesql + + __construct(?Config $config = null, ?HistoryInterface $history = null, ...) + + set(object $item) : void + - setAdminView(object $item) : void + - setComponent(object $item) : void +} + +note right of Historycomponent::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?HistoryInterface $history = null + ?Updatesql $updatesql = null +end note + +note right of Historycomponent::set + check if an update SQL is needed + + since: 3.2.0 + return: void +end note + +note right of Historycomponent::setAdminView + check if an update SQL is needed + + since: 3.2.0 + return: void +end note + +note right of Historycomponent::setComponent + Set the component history + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php new file mode 100644 index 0000000..dca3671 --- /dev/null +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/code.php @@ -0,0 +1,150 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\JsonHelper; + + +/** + * Model Component History Class + * + * @since 3.2.0 + */ +class Historycomponent +{ + /** + * The compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler history + * + * @var HistoryInterface + * @since 3.2.0 + */ + protected HistoryInterface $history; + + /** + * The compiler update sql + * + * @var Updatesql + * @since 3.2.0 + */ + protected Updatesql $updatesql; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param HistoryInterface|null $history The compiler history object. + * @param Updatesql|null $updatesql The compiler updatesql object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?HistoryInterface $history = null, + ?Updatesql $updatesql = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->history = $history ?: Compiler::_('History'); + $this->updatesql = $updatesql ?: Compiler::_('Model.Updatesql'); + } + + /** + * check if an update SQL is needed + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + // update SQL for admin views + $this->setAdminView($item); + + // update SQL for component + $this->setComponent($item); + } + + /** + * check if an update SQL is needed + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + private function setAdminView(object $item) + { + $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)) + { + if (isset($old_admin_views->addadmin_views) + && JsonHelper::check( + $old_admin_views->addadmin_views + )) + { + $this->updatesql->set( + json_decode((string) $old_admin_views->addadmin_views, true), + $item->addadmin_views, 'adminview' + ); + } + } + } + + /** + * Set the component history + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + private function setComponent(object &$item) + { + $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)) + { + $old_component_version = preg_replace( + '/[^0-9.]+/', '', (string) $old_component->component_version + ); + if ($old_component_version != $this->config->component_version) + { + // yes, this is a new version, this mean there may + // be manual sql and must be checked and updated + $item->old_component_version + = $old_component_version; + } + } + } + +} + diff --git a/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/settings.json b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/settings.json new file mode 100644 index 0000000..25a5de6 --- /dev/null +++ b/src/17a728e9-d6cf-4060-9efb-241b0ff2f981/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "17a728e9-d6cf-4060-9efb-241b0ff2f981", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Historycomponent", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Historycomponent", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "4325745f-da1f-4d4d-a591-3189fe8c06e5", + "as": "default" + }, + "use_selection3": { + "use": "b80296eb-4718-4ed3-894d-69f3ac293733", + "as": "default" + }, + "use_selection4": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection5": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection6": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection7": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Historycomponent", + "description": "Model Component History Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/1aefb8f5-486f-4f00-adf9-696340b3254e/README.md b/src/1aefb8f5-486f-4f00-adf9-696340b3254e/README.md new file mode 100644 index 0000000..46d50d1 --- /dev/null +++ b/src/1aefb8f5-486f-4f00-adf9-696340b3254e/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface InstallInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension** +```uml +@startuml +interface InstallInterface #Lavender { + + getOfficialName() : string + + getClassName() : string + + getInstallerClassName() : string +} + +note right of InstallInterface::getOfficialName + The extension official name + + since: 3.2.0 + return: string +end note + +note right of InstallInterface::getClassName + The extension class name + + since: 3.2.0 + return: string +end note + +note right of InstallInterface::getInstallerClassName + The extension installer class name + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1aefb8f5-486f-4f00-adf9-696340b3254e/code.php b/src/1aefb8f5-486f-4f00-adf9-696340b3254e/code.php new file mode 100644 index 0000000..24baca0 --- /dev/null +++ b/src/1aefb8f5-486f-4f00-adf9-696340b3254e/code.php @@ -0,0 +1,46 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension; + + +/** + * The properties an extension should have to be passed to the InstallScript class + * + * @since 3.2.0 + */ +interface InstallInterface +{ + /** + * The extension official name + * + * @return string + * @since 3.2.0 + */ + public function getOfficialName(): string; + + /** + * The extension class name + * + * @return string + * @since 3.2.0 + */ + public function getClassName(): string; + + /** + * The extension installer class name + * + * @return string + * @since 3.2.0 + */ + public function getInstallerClassName(): string; +} + diff --git a/src/1aefb8f5-486f-4f00-adf9-696340b3254e/settings.json b/src/1aefb8f5-486f-4f00-adf9-696340b3254e/settings.json new file mode 100644 index 0000000..4027dfb --- /dev/null +++ b/src/1aefb8f5-486f-4f00-adf9-696340b3254e/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "1aefb8f5-486f-4f00-adf9-696340b3254e", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "InstallInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Extension.InstallInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Extension.InstallInterface", + "description": "The properties an extension should have to be passed to the InstallScript class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md new file mode 100644 index 0000000..cdbfc1b --- /dev/null +++ b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Gui (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode** +```uml +@startuml +class Gui #Gold { + # Config $config + # Reverse $reverse + # \JDatabaseDriver $db + # CMSApplication $app + + __construct(?Config $config = null, ?Reverse $reverse = null, ...) + + set(string $string, array $config) : string + + search(string $file, array $placeholders, ...) : void + # check(string $code) : bool +} + +note right of Gui::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Reverse $reverse = null + ?\JDatabaseDriver $db = null + ?CMSApplication $app = null +end note + +note right of Gui::set + Set the JCB GUI code placeholder + + since: 3.2.0 + return: string +end note + +note right of Gui::search + search a file for gui code blocks that were updated in the IDE + + since: 3.2.0 + return: void + + arguments: + string $file + array $placeholders + string $today + string $target +end note + +note right of Gui::check + search a code to see if there is already any custom +code or other reasons not to add the GUI code placeholders + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php new file mode 100644 index 0000000..d827bd4 --- /dev/null +++ b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/code.php @@ -0,0 +1,252 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\GuiInterface; + + +/** + * Compiler Gui Custom Code + * + * @since 3.2.0 + */ +class Gui implements GuiInterface +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder Reverse + * + * @var Reverse + * @since 3.2.0 + **/ + protected Reverse $reverse; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Reverse|null $reverse The compiler placeholder reverse 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, + ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); + $this->db = $db ?: Factory::getDbo(); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set the JCB GUI code placeholder + * + * @param string $string The code string + * @param array $config The placeholder config values + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, array $config): string + { + if (StringHelper::check($string)) + { + if ($this->config->get('add_placeholders', false) + && $this->check($string) && ArrayHelper::check($config) + && isset($config['table']) && StringHelper::check($config['table']) + && isset($config['field']) && StringHelper::check($config['field']) + && isset($config['type']) && StringHelper::check($config['type']) + && isset($config['id']) && is_numeric($config['id'])) + { + // if we have a key we must get the ID + if (isset($config['key']) && StringHelper::check($config['key']) && $config['key'] !== 'id') + { + if (($id = GetHelper::var($config['table'], $config['id'], $config['key'], 'id')) !== false && is_numeric($id)) + { + $config['id'] = $id; + } + else + { + // we must give a error message to inform the user of this issue. (should never happen) + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_ID_MISMATCH_WAS_DETECTED_WITH_THE_SSSS_GUI_CODE_FIELD_SO_THE_PLACEHOLDER_WAS_NOT_SET', + $config['table'], $config['field'], + $config['key'], $config['id'] + ), 'Error' + ); + // check some config + if (!isset($config['prefix'])) + { + $config['prefix'] = ''; + } + + return $config['prefix'] . $string; + } + } + // check some config + if (!isset($config['prefix'])) + { + $config['prefix'] = PHP_EOL; + } + // add placeholder based on type of code + switch (strtolower((string) $config['type'])) + { + // adding with html commenting + case 'html': + $front = $config['prefix'] . '' . PHP_EOL; + $back = '' + ); + + if (($guiCode = ArrayHelper::merge($guiCode)) !== false + && ArrayHelper::check($guiCode, true)) + { + foreach ($guiCode as $code) + { + $first_line = strtok($code, PHP_EOL); + // get the GUI target details + $query = explode('.', trim($first_line, '.')); + // only continue if we have 3 values in the query + if (is_array($query) && count($query) >= 3) + { + // cleanup the newlines around the code + $code = trim(str_replace($first_line, '', (string) $code), PHP_EOL) + . PHP_EOL; + // set the ID + $id = (int) $query[2]; + // make the field name save + $field = FieldHelper::safe($query[1]); + // make the table name save + $table = StringHelper::safe($query[0]); + // reverse placeholder as much as we can + $code = $this->reverse->engine( + $code, $placeholders, $target, $id, $field, $table + ); + // update the GUI/Tables/Database + $object = new \stdClass(); + $object->id = $id; + $object->{$field} = base64_encode( + (string) $code + ); // (TODO) this may not always work... + // update the value in GUI + $this->db->updateObject( + '#__componentbuilder_' . (string) $table, $object, 'id' + ); + } + } + } + } + + /** + * search a code to see if there is already any custom + * code or other reasons not to add the GUI code placeholders + * + * @param string $code The code to check + * + * @return bool true if GUI code placeholders can be added + * @since 3.2.0 + */ + protected function check(string &$code): bool + { + // check for customcode placeholders + // we do not add GUI wrapper placeholder to code + // that already has any customcode placeholders + return strpos($code, '$$$$') === false; + } + +} + diff --git a/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/settings.json b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/settings.json new file mode 100644 index 0000000..94dc480 --- /dev/null +++ b/src/1bd48df2-4f7e-4581-9fe9-4b54e59105e3/settings.json @@ -0,0 +1,52 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "implements": [ + "2cc8517d-1105-4697-9743-048b4b7c089c" + ], + "implements_custom": "", + "load_selection": null, + "name": "Gui", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode.Gui", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection4": { + "use": "9ef0eb24-aae4-4f5a-99af-d724db44808f", + "as": "default" + }, + "use_selection5": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection6": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection7": { + "use": "ca111518-e47c-4049-b1b2-cb010f23866f", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.Gui", + "description": "Compiler Gui Custom Code\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;" +} \ No newline at end of file diff --git a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md new file mode 100644 index 0000000..a440882 --- /dev/null +++ b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class External (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode** +```uml +@startuml +class External #Gold { + # array $code + # array $cutter + # Placeholder $placeholder + # \JDatabaseDriver $db + # User $user + # CMSApplication $app + + __construct(?Placeholder $placeholder = null, ?\JDatabaseDriver $db = null, ...) + + set(string $string, int $debug) : string + # getCode(string $target, array $bucket) : void + # cut(string $string, string $sequence, ...) : string +} + +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 + Set the external code string & load it in to string + + since: 3.2.0 + return: string +end note + +note right of External::getCode + Get the External Code/String + + since: 3.2.0 + return: void +end note + +note right of External::cut + Cut the External Code/String + + since: 3.2.0 + return: string + + arguments: + string $string + string $sequence + string $key +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php new file mode 100644 index 0000000..1b8acfc --- /dev/null +++ b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/code.php @@ -0,0 +1,399 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use Joomla\CMS\Factory; +use Joomla\CMS\User\User; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\Path; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\ExternalInterface; + + +/** + * Compiler External Custom Code + * + * @since 3.2.0 + */ +class External implements ExternalInterface +{ + /** + * The external code/string to be added + * + * @var array + * @since 3.2.0 + */ + protected array $code = []; + + /** + * The external code/string cutter + * + * @var array + * @since 3.2.0 + */ + protected array $cutter = []; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * User object + * + * @var User + * @since 3.2.0 + **/ + protected User $user; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $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) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->db = $db ?: Factory::getDbo(); + $this->user = $user ?: Factory::getUser(); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set the external code string & load it in to string + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, int $debug = 0): string + { + // check if content has custom code placeholder + if (strpos($string, '[EXTERNA' . 'LCODE=') !== false) + { + // if debug + if ($debug) + { + echo 'External Code String:'; + var_dump($string); + } + // target content + $bucket = []; + $found = GetHelper::allBetween( + $string, '[EXTERNA' . 'LCODE=', ']' + ); + if (ArrayHelper::check($found)) + { + // build local bucket + foreach ($found as $target) + { + // check for cutting sequence + // example: >{3|4 + // will cut 3 rows at top and 4 rows at bottom + // if the external code has 8 or more lines + if (($pos = strpos((string) $target, '>{')) !== false) + { + // the length + $target_len = strlen((string) $target); + // where to cut + $cutting = $target_len - $pos; + // get the sequence + $sequence = substr((string) $target, "-$cutting"); + // remove from the URL + $target_url = str_replace($sequence, '', (string) $target); + // set the cut key for this target if not set + $this->cutter[trim((string) $target)] = str_replace('>{', '', $sequence); + } + else + { + $target_url = $target; + } + // check if the target is valid URL or path + if ((!filter_var($target_url, FILTER_VALIDATE_URL) === false + && FileHelper::exists($target_url)) + || (Path::clean($target_url) === $target_url + && FileHelper::exists($target_url))) + { + $this->getCode($target, $bucket); + } + // give notice that target is not a valid url/path + else + { + // set key + $key = '[EXTERNA' . 'LCODE=' . $target . ']'; + // set the notice + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE' + ), 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH', + $key + ), 'Warning' + ); + // remove the placeholder + $bucket[$key] = ''; + } + } + // now update local string if bucket has values + if (ArrayHelper::check($bucket)) + { + $string = $this->placeholder->update($string, $bucket); + } + } + // if debug + if ($debug) + { + echo 'External Code String After Update:'; + var_dump($string); + } + } + + return $string; + } + + /** + * Get the External Code/String + * + * @param string $string The content to check + * @param array $bucket The Placeholders bucket + * + * @return void + * @since 3.2.0 + */ + protected function getCode(string $target, array &$bucket) + { + // set URL key + $target_key = trim($target); + // set key + $key = '[EXTERNA' . 'LCODE=' . $target . ']'; + // remove the cut sequence from the url + if (isset($this->cutter[$target_key])) + { + // remove from the URL + $target_url = trim(str_replace('>{' . $this->cutter[$target_key], '', $target)); + } + else + { + $target_url = trim($target); + } + // check if we already fetched this + if (!isset($this->code[$target_key])) + { + // get the data string (code) + $this->code[$target_key] + = FileHelper::getContent($target_url); + // check if we must cut this + if (isset($this->cutter[$target_key]) && + $this->cutter[$target_key]) + { + $this->code[$target_key] = $this->cut( + $this->code[$target_key], + $this->cutter[$target_key], + $key + ); + } + // did we get any value + if (StringHelper::check( + $this->code[$target_key] + )) + { + // check for changes + $live_hash = md5($this->code[$target_key]); + // check if it exists local + if ($hash = GetHelper::var( + 'external_code', $target_key, 'target', 'hash' + )) + { + // must be an admin make a change to use EXTERNAL code (we may add a custom access switch - use ADMIN for now) + if ($hash !== $live_hash && $this->user->authorise( + 'core.admin', 'com_componentbuilder' + )) + { + // update the hash since it changed + $object = new \stdClass(); + $object->target = $target_key; + $object->hash = $live_hash; + // update local hash + $this->db->updateObject( + '#__componentbuilder_external_code', $object, + 'target' + ); + // give notice of the change + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE'), + 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB', + $key + ), 'Warning' + ); + } + elseif ($hash !== $live_hash) + { + // set the notice + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_S_WE_DETECTED_A_CHANGE_IN_BEXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_CHANGE_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL', + $this->user->get('name'), $key + ), 'Error' + ); + // remove the code/string + $this->code[$target_key] = ''; + } + } + // only an admin can add new EXTERNAL code (we may add a custom access switch - use ADMIN for now) + elseif ($this->user->authorise( + 'core.admin', 'com_componentbuilder' + )) + { + // add the hash to track changes + $object = new \stdClass(); + $object->target = $target_key; + $object->hash = $live_hash; + // insert local hash + $this->db->insertObject( + '#__componentbuilder_external_code', $object + ); + // give notice the first time this is added + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE'), + 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB', + $key + ), 'Warning' + ); + } + else + { + // set the notice + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_NEW_CODESTRING_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOU_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL', + $this->user->get('name'), $key + ), 'Error' + ); + // remove the code/string + $this->code[$target_key] = ''; + } + } + else + { + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING', $key + ), 'Error' + ); + } + } + + // add to local bucket + $bucket[$key] = $this->code[$target_key] ?? ''; + } + + /** + * Cut the External Code/String + * + * @param string $string The content to cut + * @param string $sequence The cutting sequence + * @param string $key The content key + * + * @return string + * @since 3.2.0 + */ + protected function cut(string $string, string $sequence, string $key): string + { + // we first break the string up in rows + $rows = (array) explode(PHP_EOL, $string); + // get the cutting sequence + $cutter = (array) explode('|', $sequence); + // we only continue if we have more rows than we have to cut + if (array_sum($cutter) < ArrayHelper::check($rows)) + { + // remove the rows at the bottom if needed + if (isset($cutter[1]) && $cutter[1] > 0) + { + array_splice($rows, "-$cutter[1]"); + } + // remove the rows at the top if needed + if ($cutter[0] > 0) + { + $rows = array_splice($rows, $cutter[0]); + } + + // return the remaining rows + return implode(PHP_EOL, $rows); + } + + // we set an error message about too few lines to cut + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING', + $key + ), 'Error' + ); + + return ''; + } + +} + diff --git a/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/settings.json b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/settings.json new file mode 100644 index 0000000..92f29a5 --- /dev/null +++ b/src/1cef0266-99e2-40d8-919f-c2ce32226b0a/settings.json @@ -0,0 +1,44 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "1cef0266-99e2-40d8-919f-c2ce32226b0a", + "implements": [ + "1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a" + ], + "implements_custom": "", + "load_selection": null, + "name": "External", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode.External", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection4": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection5": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.External", + "description": "Compiler External Custom Code\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\User\\User;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Filesystem\\Path;" +} \ No newline at end of file diff --git a/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/README.md b/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/README.md new file mode 100644 index 0000000..a86cd74 --- /dev/null +++ b/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Updateserver (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Updateserver #Gold { + + set(object $item) : void + # changelog(object $item) : void +} + +note right of Updateserver::set + Set version updates + + since: 3.2.0 + return: void +end note + +note right of Updateserver::changelog + Set changelog values to component changelog + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/code.php b/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/code.php new file mode 100644 index 0000000..02c8cdb --- /dev/null +++ b/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/code.php @@ -0,0 +1,80 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Joomla Update Server Class + * + * @since 3.2.0 + */ +class Updateserver +{ + /** + * Set version updates + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + // set the version updates + $item->version_update = (isset($item->version_update) + && JsonHelper::check($item->version_update)) + ? json_decode((string) $item->version_update, true) : null; + if (ArrayHelper::check($item->version_update)) + { + $item->version_update = array_values( + $item->version_update + ); + + // set the change log details + $this->changelog($item); + } + } + + /** + * Set changelog values to component changelog + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + protected function changelog(object &$item) + { + // set the version updates + $bucket = []; + foreach ($item->version_update as $update) + { + if (isset($update['change_log']) && StringHelper::check($update['change_log']) + && isset($update['version']) && StringHelper::check($update['version'])) + { + $bucket[] = '# v' . $update['version'] . PHP_EOL . PHP_EOL . $update['change_log']; + } + } + + if (ArrayHelper::check($bucket)) + { + $item->changelog = implode(PHP_EOL . PHP_EOL, $bucket); + } + } + +} + diff --git a/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/settings.json b/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/settings.json new file mode 100644 index 0000000..cf12ac8 --- /dev/null +++ b/src/1d0fd857-12ec-4f47-ab1c-124d85748e24/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "1d0fd857-12ec-4f47-ab1c-124d85748e24", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Updateserver", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Updateserver", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Updateserver", + "description": "Model Joomla Update Server Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md b/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md new file mode 100644 index 0000000..0711f8f --- /dev/null +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/README.md @@ -0,0 +1,86 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class InstallScript (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree** +```uml +@startuml +class InstallScript #Gold { + # object $extension + # array $methods + # array $types + # array $construct + # array $install + # array $update + # array $uninstall + # bool $preflightActive + # bool $postflightActive + + get(object $extension) : string + # build() : string + # head() : string + # construct() : string + # main(string $name) : string + # flight(string $name) : string +} + +note right of InstallScript::get + get install script + + since: 3.2.0 + return: string +end note + +note right of InstallScript::build + build the install class + + since: 3.2.0 + return: string +end note + +note right of InstallScript::head + get install script head + + since: 3.2.0 + return: string +end note + +note right of InstallScript::construct + get constructor + + since: 3.2.0 + return: string +end note + +note right of InstallScript::main + build main methods + + since: 3.2.0 + return: string +end note + +note right of InstallScript::flight + build flight methods + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php new file mode 100644 index 0000000..3e34d41 --- /dev/null +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/code.php @@ -0,0 +1,371 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree; + + +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension\InstallInterface; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; + + +/** + * Loading the Extension Installation Script Class + * + * @since 3.2.0 + */ +class InstallScript implements GetScriptInterface +{ + /** + * The extension + * + * @var InstallInterface|Object + * @since 3.2.0 + */ + protected object $extension; + + /** + * The methods + * + * @var array + * @since 3.2.0 + */ + protected array $methods = ['php_script', 'php_preflight', 'php_postflight', 'php_method']; + + /** + * The types + * + * @var array + * @since 3.2.0 + */ + protected array $types = ['construct', 'install', 'update', 'uninstall', 'discover_install']; + + /** + * The construct bucket + * + * @var array + * @since 3.2.0 + */ + protected array $construct = []; + + /** + * The install bucket + * + * @var array + * @since 3.2.0 + */ + protected array $install = []; + + /** + * The update bucket + * + * @var array + * @since 3.2.0 + */ + protected array $update = []; + + /** + * The uninstall bucket + * + * @var array + * @since 3.2.0 + */ + protected array $uninstall = []; + + /** + * The preflight switch + * + * @var bool + * @since 3.2.0 + */ + protected bool $preflightActive = false; + + /** + * The preflight bucket + * + * @var array + * @since 3.2.0 + */ + protected array $preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * The postflight switch + * + * @var bool + * @since 3.2.0 + */ + protected bool $postflightActive = false; + + /** + * The postflight bucket + * + * @var array + * @since 3.2.0 + */ + protected array $postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * get install script + * + * @param Object $extension The extension object + * + * @return string + * @since 3.2.0 + */ + public function get(object $extension): string + { + // loop over methods and types + foreach ($this->methods as $method) + { + foreach ($this->types as $type) + { + if (isset($extension->{'add_' . $method . '_' . $type}) + && $extension->{'add_' . $method . '_' . $type} == 1 + && StringHelper::check( + $extension->{$method . '_' . $type} + )) + { + // add to the main methods + if ('php_method' === $method || 'php_script' === $method) + { + $this->{$type}[] = $extension->{$method . '_' . $type}; + } + else + { + // get the flight key + $flight = str_replace('php_', '', (string) $method); + // load the script to our bucket + $this->{$flight . 'Bucket'}[$type][] = $extension->{$method . '_' . $type}; + // show that the method is active + $this->{$flight . 'Active'} = true; + } + } + } + } + + $this->extension = $extension; + + // return the class + return $this->build(); + } + + /** + * build the install class + * + * @return string + * @since 3.2.0 + */ + protected function build(): string + { + // start build + $script = $this->head(); + + // load constructor if set + $script .= $this->construct(); + + // load install method if set + $script .= $this->main('install'); + + // load update method if set + $script .= $this->main('update'); + + // load uninstall method if set + $script .= $this->main('uninstall'); + + // load preflight method if set + $script .= $this->flight('preflight'); + + // load postflight method if set + $script .= $this->flight('postflight'); + + // close the class + $script .= PHP_EOL . '}' . PHP_EOL; + + return $script; + } + + /** + * get install script head + * + * @return string + * @since 3.2.0 + */ + protected function head(): string + { + // get the extension + $extension = $this->extension; + + // start build + $script = PHP_EOL . '/**'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; + $script .= PHP_EOL . ' *'; + $script .= PHP_EOL . ' * @package ' . $extension->class_name; + $script .= PHP_EOL . ' */'; + $script .= PHP_EOL . 'class ' . $extension->installer_class_name; + $script .= PHP_EOL . '{'; + + return $script; + } + + /** + * get constructor + * + * @return string + * @since 3.2.0 + */ + protected function construct(): string + { + // return empty string if not set + if (!ArrayHelper::check($this->construct)) + { + return ''; + } + + // the __construct script + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Constructor'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) + . 'public function __construct($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build main methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function main(string $name): string + { + // return empty string if not set + if (!ArrayHelper::check($this->{$name})) + { + return ''; + } + // load the install method + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . " * Called on $name"; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); + // return true + if ('uninstall' !== $name) + { + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + } + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + + /** + * build flight methods + * + * @param string $name the method being called + * + * @return string + * @since 3.2.0 + */ + protected function flight(string $name): string + { + // return empty string if not set + if (empty($this->{$name . 'Active'})) + { + return ''; + } + + // the pre/post function types + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . Indent::_(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' + . $name . '($route, $adapter)'; + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + . ' get application'; + $script .= PHP_EOL . Indent::_(2) + . '$app = JFactory::getApplication();' . PHP_EOL; + + // add the default version check (TODO) must make this dynamic + if ('preflight' === $name) + { + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + .' the default for both install and update'; + $script .= PHP_EOL . Indent::_(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . Indent::_(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . Indent::_(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . Indent::_(3) . 'return false;'; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + + // now add the scripts + foreach ($this->{$name . 'Bucket'} as $route => $_script) + { + if (ArrayHelper::check($_script)) + { + // set the if and script + $script .= PHP_EOL . Indent::_(2) . "if ('" . $route + . "' === \$route)"; + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; + } + } + + // return true + $script .= PHP_EOL . Indent::_(2) . 'return true;'; + // close the function + $script .= PHP_EOL . Indent::_(1) . '}'; + + return $script; + } + +} + diff --git a/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json b/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json new file mode 100644 index 0000000..6d36179 --- /dev/null +++ b/src/1d929017-a5de-4e0f-9b5a-838934857e26/settings.json @@ -0,0 +1,39 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "1d929017-a5de-4e0f-9b5a-838934857e26", + "implements": [ + "2e6731ba-3a03-4836-b2c2-4e50e38cb890" + ], + "implements_custom": "", + "load_selection": null, + "name": "InstallScript", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Extension.JoomlaThree.InstallScript", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1aefb8f5-486f-4f00-adf9-696340b3254e", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection3": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection4": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Extension.JoomlaThree.InstallScript", + "description": "Loading the Extension Installation Script Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/1d967151-7c20-4ca7-9400-65233cdcd4db/README.md b/src/1d967151-7c20-4ca7-9400-65233cdcd4db/README.md new file mode 100644 index 0000000..8e5d4c1 --- /dev/null +++ b/src/1d967151-7c20-4ca7-9400-65233cdcd4db/README.md @@ -0,0 +1,21 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +> Error adding class diagram + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1d967151-7c20-4ca7-9400-65233cdcd4db/code.php b/src/1d967151-7c20-4ca7-9400-65233cdcd4db/code.php new file mode 100644 index 0000000..a9d9809 --- /dev/null +++ b/src/1d967151-7c20-4ca7-9400-65233cdcd4db/code.php @@ -0,0 +1,26 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Abstraction\BaseRegistry; + + +/** + * Compiler Utilities Files Bucket + * + * @since 3.2.0 + */ +class Files extends BaseRegistry +{ +} + diff --git a/src/1d967151-7c20-4ca7-9400-65233cdcd4db/settings.json b/src/1d967151-7c20-4ca7-9400-65233cdcd4db/settings.json new file mode 100644 index 0000000..5a3d21e --- /dev/null +++ b/src/1d967151-7c20-4ca7-9400-65233cdcd4db/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "b84e947d-2a13-44f7-ac0f-3902ae55ae0c", + "extends_custom": "JoomlaRegistry", + "guid": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Files", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Files", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Files", + "description": "Compiler Utilities Files Bucket\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md new file mode 100644 index 0000000..21ea5f9 --- /dev/null +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/README.md @@ -0,0 +1,106 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structure (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class Structure #Gold { + # Settings $settings + # Paths $paths + # Counter $counter + # File $file + # Files $files + # CMSApplication $app + + __construct(?Settings $settings = null, ?Paths $paths = null, ...) + + build(array $target, string $type, ...) : bool + - getFileDetails(object $details, string $item, ...) : ?array + - getPath(object $details, string $zipPath, ...) : ?string + - getNewName(object $details, string $item, ...) : string +} + +note right of Structure::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Settings $settings = null + ?Paths $paths = null + ?Counter $counter = null + ?File $file = null + ?Files $files = null + ?CMSApplication $app = null +end note + +note right of Structure::build + Build Structural Needed Files & Folders + + since: 3.2.0 + return: bool + + arguments: + array $target + string $type + ?string $fileName = null + ?array $config = null +end note + +note right of Structure::getFileDetails + Get the details + + since: 3.2.0 + return: ?array + + arguments: + object $details + string $item + string $name + ?string $fileName = null + ?array $config = null +end note + +note right of Structure::getPath + Get the path + + since: 3.2.0 + return: ?string + + arguments: + object $details + string $zipPath + string $name +end note + +note right of Structure::getNewName + Get the new name + + since: 3.2.0 + return: string + + arguments: + object $details + string $item + string $name + ?string $fileName = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php new file mode 100644 index 0000000..ccef5d6 --- /dev/null +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php @@ -0,0 +1,313 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use Joomla\CMS\Factory; +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\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Utilities To Build Structure + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * 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. + * + * @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) + { + $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->app = $app ?: Factory::getApplication(); + } + + /** + * Build Structural Needed Files & Folders + * + * @param array $target The main target and name + * @param string $type The type in the target + * @param string|null $fileName The custom file name + * @param array|null $config To add more data to the files info + * + * @return bool true on success + * @since 3.2.0 + */ + public function build(array $target, string $type, + ?string $fileName = null, ?array $config = null): bool + { + // did we build the files (any number) + $build_status = false; + + // check that we have the target values + if (ArrayHelper::check($target)) + { + // search the target + foreach ($target as $main => $name) + { + // make sure it is lower case + $name = StringHelper::safe($name); + + // setup the files + foreach ($this->settings->multiple()->{$main} as $item => $details) + { + if ($details->type === $type) + { + $file_details = $this->getFileDetails( + $details, + (string) $item, + $name, + $fileName, + $config + ); + + if (is_array($file_details)) + { + // store the new files + $this->files->appendArray('dynamic.' . $file_details['view'], + $file_details); + + // we have build at least one + $build_status = true; + } + } + } + } + } + + return $build_status; + } + + /** + * Get the details + * + * @param object $details The item details + * @param string $item The item name + * @param string $name The given name + * @param string|null $fileName The custom file name + * @param array|null $config To add more data to the files info + * + * @return array|null The details + * @since 3.2.0 + */ + private function getFileDetails(object $details, string $item, + string $name, ?string $fileName = null, ?array $config = null): ?array + { + $zip_path = ''; + if (($path = $this->getPath($details, $zip_path, $name)) === null) + { + return null; + } + + // setup the folder + if (!Folder::exists($path)) + { + Folder::create($path); + $this->file->html($zip_path); + + // count the folder created + $this->counter->folder++; + } + + $new_name = $this->getNewName($details, $item, $name, $fileName); + + if (!JoomlaFile::exists($path . '/' . $new_name)) + { + // move the file to its place + JoomlaFile::copy( + $this->paths->template_path . '/' . $item, + $path . '/' . $new_name + ); + + // count the file created + $this->counter->file++; + } + + // we can't have dots in a view name + if (strpos($name, '.') !== false) + { + $name = preg_replace('/[\.]+/', '_', (string) $name); + } + + // setup array for new file + $file = [ + 'path' => $path . '/' . $new_name, + 'name' => $new_name, + 'view' => $name, + 'zip' => $zip_path . '/' . $new_name + ]; + + if (ArrayHelper::check($config)) + { + $file['config'] = $config; + } + + return $file; + } + + /** + * Get the path + * + * @param object $details The item details + * @param string $zipPath The zip path + * @param string $name The name + * + * @return string|null The path + * @since 3.2.0 + */ + private function getPath(object $details, string &$zipPath, string $name): ?string + { + // set destination path + if (strpos((string) $details->path, 'VIEW') !== false) + { + $path = str_replace('VIEW', $name, (string) $details->path); + } + else + { + $path = $details->path; + } + + // make sure we have component to replace + if (strpos((string) $path, 'c0mp0n3nt') !== false) + { + $zipPath = str_replace('c0mp0n3nt/', '', (string) $path); + + return str_replace( + 'c0mp0n3nt/', $this->paths->component_path . '/', (string) $path + ); + } + + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP', + $path + ), 'Error' + ); + + return null; + } + + /** + * Get the new name + * + * @param object $details The item details + * @param string $item The item name + * @param string $name The name + * @param string|null $fileName The custom file name + * + * @return string The new name + * @since 3.2.0 + */ + private function getNewName(object $details, string $item, + string &$name, ?string $fileName = null): string + { + // do the file need renaming + if ($details->rename) + { + if (!empty($fileName)) + { + $name = $name . '_' . $fileName; + + return str_replace( + $details->rename, $fileName, $item + ); + } + elseif ($details->rename === 'new') + { + return $details->newName; + } + + return str_replace( + $details->rename, $name, $item + ); + } + + return $item; + } + +} + diff --git a/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json new file mode 100644 index 0000000..2ed125d --- /dev/null +++ b/src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json @@ -0,0 +1,50 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "JoomlaRegistry", + "guid": "1efdded5-d6c8-452c-8f37-0374483a7b3f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structure", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Structure", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "as": "default" + }, + "use_selection2": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection3": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection4": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection5": { + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "as": "default" + }, + "use_selection6": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection7": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Structure", + "description": "Compiler Utilities To Build Structure\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Filesystem\\File as JoomlaFile;\r\nuse Joomla\\CMS\\Filesystem\\Folder;" +} \ No newline at end of file diff --git a/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/README.md b/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/README.md new file mode 100644 index 0000000..2220c1d --- /dev/null +++ b/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface ExternalInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode** +```uml +@startuml +interface ExternalInterface #Lavender { + + set(string $string, int $debug) : string +} + +note right of ExternalInterface::set + Set the external code string & load it in to string + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/code.php b/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/code.php new file mode 100644 index 0000000..1a889fe --- /dev/null +++ b/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/code.php @@ -0,0 +1,33 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; + + +/** + * Customcode External Interface + * + * @since 3.2.0 + */ +interface ExternalInterface +{ + /** + * Set the external code string & load it in to string + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, int $debug = 0): string; +} + diff --git a/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/settings.json b/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/settings.json new file mode 100644 index 0000000..1798373 --- /dev/null +++ b/src/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "ExternalInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Customcode.ExternalInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Customcode.ExternalInterface", + "description": "Customcode External Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md new file mode 100644 index 0000000..61eb213 --- /dev/null +++ b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface EventInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface EventInterface #Lavender { + + trigger(string $event, mixed $data) : void +} + +note right of EventInterface::trigger + Trigger an event + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php new file mode 100644 index 0000000..0f9b960 --- /dev/null +++ b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/code.php @@ -0,0 +1,33 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler Events Interface + * + * @since 3.2.0 + */ +interface EventInterface +{ + /** + * Trigger an event + * + * @param string $event The event to trigger + * @param mixed $data The values to pass to the event/plugin + * + * @return void + * @since 3.2.0 + */ + public function trigger(string $event, $data); +} + diff --git a/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/settings.json b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/settings.json new file mode 100644 index 0000000..593d098 --- /dev/null +++ b/src/20ed72b0-fcac-4344-aee1-8a65e3bf221d/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "Registry", + "guid": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "EventInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.EventInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.EventInterface", + "description": "Compiler Events Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md new file mode 100644 index 0000000..1676b69 --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Mapper (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Mapper #Gold { + + register(Container $container) : void + + getContent(Container $container) : Content +} + +note right of Mapper::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Mapper::getContent + Get the Compiler Content + + since: 3.2.0 + return: Content +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php new file mode 100644 index 0000000..8860641 --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/code.php @@ -0,0 +1,55 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Content; + + +/** + * Mapper Service Provider + * + * @since 3.2.0 + */ +class Mapper implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Content::class, 'Content') + ->share('Content', [$this, 'getContent'], true); + } + + /** + * Get the Compiler Content + * + * @param Container $container The DI container. + * + * @return Content + * @since 3.2.0 + */ + public function getContent(Container $container): Content + { + return new Content(); + } + +} + diff --git a/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json new file mode 100644 index 0000000..2a1f5a4 --- /dev/null +++ b/src/23f2ca33-440a-4941-8e9a-4bc67522c0cb/settings.json @@ -0,0 +1,23 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "23f2ca33-440a-4941-8e9a-4bc67522c0cb", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Mapper", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Mapper", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Mapper", + "description": "Mapper Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md new file mode 100644 index 0000000..60812e1 --- /dev/null +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class CoreValidation (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree** +```uml +@startuml +class CoreValidation #Gold { + # ?array $rules + # string $path + + __construct() + + get(bool $lowercase = false) : array +} + +note right of CoreValidation::__construct + Constructor + + since: 3.2.0 +end note + +note right of CoreValidation::get + Get the Array of Existing Validation Rule Names + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php new file mode 100644 index 0000000..7583cd6 --- /dev/null +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/code.php @@ -0,0 +1,116 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree; + + +use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; + + +/** + * Core Joomla Field Validation Rules + * + * @since 3.2.0 + */ +class CoreValidation implements CoreValidationInterface +{ + /** + * Local Core Joomla Rules + * + * @var array|null + * @since 3.2.0 + **/ + protected ?array $rules = null; + + /** + * Local Core Joomla Rules Path + * + * @var string + * @since 3.2.0 + **/ + protected string $path; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation rules + $this->path = JPATH_LIBRARIES . '/src/Form/Rule'; + } + + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if (!$this->rules) + { + // 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 + ); + } + + // return rules if found + if (is_array($this->rules)) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( + fn($item): string => strtolower((string) $item), + $this->rules + ); + } + return $this->rules; + } + + // return empty array + return []; + } + +} + diff --git a/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json new file mode 100644 index 0000000..5fd93ad --- /dev/null +++ b/src/24da9672-e47f-4bb1-b6c0-0ebfc17f0957/settings.json @@ -0,0 +1,24 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "24da9672-e47f-4bb1-b6c0-0ebfc17f0957", + "implements": [ + "b9f05dc4-d23a-499a-a826-9749b81818ed" + ], + "implements_custom": "", + "load_selection": null, + "name": "CoreValidation", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.JoomlaThree.CoreValidation", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.JoomlaThree.CoreValidation", + "description": "Core Joomla Field Validation Rules\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Filesystem\\Folder;" +} \ No newline at end of file diff --git a/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/README.md b/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/README.md new file mode 100644 index 0000000..47ef2ac --- /dev/null +++ b/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Library (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Library #Gold { + + register(Container $container) : void + + getData(Container $container) : Data + + getStructure(Container $container) : Structure +} + +note right of Library::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Library::getData + Get the Compiler Library Data + + since: 3.2.0 + return: Data +end note + +note right of Library::getStructure + Get the Compiler Library Structure Builder + + since: 3.2.0 + return: Structure +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/code.php b/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/code.php new file mode 100644 index 0000000..3055b6f --- /dev/null +++ b/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/code.php @@ -0,0 +1,89 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Library\Data; +use VDM\Joomla\Componentbuilder\Compiler\Library\Structure; + + +/** + * Compiler Library + * + * @since 3.2.0 + */ +class Library implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Data::class, 'Library.Data') + ->share('Library.Data', [$this, 'getData'], true); + + $container->alias(Structure::class, 'Library.Structure') + ->share('Library.Structure', [$this, 'getStructure'], true); + } + + /** + * Get the Compiler Library Data + * + * @param Container $container The DI container. + * + * @return Data + * @since 3.2.0 + */ + public function getData(Container $container): Data + { + return new Data( + $container->get('Config'), + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Field.Data'), + $container->get('Model.Filesfolders') + ); + } + + /** + * Get the Compiler Library Structure Builder + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Component'), + $container->get('Content'), + $container->get('Utilities.Counter'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Folder'), + $container->get('Utilities.File') + ); + } + +} + diff --git a/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/settings.json b/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/settings.json new file mode 100644 index 0000000..95cb485 --- /dev/null +++ b/src/253317c7-3c3b-48a0-aec8-8af5e7a86504/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "253317c7-3c3b-48a0-aec8-8af5e7a86504", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Library", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Library", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "7175c1cd-2071-4cd7-b499-23881e168c3f", + "as": "default" + }, + "use_selection1": { + "use": "d3ce5763-4d00-4245-a175-54fc2e80e9b7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Library", + "description": "Compiler Library\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/README.md b/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/README.md new file mode 100644 index 0000000..74aaf58 --- /dev/null +++ b/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Dynamicpath (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class Dynamicpath #Gold { + # Placeholder $placeholder + # array $paths + + __construct(?Placeholder $placeholder = null, ?Constantpaths $paths = null) + + update(string $path) : string +} + +note right of Dynamicpath::__construct + Constructor. + + since: 3.2.0 +end note + +note right of Dynamicpath::update + Update path with dynamic value + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/code.php b/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/code.php new file mode 100644 index 0000000..0a56aaf --- /dev/null +++ b/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Utilities\Constantpaths; + + +/** + * Compiler Utilities Dynamic Path + * + * @since 3.2.0 + */ +class Dynamicpath +{ + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Constant Paths + * + * @var array + * @since 3.2.0 + **/ + protected array $paths; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The Compiler Placeholder object. + * @param Constantpaths|null $paths The Constant Paths object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, ?Constantpaths $paths = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $paths = $paths ?: Compiler::_('Utilities.Constantpaths'); + + // load the constant paths + $this->paths = $paths->get(); + } + + /** + * Update path with dynamic value + * + * @param string $path The path to update + * + * @return string The updated path + * @since 3.2.0 + */ + public function update(string $path): string + { + return $this->placeholder->update_( + $this->placeholder->update( + $path, $this->paths + ) + ); + } + +} + diff --git a/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/settings.json b/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/settings.json new file mode 100644 index 0000000..69aa1b8 --- /dev/null +++ b/src/268b85ef-49f3-4c39-8187-bb12e38d19ee/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "JoomlaRegistry", + "guid": "268b85ef-49f3-4c39-8187-bb12e38d19ee", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Dynamicpath", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Dynamicpath", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection2": { + "use": "e0c8c931-52a0-4171-9909-e8769505bb1f", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Dynamicpath", + "description": "Compiler Utilities Dynamic Path\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/29455d3b-df2b-4e41-8684-1608060e37a4/README.md b/src/29455d3b-df2b-4e41-8684-1608060e37a4/README.md new file mode 100644 index 0000000..59858b9 --- /dev/null +++ b/src/29455d3b-df2b-4e41-8684-1608060e37a4/README.md @@ -0,0 +1,48 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Javascriptcustomview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Javascriptcustomview #Gold { + # array $areas + # array $guiMapper + # Customcode $customcode + # Gui $gui + + __construct(?Customcode $customcode = null, ?Gui $gui = null) + + set(object $item, string $table = 'site_view') : void +} + +note right of Javascriptcustomview::__construct + Constructor + + since: 3.2.0 +end note + +note right of Javascriptcustomview::set + Set Javascript code + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/29455d3b-df2b-4e41-8684-1608060e37a4/code.php b/src/29455d3b-df2b-4e41-8684-1608060e37a4/code.php new file mode 100644 index 0000000..8088481 --- /dev/null +++ b/src/29455d3b-df2b-4e41-8684-1608060e37a4/code.php @@ -0,0 +1,116 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Javascript Custom View Class + * + * @since 3.2.0 + */ +class Javascriptcustomview +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = [ + 'javascript_file', + 'js_document' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => null, + 'id' => null, + 'field' => null, + 'type' => 'js' + ]; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Constructor + * + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * + * @since 3.2.0 + */ + public function __construct(?Customcode $customcode = null, ?Gui $gui = null) + { + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + } + + /** + * Set Javascript code + * + * @param object $item The item data + * @param string $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'site_view') + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + foreach ($this->areas as $area) + { + if (isset($item->{'add_' . $area}) + && $item->{'add_' . $area} == 1 + && StringHelper::check($item->{$area})) + { + // update GUI mapper field + $this->guiMapper['field'] = $area; + $item->{$area} = $this->gui->set( + $this->customcode->update( + base64_decode((string) $item->{$area}) + ), + $this->guiMapper + ); + } + } + } + +} + diff --git a/src/29455d3b-df2b-4e41-8684-1608060e37a4/settings.json b/src/29455d3b-df2b-4e41-8684-1608060e37a4/settings.json new file mode 100644 index 0000000..1b26cea --- /dev/null +++ b/src/29455d3b-df2b-4e41-8684-1608060e37a4/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "29455d3b-df2b-4e41-8684-1608060e37a4", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Javascriptcustomview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Javascriptcustomview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection2": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Javascriptcustomview", + "description": "Model Javascript Custom View Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/295186de-5954-4a65-a4c1-2f79ef305743/README.md b/src/295186de-5954-4a65-a4c1-2f79ef305743/README.md new file mode 100644 index 0000000..0069a53 --- /dev/null +++ b/src/295186de-5954-4a65-a4c1-2f79ef305743/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Joomlamodule (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Joomlamodule #Gold { + + register(Container $container) : void + + getData(Container $container) : Data + + getStructure(Container $container) : Structure +} + +note right of Joomlamodule::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Joomlamodule::getData + Get the Joomla Module Data + + since: 3.2.0 + return: Data +end note + +note right of Joomlamodule::getStructure + Get the Joomla Module Structure Builder + + since: 3.2.0 + return: Structure +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/295186de-5954-4a65-a4c1-2f79ef305743/code.php b/src/295186de-5954-4a65-a4c1-2f79ef305743/code.php new file mode 100644 index 0000000..dc10916 --- /dev/null +++ b/src/295186de-5954-4a65-a4c1-2f79ef305743/code.php @@ -0,0 +1,94 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Data; +use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Structure; + + +/** + * Joomla Module Service Provider + * + * @since 3.2.0 + */ +class Joomlamodule implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Data::class, 'Joomlamodule.Data') + ->share('Joomlamodule.Data', [$this, 'getData'], true); + + $container->alias(Structure::class, 'Joomlamodule.Structure') + ->share('Joomlamodule.Structure', [$this, 'getStructure'], true); + } + + /** + * Get the Joomla Module Data + * + * @param Container $container The DI container. + * + * @return Data + * @since 3.2.0 + */ + public function getData(Container $container): Data + { + return new Data( + $container->get('Config'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Field'), + $container->get('Field.Name'), + $container->get('Model.Filesfolders'), + $container->get('Model.Libraries'), + $container->get('Dynamicget.Data') + ); + } + + /** + * Get the Joomla Module Structure Builder + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Joomlamodule.Data'), + $container->get('Component'), + $container->get('Config'), + $container->get('Registry'), + $container->get('Customcode.Dispenser'), + $container->get('Event'), + $container->get('Utilities.Counter'), + $container->get('Utilities.Folder'), + $container->get('Utilities.File'), + $container->get('Utilities.Files') + ); + } + +} + diff --git a/src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json b/src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json new file mode 100644 index 0000000..ba95b14 --- /dev/null +++ b/src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "295186de-5954-4a65-a4c1-2f79ef305743", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Joomlamodule", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Joomlamodule", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "cb11e8d9-69c2-4095-831c-59908ea402e7", + "as": "default" + }, + "use_selection1": { + "use": "071c7cff-4c88-4b80-bd99-066c572dcb71", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Joomlamodule", + "description": "Joomla Module Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md new file mode 100644 index 0000000..3ec6565 --- /dev/null +++ b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md @@ -0,0 +1,101 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface LoadInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface LoadInterface #Lavender { + + rows(array $select, array $tables, ...) : ?array + + items(array $select, array $tables, ...) : ?array + + row(array $select, array $tables, ...) : ?array + + item(array $select, array $tables, ...) : ?object + + value(array $select, array $tables, ...) : mixed +} + +note right of LoadInterface::rows + Load data rows as an array of associated arrays + + since: 3.2.0 + return: ?array + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null + ?int $limit = null +end note + +note right of LoadInterface::items + Load data rows as an array of objects + + since: 3.2.0 + return: ?array + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null + ?int $limit = null +end note + +note right of LoadInterface::row + Load data row as an associated array + + since: 3.2.0 + return: ?array + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null +end note + +note right of LoadInterface::item + Load data row as an object + + since: 3.2.0 + return: ?object + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null +end note + +note right of LoadInterface::value + Load one value from a row + + since: 3.2.0 + return: mixed + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php new file mode 100644 index 0000000..e8c4418 --- /dev/null +++ b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php @@ -0,0 +1,92 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * Database Load Interface + * + * @since 3.2.0 + */ +interface LoadInterface +{ + /** + * Load data rows as an array of associated arrays + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * @param int|null $limit Limit the number of values returned + * + * @return array|null + * @since 3.2.0 + **/ + public function rows(array $select, array $tables, ?array $where = null, + ?array $order = null, ?int $limit = null): ?array; + + /** + * Load data rows as an array of objects + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * @param int|null $limit Limit the number of values returned + * + * @return array|null + * @since 3.2.0 + **/ + public function items(array $select, array $tables, ?array $where = null, + ?array $order = null, ?int $limit = null): ?array; + + /** + * Load data row as an associated array + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * + * @return array|null + * @since 3.2.0 + **/ + public function row(array $select, array $tables, ?array $where = null, ?array $order = null): ?array; + + /** + * Load data row as an object + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * + * @return object|null + * @since 3.2.0 + **/ + public function item(array $select, array $tables, ?array $where = null, ?array $order = null): ?object; + + /** + * Load one value from a row + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * + * @return mixed + * @since 3.2.0 + **/ + public function value(array $select, array $tables, ?array $where = null, ?array $order = null); + +} + diff --git a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/settings.json b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/settings.json new file mode 100644 index 0000000..bda9160 --- /dev/null +++ b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "2ad31f74-f579-499d-b98b-c4f54fd615dd", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "LoadInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.LoadInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.LoadInterface", + "description": "Database Load Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/README.md b/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/README.md new file mode 100644 index 0000000..dc36c7c --- /dev/null +++ b/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Mysql (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Builder\Update** +```uml +@startuml +class Mysql #Gold { + # key(string $key) : string +} + +note right of Mysql::key + Model the key + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/code.php b/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/code.php new file mode 100644 index 0000000..8f56a75 --- /dev/null +++ b/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/code.php @@ -0,0 +1,40 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Builder\Update; + + +use VDM\Joomla\Componentbuilder\Interfaces\Mappersingleinterface; +use VDM\Joomla\Componentbuilder\Abstraction\MapperSingle; + + +/** + * Compiler Builder Update Mysql + * + * @since 3.2.0 + */ +class Mysql extends MapperSingle implements Mappersingleinterface +{ + /** + * Model the key + * + * @param string $key The key to model + * + * @return string + * @since 3.2.0 + */ + protected function key(string $key): string + { + return preg_replace('/\s+/', '', $key); + } + +} + diff --git a/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/settings.json b/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/settings.json new file mode 100644 index 0000000..6418a3d --- /dev/null +++ b/src/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "extends": "c6bbc3ee-58e7-4463-adba-5c5ae839ee36", + "extends_custom": "JoomlaRegistry", + "guid": "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9", + "implements": [ + "78527c29-24ad-4735-ad4c-ec33a4952d9b" + ], + "implements_custom": "", + "load_selection": null, + "name": "Mysql", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Builder.Update.Mysql", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Builder.Update.Mysql", + "description": "Compiler Builder Update Mysql\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md new file mode 100644 index 0000000..c88e841 --- /dev/null +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Builder (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Builder #Gold { + + register(Container $container) : void + + getMysql(Container $container) : Mysql +} + +note right of Builder::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Builder::getMysql + Get the Compiler Builder Mysql + + since: 3.2.0 + return: Mysql +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php new file mode 100644 index 0000000..c33779c --- /dev/null +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/code.php @@ -0,0 +1,55 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Update\Mysql; + + +/** + * Builder Service Provider + * + * @since 3.2.0 + */ +class Builder implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Mysql::class, 'Builder.Update.Mysql') + ->share('Builder.Update.Mysql', [$this, 'getMysql'], true); + } + + /** + * Get the Compiler Builder Mysql + * + * @param Container $container The DI container. + * + * @return Mysql + * @since 3.2.0 + */ + public function getMysql(Container $container): Mysql + { + return new Mysql(); + } + +} + diff --git a/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json new file mode 100644 index 0000000..50ffc4b --- /dev/null +++ b/src/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7/settings.json @@ -0,0 +1,23 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Builder", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Builder", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Builder", + "description": "Builder Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/2cc8517d-1105-4697-9743-048b4b7c089c/README.md b/src/2cc8517d-1105-4697-9743-048b4b7c089c/README.md new file mode 100644 index 0000000..fb2aea8 --- /dev/null +++ b/src/2cc8517d-1105-4697-9743-048b4b7c089c/README.md @@ -0,0 +1,51 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface GuiInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode** +```uml +@startuml +interface GuiInterface #Lavender { + + set(string $string, array $config) : string + + search(string $file, array $placeholders, ...) : void +} + +note right of GuiInterface::set + Set the JCB GUI code placeholder + + since: 3.2.0 + return: string +end note + +note right of GuiInterface::search + search a file for gui code blocks that were updated in the IDE + + since: 3.2.0 + return: void + + arguments: + string $file + array $placeholders + string $today + string $target +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2cc8517d-1105-4697-9743-048b4b7c089c/code.php b/src/2cc8517d-1105-4697-9743-048b4b7c089c/code.php new file mode 100644 index 0000000..6db8b6b --- /dev/null +++ b/src/2cc8517d-1105-4697-9743-048b4b7c089c/code.php @@ -0,0 +1,46 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; + + +/** + * Customcode Gui Interface + * + * @since 3.2.0 + */ +interface GuiInterface +{ + /** + * Set the JCB GUI code placeholder + * + * @param string $string The code string + * @param array $config The placeholder config values + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, array $config): string; + + /** + * search a file for gui code blocks that were updated in the IDE + * + * @param string $file The file path to search + * @param array $placeholders The values to replace in the code being stored + * @param string $today The date for today + * @param string $target The target path type + * + * @return void + * @since 3.2.0 + */ + public function search(string &$file, array &$placeholders, string &$today, string &$target); +} + diff --git a/src/2cc8517d-1105-4697-9743-048b4b7c089c/settings.json b/src/2cc8517d-1105-4697-9743-048b4b7c089c/settings.json new file mode 100644 index 0000000..dd4909e --- /dev/null +++ b/src/2cc8517d-1105-4697-9743-048b4b7c089c/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "2cc8517d-1105-4697-9743-048b4b7c089c", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "GuiInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Customcode.GuiInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Customcode.GuiInterface", + "description": "Customcode Gui Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/README.md b/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/README.md new file mode 100644 index 0000000..9cc1960 --- /dev/null +++ b/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/README.md @@ -0,0 +1,89 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface Tableinterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface Tableinterface #Lavender { + + get(string $table, ?string $field = null, ...) : mixed + + title(string $table) : ?array + + titleName(string $table) : string + + tables() : array + + exist(string $table, ?string $field = null) : bool + + fields(string $table, bool $default = false) : ?array +} + +note right of Tableinterface::get + Get any value from a item/field/column of an area/view/table +Example: $this->get('table_name', 'field_name', 'value_key'); +Get an item/field/column of an area/view/table +Example: $this->get('table_name', 'field_name'); +Get all items/fields/columns of an area/view/table +Example: $this->get('table_name'); +Get all areas/views/tables with all their item/field/column details +Example: $this->get(); + + since: 3.2.0 + return: mixed + + arguments: + string $table + ?string $field = null + ?string $key = null +end note + +note right of Tableinterface::title + Get title field from an area/view/table + + since: 3.2.0 + return: ?array +end note + +note right of Tableinterface::titleName + Get title field name + + since: 3.2.0 + return: string +end note + +note right of Tableinterface::tables + Get all tables + + since: 3.2.0 + return: array +end note + +note right of Tableinterface::exist + Check if a table (and field) exist + + since: 3.2.0 + return: bool +end note + +note right of Tableinterface::fields + Get all fields of an area/view/table + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/code.php b/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/code.php new file mode 100644 index 0000000..51b5ceb --- /dev/null +++ b/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/code.php @@ -0,0 +1,90 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * The Core JCB Table Interface + */ +interface Tableinterface +{ + /** + * Get any value from a item/field/column of an area/view/table + * Example: $this->get('table_name', 'field_name', 'value_key'); + * Get an item/field/column of an area/view/table + * Example: $this->get('table_name', 'field_name'); + * Get all items/fields/columns of an area/view/table + * Example: $this->get('table_name'); + * Get all areas/views/tables with all their item/field/column details + * Example: $this->get(); + * + * @param string $table The table + * @param string|null $field The field + * @param string|null $key The value key + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $table, ?string $field = null, ?string $key = null); + + /** + * Get title field from an area/view/table + * + * @param string|null $table The area + * + * @return ?array + * @since 3.2.0 + */ + public function title(string $table): ?array; + + /** + * Get title field name + * + * @param string|null $table The area + * + * @return string + * @since 3.2.0 + */ + public function titleName(string $table): string; + + /** + * Get all tables + * + * @return array + * @since 3.2.0 + */ + public function tables(): array; + + /** + * Check if a table (and field) exist + * + * @param string|null $table The area + * @param string|null $field The area + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $table, ?string $field = null): bool; + + /** + * Get all fields of an area/view/table + * + * @param string $table The area + * @param bool $default Add the default fields + * + * @return array|null On success an array of fields + * @since 3.2.0 + */ + public function fields(string $table, bool $default = false): ?array; + +} + diff --git a/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/settings.json b/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/settings.json new file mode 100644 index 0000000..415c3e6 --- /dev/null +++ b/src/2da6d6c4-eb29-4d69-8bc2-36d96e916adf/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "2da6d6c4-eb29-4d69-8bc2-36d96e916adf", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Tableinterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Tableinterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Tableinterface", + "description": "The Core JCB Table Interface" +} \ No newline at end of file diff --git a/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/README.md b/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/README.md new file mode 100644 index 0000000..4da94b6 --- /dev/null +++ b/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Adminview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Adminview #Gold { + + register(Container $container) : void + + getAdminviewData(Container $container) : AdminviewData +} + +note right of Adminview::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Adminview::getAdminviewData + Get the Compiler Adminview Data + + since: 3.2.0 + return: AdminviewData +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.php b/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.php new file mode 100644 index 0000000..ed265b2 --- /dev/null +++ b/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Adminview\Data as AdminviewData; + + +/** + * Compiler Adminview + * + * @since 3.2.0 + */ +class Adminview implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AdminviewData::class, 'Adminview.Data') + ->share('Adminview.Data', [$this, 'getAdminviewData'], true); + } + + /** + * Get the Compiler Adminview Data + * + * @param Container $container The DI container. + * + * @return AdminviewData + * @since 3.2.0 + */ + public function getAdminviewData(Container $container): AdminviewData + { + return new AdminviewData( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Customcode.Dispenser'), + $container->get('Model.Customtabs'), + $container->get('Model.Tabs'), + $container->get('Model.Fields'), + $container->get('Model.Historyadminview'), + $container->get('Model.Permissions'), + $container->get('Model.Conditions'), + $container->get('Model.Relations'), + $container->get('Model.Linkedviews'), + $container->get('Model.Javascriptadminview'), + $container->get('Model.Cssadminview'), + $container->get('Model.Phpadminview'), + $container->get('Model.Custombuttons'), + $container->get('Model.Customimportscripts'), + $container->get('Model.Ajaxadmin'), + $container->get('Model.Customalias'), + $container->get('Model.Sql'), + $container->get('Model.Mysqlsettings') + ); + } + +} + diff --git a/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/settings.json b/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/settings.json new file mode 100644 index 0000000..fdf8bd5 --- /dev/null +++ b/src/2dd1289a-4000-43cc-8c62-77ff32de56bf/settings.json @@ -0,0 +1,23 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "2dd1289a-4000-43cc-8c62-77ff32de56bf", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Adminview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Adminview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "cef2815b-f72b-402a-b769-f028f676692d", + "as": "AdminviewData" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Adminview", + "description": "Compiler Adminview\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/README.md b/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/README.md new file mode 100644 index 0000000..902f571 --- /dev/null +++ b/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface GetScriptInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface GetScriptInterface #Lavender { + + get(object $extension) : string +} + +note right of GetScriptInterface::get + get code to use + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/code.php b/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/code.php new file mode 100644 index 0000000..c4a3530 --- /dev/null +++ b/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/code.php @@ -0,0 +1,32 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * The functions a get script should have + * + * @since 3.2.0 + */ +interface GetScriptInterface +{ + /** + * get code to use + * + * @param Object $code The code object + * + * @return string + * @since 3.2.0 + */ + public function get(object $extension): string; +} + diff --git a/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/settings.json b/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/settings.json new file mode 100644 index 0000000..c22392c --- /dev/null +++ b/src/2e6731ba-3a03-4836-b2c2-4e50e38cb890/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "2e6731ba-3a03-4836-b2c2-4e50e38cb890", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "GetScriptInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.GetScriptInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.GetScriptInterface", + "description": "The functions a get script should have\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/README.md b/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/README.md new file mode 100644 index 0000000..128ea04 --- /dev/null +++ b/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Placeholder (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Placeholder #Gold { + + register(Container $container) : void + + getPlaceholder(Container $container) : CompilerPlaceholder + + getPlaceholderReverse(Container $container) : Reverse +} + +note right of Placeholder::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Placeholder::getPlaceholder + Get the Compiler Placeholder + + since: 3.2.0 + return: CompilerPlaceholder +end note + +note right of Placeholder::getPlaceholderReverse + Get the Compiler Placeholder Reverse + + since: 3.2.0 + return: Reverse +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/code.php b/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/code.php new file mode 100644 index 0000000..c25b86f --- /dev/null +++ b/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder as CompilerPlaceholder; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse; + + +/** + * Compiler Placeholder Service Provider + * + * @since 3.2.0 + */ +class Placeholder implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerPlaceholder::class, 'Placeholder') + ->share('Placeholder', [$this, 'getPlaceholder'], true); + + $container->alias(Reverse::class, 'Placeholder.Reverse') + ->share('Placeholder.Reverse', [$this, 'getPlaceholderReverse'], true); + } + + /** + * Get the Compiler Placeholder + * + * @param Container $container The DI container. + * + * @return CompilerPlaceholder + * @since 3.2.0 + */ + public function getPlaceholder(Container $container): CompilerPlaceholder + { + return new CompilerPlaceholder( + $container->get('Config') + ); + } + + /** + * Get the Compiler Placeholder Reverse + * + * @param Container $container The DI container. + * + * @return Worker + * @since 3.2.0 + */ + public function getPlaceholderReverse(Container $container): Reverse + { + return new Reverse( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Language.Extractor') + ); + } +} + diff --git a/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/settings.json b/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/settings.json new file mode 100644 index 0000000..5fa7606 --- /dev/null +++ b/src/2f7b1998-bb93-4055-ae82-aa659ce8a37f/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "2f7b1998-bb93-4055-ae82-aa659ce8a37f", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Placeholder", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Placeholder", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "CompilerPlaceholder" + }, + "use_selection1": { + "use": "ca111518-e47c-4049-b1b2-cb010f23866f", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Placeholder", + "description": "Compiler Placeholder Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md new file mode 100644 index 0000000..ece6a8f --- /dev/null +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/README.md @@ -0,0 +1,122 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customcode (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Customcode #Gold { + + array $functionNameMemory + + $active + + $memory + # $data + # Config $config + # Placeholder $placeholder + # Extractor $extractor + # External $external + # $db + + __construct(?Config $config = null, ?Placeholder $placeholder = null, ...) + + update(string $string, int $debug) : string + + set(string $string, int $debug, ...) : string + + get(?array $ids = null, bool $setLang = true, ...) : bool + # insert(array $ids, string $string, ...) : string + # buildPlaceholders(array $item, array $code, ...) : void + # check(array $ids) : Mixed +} + +note right of Customcode::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Placeholder $placeholder = null + ?Extractor $extractor = null + ?External $external = null + ?\JDatabaseDriver $db = null +end note + +note right of Customcode::update + Update **ALL** dynamic values in a strings here +We can now at any time debug the +dynamic build values if it gets broken + + since: 3.2.0 + return: string +end note + +note right of Customcode::set + Set the custom code data & can load it in to string + + since: 3.2.0 + return: string + + arguments: + string $string + int $debug + ?int $not = null +end note + +note right of Customcode::get + Load the custom code from the system + + since: 3.2.0 + return: bool + + arguments: + ?array $ids = null + bool $setLang = true + int $debug +end note + +note right of Customcode::insert + Insert the custom code into the string + + since: 3.2.0 + return: string + + arguments: + array $ids + string $string + int $debug +end note + +note right of Customcode::buildPlaceholders + Build custom code placeholders + + since: 3.2.0 + return: void + + arguments: + array $item + array $code + int $debug +end note + +note right of Customcode::check + check if we already have these ids in local memory + + since: 3.2.0 + return: Mixed +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php new file mode 100644 index 0000000..4a11e95 --- /dev/null +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php @@ -0,0 +1,635 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\External; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\CustomcodeInterface; + + +/** + * Compiler Custom Code + * + * @since 3.2.0 + */ +class Customcode implements CustomcodeInterface +{ + /** + * The function name memory ids + * + * @var array + * @since 3.2.0 + **/ + public array $functionNameMemory = []; + + /** + * The active custom code + * + * @var array + * @since 3.2.0 + */ + public $active = []; + + /** + * The custom code memory + * + * @var array + * @since 3.2.0 + */ + public $memory = []; + + /** + * The placeholders for custom code keys + * + * @var array + */ + protected $keys + = array( + '[' => '[', + ']' => ']', + ',' => ',', + '+' => '+', + '=' => '=' + ); + + /** + * The custom code to be added + * + * @var array + * @since 3.2.0 + */ + protected $data = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language Extractor + * + * @var Extractor + * @since 3.2.0 + **/ + protected Extractor $extractor; + + /** + * Compiler Custom Code External + * + * @var External + * @since 3.2.0 + **/ + protected External $external; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected $db; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Extractor|null $extractor The compiler language extractor object. + * @param External|null $external The compiler external custom code object. + * @param \JDatabaseDriver $db The Database Driver object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Placeholder $placeholder = null, + ?Extractor $extractor = null, ?External $external = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); + $this->external = $external ?: Compiler::_('Customcode.External'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Update **ALL** dynamic values in a strings here + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * We can now at any time debug the + * dynamic build values if it gets broken + * + * @return string + * @since 3.2.0 + */ + public function update(string $string, int $debug = 0): string + { + if (StringHelper::check($string)) + { + $string = $this->extractor->engine( + $this->set( + $this->external->set($string, $debug), $debug + ) + ); + } + // if debug + if ($debug) + { + jexit(); + } + + return $string; + } + + /** + * Set the custom code data & can load it in to string + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * @param int|null $not The not switch + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, int $debug = 0, ?int $not = null): string + { + // insure the code is loaded + $loaded = false; + // check if content has custom code place holder + if (strpos($string, '[CUSTO' . 'MCODE=') !== false) + { + // if debug + if ($debug) + { + echo 'Custom Code String:'; + var_dump($string); + } + // the ids found in this content + $bucket = []; + $found = GetHelper::allBetween( + $string, '[CUSTO' . 'MCODE=', ']' + ); + if (ArrayHelper::check($found)) + { + foreach ($found as $key) + { + // if debug + if ($debug) + { + echo '$key before update:'; + var_dump($key); + } + // check if we have args + if (is_numeric($key)) + { + $id = (int) $key; + } + elseif (StringHelper::check($key) + && strpos((string) $key, '+') === false) + { + $getFuncName = trim((string) $key); + if (!isset($this->functionNameMemory[$getFuncName])) + { + if (!$found_local = GetHelper::var( + 'custom_code', $getFuncName, 'function_name', + 'id' + )) + { + continue; + } + $this->functionNameMemory[$getFuncName] + = $found_local; + } + $id = (int) $this->functionNameMemory[$getFuncName]; + } + elseif (StringHelper::check($key) + && strpos( + (string) $key, '+' + ) !== false) + { + $array = explode('+', (string) $key); + // set ID + if (is_numeric($array[0])) + { + $id = (int) $array[0]; + } + elseif (StringHelper::check($array[0])) + { + $getFuncName = trim($array[0]); + if (!isset($this->functionNameMemory[$getFuncName])) + { + if (!$found_local + = GetHelper::var( + 'custom_code', $getFuncName, + 'function_name', 'id' + )) + { + continue; + } + $this->functionNameMemory[$getFuncName] + = $found_local; + } + $id = (int) $this->functionNameMemory[$getFuncName]; + } + else + { + continue; + } + // load args for this ID + if (isset($array[1])) + { + if (!isset($this->data[$id]['args'])) + { + $this->data[$id]['args'] = []; + } + // only load if not already loaded + if (!isset($this->data[$id]['args'][$key])) + { + if (strpos($array[1], ',') !== false) + { + // update the function values with the custom code key placeholders (this allow the use of [] + and , in the values) + $this->data[$id]['args'][$key] + = array_map( + fn($_key) => $this->placeholder->update( + $_key, + $this->keys + ), (array) explode(',', $array[1]) + ); + } + elseif (StringHelper::check( + $array[1] + )) + { + $this->data[$id]['args'][$key] + = []; + // update the function values with the custom code key placeholders (this allow the use of [] + and , in the values) + $this->data[$id]['args'][$key][] + = $this->placeholder->update( + $array[1], + $this->keys + ); + } + } + } + } + else + { + continue; + } + // make sure to remove the not if set + if ($not && is_numeric($not) && $not > 0 && $not == $id) + { + continue; + } + $bucket[$id] = $id; + } + } + // if debug + if ($debug) + { + echo 'Bucket:'; + var_dump($bucket); + } + // check if any custom code placeholders where found + if (ArrayHelper::check($bucket)) + { + $_tmpLang = $this->config->lang_target; + // insure we add the langs to both site and admin + $this->config->lang_target = 'both'; + // now load the code to memory + $loaded = $this->get($bucket, false, $debug); + // revert lang to current setting + $this->config->lang_target = $_tmpLang; + } + // if debug + if ($debug) + { + echo 'Loaded:'; + var_dump($loaded); + } + // when the custom code is loaded + if ($loaded === true) + { + $string = $this->insert($bucket, $string, $debug); + } + // if debug + if ($debug) + { + echo 'Custom Code String After Update:'; + var_dump($string); + } + } + + return $string; + } + + /** + * Load the custom code from the system + * + * @param array|null $ids The custom code ides if known + * @param bool $setLang The set lang switch + * @param int $debug The switch to debug the update + * + * @return bool + * @since 3.2.0 + */ + public function get(?array $ids = null, bool $setLang = true, $debug = 0): bool + { + // should the result be stored in memory + $loadInMemory = false; + // Create a new query object. + $query = $this->db->getQuery(true); + $query->from( + $this->db->quoteName('#__componentbuilder_custom_code', 'a') + ); + if (ArrayHelper::check($ids)) + { + if (($idArray = $this->check($ids)) !== false) + { + $query->select( + $this->db->quoteName( + array('a.id', 'a.code', 'a.comment_type') + ) + ); + $query->where( + $this->db->quoteName('a.id') . ' IN (' . implode( + ',', $idArray + ) . ')' + ); + $query->where( + $this->db->quoteName('a.target') . ' = 2' + ); // <--- to load the correct target + $loadInMemory = true; + } + else + { + // all values are already in memory continue + return true; + } + } + else + { + $query->select( + $this->db->quoteName( + array('a.id', 'a.code', 'a.comment_type', 'a.component', + 'a.from_line', 'a.hashtarget', 'a.hashendtarget', + 'a.path', 'a.to_line', 'a.type') + ) + ); + $query->where( + $this->db->quoteName('a.component') . ' = ' + . (int) $this->config->component_id + ); + $query->where( + $this->db->quoteName('a.target') . ' = 1' + ); // <--- to load the correct target + $query->order( + $this->db->quoteName('a.from_line') . ' ASC' + ); // <--- insure we always add code from top of file + // reset custom code + $this->active = []; + } + $query->where($this->db->quoteName('a.published') . ' >= 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + $bucket = $this->db->loadAssocList('id'); + // open the code + foreach ($bucket as $nr => &$customCode) + { + $customCode['code'] = base64_decode((string) $customCode['code']); + // always insure that the external code is loaded + $customCode['code'] = $this->external->set( + $customCode['code'] + ); + + // set the lang only if needed (we do the other later when we add it to the correct position) + if ($setLang) + { + $customCode['code'] = $this->extractor->engine( + $customCode['code'] + ); + } + // check for more custom code (since this is a custom code placeholder) + else + { + $customCode['code'] = $this->set( + $customCode['code'], $debug, $nr + ); + } + + // build the hash array + if (isset($customCode['hashtarget'])) + { + $customCode['hashtarget'] = explode( + "__", (string) $customCode['hashtarget'] + ); + // is this a replace code, set end has array + if ($customCode['type'] == 1 + && strpos((string) $customCode['hashendtarget'], '__') !== false) + { + $customCode['hashendtarget'] = explode( + "__", (string) $customCode['hashendtarget'] + ); + + // NOW see if this is an end of page target (TODO not sure if the string is always d41d8cd98f00b204e9800998ecf8427e) + // I know this fix is not air-tight, but it should work as the value of an empty line when md5'ed is ^^^^ + // Then if the line number is only >>>one<<< it is almost always end of the page. + // So I am using those two values to detect end of page replace ending, to avoid mismatching the ending target hash. + if ($customCode['hashendtarget'][0] == 1 + && 'd41d8cd98f00b204e9800998ecf8427e' === $customCode['hashendtarget'][1]) + { + // unset since this will force the replacement unto end of page. + unset($customCode['hashendtarget']); + } + } + } + } + + // load this code into memory if needed + if ($loadInMemory === true) + { + $this->memory = $this->memory + $bucket; + } + + // add to active set + $this->active = array_merge($this->active, $bucket); + + return true; + } + + return false; + } + + /** + * Insert the custom code into the string + * + * @param array|null $ids The custom code ides if known + * @param string $string The string to insert custom code into + * @param int $debug The switch to debug the update + * + * @return string on success + * @since 3.2.0 + */ + protected function insert(array $ids, string $string, int $debug = 0): string + { + $code = []; + // load the code + foreach ($ids as $id) + { + $this->buildPlaceholders( + $this->memory[$id], $code, $debug + ); + } + // if debug + if ($debug) + { + echo 'Place holders to Update String:'; + var_dump($code); + echo 'Custom Code String Before Update:'; + var_dump($string); + } + + // now update the string + return $this->placeholder->update($string, $code); + } + + /** + * Build custom code placeholders + * + * @param array $item The memory item + * @param array $code The custom code bucket + * @param int $debug The switch to debug the update + * + * @return void + * @since 3.2.0 + */ + protected function buildPlaceholders(array $item, array &$code, int $debug = 0) + { + // check if there is args for this code + if (isset($this->data[$item['id']]['args']) + && ArrayHelper::check( + $this->data[$item['id']]['args'] + )) + { + // since we have args we cant update this code via IDE (TODO) + $placeholder = $this->placeholder->keys(3, null); + // if debug + if ($debug) + { + echo 'Custom Code Placeholders:'; + var_dump($placeholder); + } + // we have args and so need to load each + foreach ( + $this->data[$item['id']]['args'] as $key => $args + ) + { + $this->placeholder->setType('arg', $args); + // if debug + if ($debug) + { + echo 'Custom Code Global Placeholders:'; + var_dump($this->placeholder->active); + } + $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start'] + . PHP_EOL . $this->placeholder->update_( + $item['code'] + ) . $placeholder['end']; + } + // always clear the args + $this->placeholder->clearType('arg'); + } + else + { + if (($keyPlaceholder = array_search( + $item['id'], $this->functionNameMemory + )) === false) + { + $keyPlaceholder = $item['id']; + } + // check what type of place holders we should load here + $placeholderType = (int) $item['comment_type'] . '2'; + if (stripos((string) $item['code'], Placefix::b() . 'view') !== false + || stripos((string) $item['code'], Placefix::b() . 'sview') !== false + || stripos((string) $item['code'], Placefix::b() . 'arg') !== false) + { + // if view is being set dynamicly then we can't update this code via IDE (TODO) + $placeholderType = 3; + } + // if now ars were found, clear it + $this->placeholder->clearType('arg'); + // load args for this code + $placeholder = $this->placeholder->keys( + $placeholderType, $item['id'] + ); + $code['[CUSTOM' . 'CODE=' . $keyPlaceholder . ']'] + = $placeholder['start'] . PHP_EOL + . $this->placeholder->update_( + $item['code'] + ) . $placeholder['end']; + } + } + + /** + * check if we already have these ids in local memory + * + * @param array $ids The custom code ids + * + * @return Mixed + * @since 3.2.0 + */ + protected function check(array $ids) + { + // reset custom code + $this->active = []; + + foreach ($ids as $pointer => $id) + { + if (isset($this->memory[$id])) + { + $this->active[] = $this->memory[$id]; + unset($ids[$pointer]); + } + } + + // check if any ids left to fetch + if (ArrayHelper::check($ids)) + { + return $ids; + } + + return false; + } + +} + diff --git a/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json new file mode 100644 index 0000000..b29c4de --- /dev/null +++ b/src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json @@ -0,0 +1,56 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "implements": [ + "33bdc535-0ff1-40c8-bb22-b5d44f1731c4" + ], + "implements_custom": "", + "load_selection": null, + "name": "Customcode", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection4": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection5": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection6": { + "use": "d33b9278-c409-4aec-a047-b72f56712391", + "as": "default" + }, + "use_selection7": { + "use": "1cef0266-99e2-40d8-919f-c2ce32226b0a", + "as": "default" + }, + "use_selection8": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode", + "description": "Compiler Custom Code\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md new file mode 100644 index 0000000..98921c5 --- /dev/null +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/README.md @@ -0,0 +1,113 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structure (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power** +```uml +@startuml +class Structure #Gold { + # array $htaccess + # Power $power + # Config $config + # Registry $registry + # EventInterface $event + # Counter $counter + # Paths $paths + # Folder $folder + # File $file + # Files $files + # CMSApplication $app + + __construct(?Power $power = null, ?Config $config = null, ...) + + build() : void + - createFile(string $content, string $fullPath, ...) : void + - setHtaccess(object $power) : void + - setDynamicFolders() : void + - setSuperPowerDetails() : void + - setSuperPowerFiles(object $power, string $bom) : void +} + +note right of Structure::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Power $power = null + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Counter $counter = null + ?Paths $paths = null + ?Folder $folder = null + ?File $file = null + ?Files $files = null + ?CMSApplication $app = null +end note + +note right of Structure::build + Build the Powers files, folders + + since: 3.2.0 + return: void +end note + +note right of Structure::createFile + Create a file with optional custom content and save it to the given path. + + since: 3.2.0 + return: void + + arguments: + string $content + string $fullPath + string $fileName + string $key +end note + +note right of Structure::setHtaccess + Set the .htaccess for this power path + + since: 3.2.0 + return: void +end note + +note right of Structure::setDynamicFolders + Add the dynamic folders + + since: 3.2.0 + return: void +end note + +note right of Structure::setSuperPowerDetails + Set the super powers details structure + + since: 3.2.0 + return: void +end note + +note right of Structure::setSuperPowerFiles + Set the super power file paths + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php new file mode 100644 index 0000000..f2b85ae --- /dev/null +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php @@ -0,0 +1,425 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Power; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; + + +/** + * Power Structure Builder Class + * + * @since 3.2.0 + */ +class Structure +{ + /** + * we track the creation of htaccess files + * + * @var array + * @since 3.2.0 + **/ + protected array $htaccess = []; + + /** + * Power Objects + * + * @var Power + * @since 3.2.0 + **/ + protected Power $power; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Utilities Folder + * + * @var Folder + * @since 3.2.0 + */ + protected Folder $folder; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor + * + * @param Power|null $power The power object. + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Counter|null $counter The compiler counter object. + * @param Paths|null $paths The compiler paths object. + * @param Folder|null $folder The compiler folder 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. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Power $power = null, ?Config $config = null, + ?Registry $registry = null, ?EventInterface $event = null, + ?Counter $counter = null, ?Paths $paths = null, ?Folder $folder = null, + ?File $file = null, ?Files $files = null, ?CMSApplication $app = null) + { + $this->power = $power ?: Compiler::_('Power'); + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->folder = $folder ?: Compiler::_('Utilities.Folder'); + $this->file = $file ?: Compiler::_('Utilities.File'); + $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Build the Powers files, folders + * + * @return void + * @since 3.2.0 + */ + public function build() + { + if (ArrayHelper::check($this->power->active)) + { + // for plugin event TODO change event api signatures + $powers = $this->power->active; + $component_context = $this->config->component_context; + // Trigger Event: jcb_ce_onBeforeSetModules + $this->event->trigger( + 'jcb_ce_onBeforeBuildPowers', + array(&$component_context, &$powers) + ); + // for plugin event TODO change event api signatures + $this->power->active = $powers; + + // set super power details + $this->setSuperPowerDetails(); + + foreach ($this->power->active as $power) + { + if (ObjectHelper::check($power) + && isset($power->path) + && StringHelper::check( + $power->path + )) + { + // activate dynamic folders + $this->setDynamicFolders(); + + // power path + $power->full_path = $this->paths->component_path . '/' + . $power->path; + $power->full_path_jcb = $this->paths->component_path . '/' + . $power->path_jcb; + $power->full_path_parent = $this->paths->component_path . '/' + . $power->path_parent; + + // set the power paths + $this->registry->set('dynamic_paths.' . $power->key, $power->full_path_parent); + + // create the power folder if it does not exist + // we do it like this to add html files to each part + $this->folder->create($power->full_path_jcb); + $this->folder->create($power->full_path_parent); + $this->folder->create($power->full_path); + + $bom = 'add_licensing_template == 2) + { + $bom = 'licensing_template; + } + + // set the main power php file + $this->createFile($bom . PHP_EOL . Placefix::_h('POWERCODE') . PHP_EOL, + $power->full_path, $power->file_name . '.php', $power->key); + + // set super power files + $this->setSuperPowerFiles($power, $bom); + + // set htaccess once per path + $this->setHtaccess($power); + } + } + } + } + + /** + * Create a file with optional custom content and save it to the given path. + * + * @param string $content The content. + * @param string $fullPath The full path to the destination folder. + * @param string $fileName The file name without the extension. + * @param string $key The key to append the file details. + * + * @return void + * @since 3.2.0 + */ + private function createFile(string $content, string $fullPath, string $fileName, string $key) + { + $file_details = [ + 'path' => $fullPath . '/' . $fileName, + 'name' => $fileName, + 'zip' => $fileName + ]; + + // Write the content to the file + $this->file->write($file_details['path'], $content); + + // Append the file details to the files array + $this->files->appendArray($key, $file_details); + + // Increment the file counter + $this->counter->file++; + } + + /** + * Set the .htaccess for this power path + * + * @param object $power The power object + * + * @return void + * @since 3.2.0 + */ + private function setHtaccess(object &$power) + { + if (!isset($this->htaccess[$power->path_jcb])) + { + // set the htaccess data + $data = '# Apache 2.4+' . PHP_EOL . + '' . PHP_EOL . + ' Require all denied' . PHP_EOL . + '' . PHP_EOL . PHP_EOL . + '# Apache 2.0-2.2' . PHP_EOL . + '' . PHP_EOL . + ' Deny from all' . PHP_EOL . + '' . PHP_EOL; + + // now we must add the .htaccess file + $fileDetails = array('path' => $power->full_path_jcb . '/.htaccess', + 'name' => '.htaccess', + 'zip' => '.htaccess'); + $this->file->write( + $fileDetails['path'], $data + ); + $this->files->appendArray($power->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // now we must add the htaccess.txt file where the zip package my not get the [.] files + $fileDetails = array('path' => $power->full_path_jcb . '/htaccess.txt', + 'name' => 'htaccess.txt', + 'zip' => 'htaccess.txt'); + $this->file->write( + $fileDetails['path'], $data + ); + $this->files->appendArray($power->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // now we must add the web.config file + $fileDetails = array('path' => $power->full_path_jcb . '/web.config', + 'name' => 'web.config', + 'zip' => 'web.config'); + $this->file->write( + $fileDetails['path'], + '' . PHP_EOL . + ' ' . PHP_EOL . + ' ' . PHP_EOL . + ' ' . PHP_EOL . + ' ' . PHP_EOL . + ' ' . PHP_EOL . + '' . PHP_EOL + ); + $this->files->appendArray($power->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // we set these files only once + $this->htaccess[$power->path_jcb] = true; + } + } + + /** + * Add the dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function setDynamicFolders() + { + // check if we should add the dynamic folder moving script to the installer script + if (!$this->registry->get('set_move_folders_install_script')) + { + // add the setDynamicF0ld3rs() method to the install scipt.php file + $this->registry->set('set_move_folders_install_script', true); + + // set message that this was done (will still add a tutorial link later) + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE'), + 'Notice' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED'), + 'Notice' + ); + } + } + + /** + * Set the super powers details structure + * + * @return void + * @since 3.2.0 + */ + private function setSuperPowerDetails() + { + if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) + { + foreach ($this->power->superpowers as $path => $powers) + { + // create the path if it does not exist + $this->folder->create($path, false); + + $key = StringHelper::safe($path); + + // set the super powers readme file + $this->createFile(Placefix::_h('POWERREADME'), + $path, 'README.md', $key); + + // set the super power index file + $this->createFile(Placefix::_h('POWERINDEX'), $path, + 'super-powers.json', $key); + } + } + } + + /** + * Set the super power file paths + * + * @param object $power The power object + * @param string $bom The bom for the top of the PHP files + * + * @return void + * @since 3.2.0 + */ + private function setSuperPowerFiles(object &$power, string $bom) + { + if ($this->config->add_super_powers && is_array($power->super_power_paths) && $power->super_power_paths !== []) + { + foreach ($power->super_power_paths as $path) + { + // create the path if it does not exist + $this->folder->create($path, false); + + // set the super power php file + $this->createFile($bom . PHP_EOL . Placefix::_h('POWERCODE') . PHP_EOL, + $path, 'code.php', $power->key); + + // set the super power json file + $this->createFile(Placefix::_h('POWERLINKER'), $path, + 'settings.json', $power->key); + + // set the super power readme file + $this->createFile(Placefix::_h('POWERREADME'), $path, + 'README.md', $power->key); + } + } + } + +} + diff --git a/src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json new file mode 100644 index 0000000..636127f --- /dev/null +++ b/src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json @@ -0,0 +1,74 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "324566de-0f7d-4b6e-9caf-8424d55013ae", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structure", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Structure", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "as": "default" + }, + "use_selection2": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection3": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection4": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection5": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection6": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection7": { + "use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "as": "default" + }, + "use_selection8": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection9": { + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "as": "default" + }, + "use_selection10": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection11": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection12": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection13": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Structure", + "description": "Power Structure Builder Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;" +} \ No newline at end of file diff --git a/src/3283a89c-329a-47fb-a011-0df6c31a5c73/README.md b/src/3283a89c-329a-47fb-a011-0df6c31a5c73/README.md new file mode 100644 index 0000000..6faf8ad --- /dev/null +++ b/src/3283a89c-329a-47fb-a011-0df6c31a5c73/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Csscustomview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Csscustomview #Gold { + # array $areas + # Customcode $customcode + + __construct(?Customcode $customcode = null) + + set(object $item) : void +} + +note right of Csscustomview::__construct + Constructor + + since: 3.2.0 +end note + +note right of Csscustomview::set + Set Css code + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3283a89c-329a-47fb-a011-0df6c31a5c73/code.php b/src/3283a89c-329a-47fb-a011-0df6c31a5c73/code.php new file mode 100644 index 0000000..6dcdc3d --- /dev/null +++ b/src/3283a89c-329a-47fb-a011-0df6c31a5c73/code.php @@ -0,0 +1,79 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Css Custom View Class + * + * @since 3.2.0 + */ +class Csscustomview +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = ['css_document', 'css']; + + /** + * Compiler Customcode Class + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Constructor + * + * @param Customcode|null $customcode The compiler customcode object. + * + * @since 3.2.0 + */ + public function __construct(?Customcode $customcode = null) + { + $this->customcode = $customcode ?: Compiler::_('Customcode'); + } + + /** + * Set Css code + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + foreach ($this->areas as $area) + { + if (isset($item->{'add_' . $area}) + && $item->{'add_' . $area} == 1 + && StringHelper::check($item->{$area})) + { + $item->{$area} = $this->customcode->update( + base64_decode((string) $item->{$area}) + ); + } + } + } + +} + diff --git a/src/3283a89c-329a-47fb-a011-0df6c31a5c73/settings.json b/src/3283a89c-329a-47fb-a011-0df6c31a5c73/settings.json new file mode 100644 index 0000000..8089959 --- /dev/null +++ b/src/3283a89c-329a-47fb-a011-0df6c31a5c73/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "3283a89c-329a-47fb-a011-0df6c31a5c73", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Csscustomview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Csscustomview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Csscustomview", + "description": "Model Css Custom View Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/README.md b/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/README.md new file mode 100644 index 0000000..2c9beb5 --- /dev/null +++ b/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/README.md @@ -0,0 +1,65 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CustomcodeInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface CustomcodeInterface #Lavender { + + update(string $string, int $debug) : string + + set(string $string, int $debug, ...) : string + + get(?array $ids = null, bool $setLang = true, ...) : bool +} + +note right of CustomcodeInterface::update + Update **ALL** dynamic values in a strings here +We can now at any time debug the +dynamic build values if it gets broken + + since: 3.2.0 + return: string +end note + +note right of CustomcodeInterface::set + Set the custom code data & can load it in to string + + since: 3.2.0 + return: string + + arguments: + string $string + int $debug + ?int $not = null +end note + +note right of CustomcodeInterface::get + Load the custom code from the system + + since: 3.2.0 + return: bool + + arguments: + ?array $ids = null + bool $setLang = true + int $debug +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/code.php b/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/code.php new file mode 100644 index 0000000..77f03a7 --- /dev/null +++ b/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/code.php @@ -0,0 +1,59 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler Customcode Interface + * + * @since 3.2.0 + */ +interface CustomcodeInterface +{ + /** + * Update **ALL** dynamic values in a strings here + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * We can now at any time debug the + * dynamic build values if it gets broken + * + * @return string + * @since 3.2.0 + */ + public function update(string $string, int $debug = 0): string; + + /** + * Set the custom code data & can load it in to string + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * @param int|null $not The not switch + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, int $debug = 0, ?int $not = null): string; + + /** + * Load the custom code from the system + * + * @param array|null $ids The custom code ides if known + * @param bool $setLang The set lang switch + * @param int $debug The switch to debug the update + * + * @return bool + * @since 3.2.0 + */ + public function get(?array $ids = null, bool $setLang = true, $debug = 0): bool; +} + diff --git a/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/settings.json b/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/settings.json new file mode 100644 index 0000000..280abe3 --- /dev/null +++ b/src/33bdc535-0ff1-40c8-bb22-b5d44f1731c4/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "Registry", + "guid": "33bdc535-0ff1-40c8-bb22-b5d44f1731c4", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "CustomcodeInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.CustomcodeInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.CustomcodeInterface", + "description": "Compiler Customcode Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/README.md b/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/README.md new file mode 100644 index 0000000..2ea6ccf --- /dev/null +++ b/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Mysqlsettings (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Mysqlsettings #Gold { + # Config $config + # Registry $registry + + __construct(?Config $config = null, ?Registry $registry = null) + + set(object $item) : void +} + +note right of Mysqlsettings::__construct + Constructor + + since: 3.2.0 +end note + +note right of Mysqlsettings::set + Set MySQL table settings + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/code.php b/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/code.php new file mode 100644 index 0000000..a094986 --- /dev/null +++ b/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/code.php @@ -0,0 +1,95 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model MySQL Settings Class + * + * @since 3.2.0 + */ +class Mysqlsettings +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Config|null $config The compiler config. + * @param Registry|null $registry The compiler registry. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Set MySQL table settings + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + foreach ( + $this->config->mysql_table_keys as $mysql_table_key => $mysql_table_val + ) + { + if (isset($item->{'mysql_table_' . $mysql_table_key}) + && StringHelper::check( + $item->{'mysql_table_' . $mysql_table_key} + ) + && !is_numeric($item->{'mysql_table_' . $mysql_table_key})) + { + $this->registry->set('builder.mysql_table_setting.' . $item->name_single_code . '.' . + $mysql_table_key, $item->{'mysql_table_' . $mysql_table_key} + ); + } + else + { + $this->registry->set('builder.mysql_table_setting.' . $item->name_single_code . '.' . + $mysql_table_key, $mysql_table_val['default'] + ); + } + + // remove the table values since we moved to another object + unset($item->{'mysql_table_' . $mysql_table_key}); + } + } + +} + diff --git a/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/settings.json b/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/settings.json new file mode 100644 index 0000000..eb350f6 --- /dev/null +++ b/src/35191b0c-f7f3-44d6-8ec1-c816b997bd4e/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "35191b0c-f7f3-44d6-8ec1-c816b997bd4e", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Mysqlsettings", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Mysqlsettings", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Mysqlsettings", + "description": "Model MySQL Settings Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/README.md b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/README.md new file mode 100644 index 0000000..8770b78 --- /dev/null +++ b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/README.md @@ -0,0 +1,59 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Templatelayout** +```uml +@startuml +class Data #Gold { + # Config $config + # Registry $registry + # Aliasdata $alias + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(string $content, string $view, ...) : bool +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Aliasdata $alias = null +end note + +note right of Data::set + Set Template and Layout Data + + since: 3.2.0 + return: bool + + arguments: + string $content + string $view + bool $found = false + array $templates = [] + array $layouts = [] +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php new file mode 100644 index 0000000..0cd5ab5 --- /dev/null +++ b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/code.php @@ -0,0 +1,236 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Templatelayout; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Alias\Data as Aliasdata; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; + + +/** + * Template Layout Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Alias Data + * + * @var AliasData + * @since 3.2.0 + */ + protected Aliasdata $alias; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Aliasdata|null $alias The compiler alias data object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Aliasdata $alias = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->alias = $alias ?: Compiler::_('Alias.Data'); + } + + /** + * Set Template and Layout Data + * + * @param string $content The content to check + * @param string $view The view code name + * @param bool $found The proof that something was found + * @param array $templates The option to pass templates keys (to avoid search) + * @param array $layouts The option to pass layout keys (to avoid search) + * + * @return bool if something was found true + * @since 3.2.0 + */ + public function set(string $content, string $view, bool $found = false, + array $templates = [], array $layouts = []): bool + { + // to check inside the templates + $again = []; + + // check if template keys were passed + if (!ArrayHelper::check($templates)) + { + // set the Template data + $temp1 = GetHelper::allBetween( + $content, "\$this->loadTemplate('", "')" + ); + $temp2 = GetHelper::allBetween( + $content, '$this->loadTemplate("', '")' + ); + if (ArrayHelper::check($temp1) + && ArrayHelper::check($temp2)) + { + $templates = array_merge($temp1, $temp2); + } + else + { + if (ArrayHelper::check($temp1)) + { + $templates = $temp1; + } + elseif (ArrayHelper::check($temp2)) + { + $templates = $temp2; + } + } + } + + // check if we found templates + if (ArrayHelper::check($templates, true)) + { + foreach ($templates as $template) + { + if (!$this->registry-> + get('builder.template_data.' . $this->config->build_target . '.' . $view . '.' . $template, null)) + { + $data = $this->alias->get( + $template, 'template', $view + ); + if (ArrayHelper::check($data)) + { + // load it to the template data array + $this->registry-> + set('builder.template_data.' . $this->config->build_target . '.' . $view . '.' . $template, $data); + // call self to get child data + $again[] = ['content' => $data['html'], 'view' => $view]; + $again[] = ['content' => $data['php_view'], 'view' => $view]; + } + } + + // check if we have the template set (and nothing yet found) + if (!$found && $this->registry-> + get('builder.template_data.' . $this->config->build_target . '.' . $view . '.' . $template, null)) + { + // something was found + $found = true; + } + } + } + + // check if layout keys were passed + if (!ArrayHelper::check($layouts)) + { + // set the Layout data + $lay1 = GetHelper::allBetween( + $content, "JLayoutHelper::render('", "'," + ); + $lay2 = GetHelper::allBetween( + $content, 'JLayoutHelper::render("', '",' + ); + if (ArrayHelper::check($lay1) + && ArrayHelper::check($lay2)) + { + $layouts = array_merge($lay1, $lay2); + } + else + { + if (ArrayHelper::check($lay1)) + { + $layouts = $lay1; + } + elseif (ArrayHelper::check($lay2)) + { + $layouts = $lay2; + } + } + } + + // check if we found layouts + if (ArrayHelper::check($layouts, true)) + { + // get the other target if both + $_target = null; + if ($this->config->lang_target === 'both') + { + $_target = ($this->config->build_target === 'admin') ? 'site' : 'admin'; + } + + foreach ($layouts as $layout) + { + if (!$this->registry-> + get('builder.layout_data.' . $this->config->build_target . '.' . $layout, null)) + { + $data = $this->alias->get($layout, 'layout', $view); + if (ArrayHelper::check($data)) + { + // load it to the layout data array + $this->registry-> + set('builder.layout_data.' . $this->config->build_target . '.' . $layout, $data); + // check if other target is set + if ($this->config->lang_target === 'both' && $_target) + { + $this->registry-> + set('builder.layout_data.' . $_target . '.' . $layout, $data); + } + // call self to get child data + $again[] = ['content' => $data['html'], 'view' => $view]; + $again[] = ['content' => $data['php_view'], 'view' => $view]; + } + } + + // check if we have the layout set (and nothing yet found) + if (!$found && $this->registry-> + get('builder.layout_data.' . $this->config->build_target . '.' . $layout, null)) + { + // something was found + $found = true; + } + } + } + + // check again + if (ArrayHelper::check($again)) + { + foreach ($again as $go) + { + $found = $this->set( + $go['content'], $go['view'], $found + ); + } + } + + // return the proof that something was found + return $found; + } + +} + diff --git a/src/39ea8150-f124-4e47-909d-641bf1c96d5e/settings.json b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/settings.json new file mode 100644 index 0000000..cbe17e2 --- /dev/null +++ b/src/39ea8150-f124-4e47-909d-641bf1c96d5e/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "39ea8150-f124-4e47-909d-641bf1c96d5e", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Templatelayout.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c", + "as": "Aliasdata" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Templatelayout.Data", + "description": "Template Layout Data Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md new file mode 100644 index 0000000..83f6981 --- /dev/null +++ b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/README.md @@ -0,0 +1,75 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customview** +```uml +@startuml +class Data #Gold { + # array $data + # Config $config + # EventInterface $event + # Customcode $customcode + # Gui $gui + # Libraries $libraries + # Templatelayout $templateLayout + # Dynamicget $dynamic + # Loader $loader + # Javascriptcustomview $javascript + # Csscustomview $css + # Phpcustomview $php + # Custombuttons $custombuttons + # Ajaxcustomview $ajax + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?EventInterface $event = null, ...) + + get(int $id, string $table = 'site_view') : ?object +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?EventInterface $event = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Libraries $libraries = null + ?Templatelayout $templateLayout = null + ?Dynamicget $dynamic = null + ?Loader $loader = null + ?Javascriptcustomview $javascript = null + ?Csscustomview $css = null + ?Phpcustomview $php = null + ?Ajaxcustomview $ajax = null + ?Custombuttons $custombuttons = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get all Custom View Data + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php new file mode 100644 index 0000000..7095816 --- /dev/null +++ b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/code.php @@ -0,0 +1,341 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customview; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries; +use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as Templatelayout; +use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Data as Dynamicget; +use VDM\Joomla\Componentbuilder\Compiler\Model\Loader; +use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptcustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Csscustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Phpcustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxcustomview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Custombuttons; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Unique; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Admin Custom View Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Admin views + * + * @var array + * @since 3.2.0 + */ + protected array $data; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Libraries Model + * + * @var Libraries + * @since 3.2.0 + */ + protected Libraries $libraries; + + /** + * Compiler Template Layout + * + * @var Templatelayout + * @since 3.2.0 + */ + protected Templatelayout $templateLayout; + + /** + * Compiler Dynamic Get Data + * + * @var Dynamicget + * @since 3.2.0 + */ + protected Dynamicget $dynamic; + + /** + * Compiler Auto Loader + * + * @var Loader + * @since 3.2.0 + */ + protected Loader $loader; + + /** + * The modelling javascript + * + * @var Javascriptcustomview + * @since 3.2.0 + */ + protected Javascriptcustomview $javascript; + + /** + * The modelling css + * + * @var Csscustomview + * @since 3.2.0 + */ + protected Csscustomview $css; + + /** + * The modelling php admin view + * + * @var Phpcustomview + * @since 3.2.0 + */ + protected Phpcustomview $php; + + /** + * The modelling custom buttons + * + * @var Custombuttons + * @since 3.2.0 + */ + protected Custombuttons $custombuttons; + + /** + * The modelling ajax + * + * @var Ajaxcustomview + * @since 3.2.0 + */ + protected Ajaxcustomview $ajax; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param EventInterface|null $event The compiler event api object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Libraries|null $libraries The compiler libraries model object. + * @param Templatelayout|null $templateLayout The compiler template layout object. + * @param Dynamicget|null $dynamic The compiler dynamic get data object. + * @param Loader|null $loader The compiler loader object. + * @param Javascriptcustomview|null $javascript The modelling javascript object. + * @param Csscustomview|null $css The modelling css object. + * @param Phpcustomview|null $php The modelling php admin view object. + * @param Ajaxcustomview|null $ajax The modelling ajax object. + * @param Custombuttons|null $custombuttons The modelling custombuttons object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?EventInterface $event = null, + ?Customcode $customcode = null, ?Gui $gui = null, ?Libraries $libraries = null, + ?Templatelayout $templateLayout = null, ?Dynamicget $dynamic = null, ?Loader $loader = null, + ?Javascriptcustomview $javascript = null, ?Csscustomview $css = null, ?Phpcustomview $php = null, + ?Ajaxcustomview $ajax = null, ?Custombuttons $custombuttons = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->event = $event ?: Compiler::_('Event'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->libraries = $libraries ?: Compiler::_('Model.Libraries'); + $this->templateLayout = $templateLayout ?: Compiler::_('Templatelayout.Data'); + $this->dynamic = $dynamic ?: Compiler::_('Dynamicget.Data'); + $this->loader = $loader ?: Compiler::_('Model.Loader'); + $this->javascript = $javascript ?: Compiler::_('Model.Javascriptcustomview'); + $this->css = $css ?: Compiler::_('Model.Csscustomview'); + $this->php = $php ?: Compiler::_('Model.Phpcustomview'); + $this->ajax = $ajax ?: Compiler::_('Model.Ajaxcustomview'); + $this->custombuttons = $custombuttons ?: Compiler::_('Model.Custombuttons'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get all Custom View Data + * + * @param int $id The view ID + * @param string $table The view table + * + * @return object|null The view data + * @since 3.2.0 + */ + public function get(int $id, string $table = 'site_view'): ?object + { + if (!isset($this->data[$id . $table])) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->from('#__componentbuilder_' . $table . ' AS a'); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + + // Trigger Event: jcb_ce_onBeforeQueryCustomViewData + $this->event->trigger( + 'jcb_ce_onBeforeQueryCustomViewData', + array(&$component_context, &$id, &$table, &$query, &$this->db) + ); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + + // Load the results as a list of stdClass objects (see later for more options on retrieving data). + $item = $this->db->loadObject(); + + // fix alias to use in code + $item->code = Unique::code( + StringHelper::safe($item->codename), $this->config->build_target + ); + $item->Code = StringHelper::safe($item->code, 'F'); + $item->CODE = StringHelper::safe($item->code, 'U'); + + // Trigger Event: jcb_ce_onBeforeModelCustomViewData + $this->event->trigger( + 'jcb_ce_onBeforeModelCustomViewData', + array(&$component_context, &$item, &$id, &$table) + ); + + // set GUI mapper + $guiMapper = [ + 'table' => $table, + 'id' => (int) $id, + 'field' => 'default', + 'type' => 'html' + ]; + + // set the default data + $item->default = $this->gui->set( + $this->customcode->update(base64_decode((string) $item->default)), + $guiMapper + ); + + // load context if not set + if (!isset($item->context) + || !StringHelper::check( + $item->context + )) + { + $item->context = $item->code; + } + else + { + // always make sure context is a safe string + $item->context = StringHelper::safe($item->context); + } + + // set the libraries + $this->libraries->set($item->code, $item); + + // setup template and layout data + $this->templateLayout->set($item->default, $item->code); + + // set uikit version 2 + $this->loader->uikit($item->code, $item->default); + + // auto loaders + $this->loader->set($item->code, $item->default); + + // set the main get data + $main_get = $this->dynamic->get( + array($item->main_get), $item->code, $item->context + ); + $item->main_get = ArrayHelper::check($main_get) ? $main_get[0] : null; + + // set the custom_get data + $item->custom_get = (isset($item->custom_get) + && JsonHelper::check($item->custom_get)) + ? json_decode((string) $item->custom_get, true) : null; + + if (ArrayHelper::check($item->custom_get)) + { + $item->custom_get = $this->dynamic->get( + $item->custom_get, $item->code, $item->context + ); + } + + // set php scripts + $this->php->set($item, $table); + + // set javascript scripts + $this->javascript->set($item, $table); + + // set css scripts + $this->css->set($item); + + // set Ajax for this view + $this->ajax->set($item, $table); + + // set the custom buttons + $this->custombuttons->set($item, $table); + + // Trigger Event: jcb_ce_onAfterModelCustomViewData + $this->event->trigger( + 'jcb_ce_onAfterModelCustomViewData', + array(&$component_context, &$item) + ); + + // set the found data + $this->data[$id . $table] = $item; + } + + // return the found data + return $this->data[$id . $table]; + } + +} + diff --git a/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/settings.json b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/settings.json new file mode 100644 index 0000000..b9a5d36 --- /dev/null +++ b/src/3b6895da-d9eb-4164-90b1-4632a4cc2474/settings.json @@ -0,0 +1,90 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "3b6895da-d9eb-4164-90b1-4632a4cc2474", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customview.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection3": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection4": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection5": { + "use": "59895f37-50c8-4af3-9dad-230e18841953", + "as": "default" + }, + "use_selection6": { + "use": "39ea8150-f124-4e47-909d-641bf1c96d5e", + "as": "Templatelayout" + }, + "use_selection7": { + "use": "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46", + "as": "Dynamicget" + }, + "use_selection8": { + "use": "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7", + "as": "default" + }, + "use_selection9": { + "use": "29455d3b-df2b-4e41-8684-1608060e37a4", + "as": "default" + }, + "use_selection10": { + "use": "3283a89c-329a-47fb-a011-0df6c31a5c73", + "as": "default" + }, + "use_selection11": { + "use": "489da602-27c7-418c-bf59-1d45ad42bdcc", + "as": "default" + }, + "use_selection12": { + "use": "592aed4e-2c5f-4fc5-8f7a-409203d1af82", + "as": "default" + }, + "use_selection13": { + "use": "ebe3287d-bfa0-4519-b663-f442f4dea432", + "as": "default" + }, + "use_selection14": { + "use": "f02fb1df-f4b6-4be1-9595-2e72084a5e6e", + "as": "default" + }, + "use_selection15": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection16": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection17": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customview.Data", + "description": "Admin Custom View Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/README.md b/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/README.md new file mode 100644 index 0000000..26d91a5 --- /dev/null +++ b/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface HistoryInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface HistoryInterface #Lavender { + + get(string $type, int $id) : ?object +} + +note right of HistoryInterface::get + Get Item History object + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/code.php b/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/code.php new file mode 100644 index 0000000..7bd07c7 --- /dev/null +++ b/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/code.php @@ -0,0 +1,34 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler History Interface + * + * @since 3.2.0 + */ +interface HistoryInterface +{ + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history item object + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object; + +} + diff --git a/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/settings.json b/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/settings.json new file mode 100644 index 0000000..722f2ee --- /dev/null +++ b/src/4325745f-da1f-4d4d-a591-3189fe8c06e5/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "4325745f-da1f-4d4d-a591-3189fe8c06e5", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "HistoryInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.HistoryInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.HistoryInterface", + "description": "Compiler History Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/4815e1c7-a433-443d-a112-d1e03d7df84b/README.md b/src/4815e1c7-a433-443d-a112-d1e03d7df84b/README.md new file mode 100644 index 0000000..7e913da --- /dev/null +++ b/src/4815e1c7-a433-443d-a112-d1e03d7df84b/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Database (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Database #Gold { + + register(Container $container) : void + + getLoad(Container $container) : Load + + getInsert(Container $container) : Insert +} + +note right of Database::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Database::getLoad + Get the Core Load Database + + since: 3.2.0 + return: Load +end note + +note right of Database::getInsert + Get the Core Insert Database + + since: 3.2.0 + return: Insert +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4815e1c7-a433-443d-a112-d1e03d7df84b/code.php b/src/4815e1c7-a433-443d-a112-d1e03d7df84b/code.php new file mode 100644 index 0000000..2e216c5 --- /dev/null +++ b/src/4815e1c7-a433-443d-a112-d1e03d7df84b/code.php @@ -0,0 +1,72 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Database\Load; +use VDM\Joomla\Componentbuilder\Database\Insert; + + +/** + * Database Service Provider + * + * @since 3.2.0 + */ +class Database implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Load::class, 'Load') + ->share('Load', [$this, 'getLoad'], true); + + $container->alias(Insert::class, 'Insert') + ->share('Insert', [$this, 'getInsert'], true); + } + + /** + * Get the Core Load Database + * + * @param Container $container The DI container. + * + * @return Load + * @since 3.2.0 + */ + public function getLoad(Container $container): Load + { + return new Load(); + } + + /** + * Get the Core Insert Database + * + * @param Container $container The DI container. + * + * @return Insert + * @since 3.2.0 + */ + public function getInsert(Container $container): Insert + { + return new Insert(); + } + +} + diff --git a/src/4815e1c7-a433-443d-a112-d1e03d7df84b/settings.json b/src/4815e1c7-a433-443d-a112-d1e03d7df84b/settings.json new file mode 100644 index 0000000..2689df3 --- /dev/null +++ b/src/4815e1c7-a433-443d-a112-d1e03d7df84b/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "4815e1c7-a433-443d-a112-d1e03d7df84b", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Database", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Database", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "06f8eada-d59b-441c-b287-0aea1793da5a", + "as": "default" + }, + "use_selection1": { + "use": "524eb8f6-38d4-47dc-92ad-98b94e099ac0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Database", + "description": "Database Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/489da602-27c7-418c-bf59-1d45ad42bdcc/README.md b/src/489da602-27c7-418c-bf59-1d45ad42bdcc/README.md new file mode 100644 index 0000000..27e361d --- /dev/null +++ b/src/489da602-27c7-418c-bf59-1d45ad42bdcc/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Phpcustomview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Phpcustomview #Gold { + # array $areas + # array $guiMapper + # Customcode $customcode + # Gui $gui + # Loader $loader + # Templatelayout $templateLayout + + __construct(?Customcode $customcode = null, ?Gui $gui = null, ...) + + set(object $item, string $table = 'site_view') : void +} + +note right of Phpcustomview::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Customcode $customcode = null + ?Gui $gui = null + ?Loader $loader = null + ?Templatelayout $templateLayout = null +end note + +note right of Phpcustomview::set + Set PHP code + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/489da602-27c7-418c-bf59-1d45ad42bdcc/code.php b/src/489da602-27c7-418c-bf59-1d45ad42bdcc/code.php new file mode 100644 index 0000000..1c06d5b --- /dev/null +++ b/src/489da602-27c7-418c-bf59-1d45ad42bdcc/code.php @@ -0,0 +1,152 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Model\Loader; +use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as Templatelayout; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model PHP Custom View Class + * + * @since 3.2.0 + */ +class Phpcustomview +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = [ + 'php_view', + 'php_jview', + 'php_jview_display', + 'php_document' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => null, + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Auto Loader + * + * @var Loader + * @since 3.2.0 + */ + protected Loader $loader; + + /** + * Compiler Template Layout Data + * + * @var Templatelayout + * @since 3.2.0 + */ + protected Templatelayout $templateLayout; + + /** + * Constructor + * + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Loader|null $loader The compiler loader object. + * @param Templatelayout|null $templateLayout The template layout data. + * + * @since 3.2.0 + */ + public function __construct(?Customcode $customcode = null, ?Gui $gui = null, + ?Loader $loader = null, ?Templatelayout $templateLayout = null) + { + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->loader = $loader ?: Compiler::_('Model.Loader'); + $this->templateLayout = $templateLayout ?: Compiler::_('Templatelayout.Data'); + } + + /** + * Set PHP code + * + * @param object $item The item data + * @param string $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'site_view') + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + foreach ($this->areas as $area) + { + if (isset($item->{'add_' . $area}) + && $item->{'add_' . $area} == 1 + && StringHelper::check($item->$area)) + { + // update GUI mapper field + $this->guiMapper['field'] = $area; + $item->{$area} = $this->gui->set( + $this->customcode->update( + base64_decode((string) $item->{$area}) + ), + $this->guiMapper + ); + + // check if we have template or layouts to load + $this->templateLayout->set( + $item->{$area}, $item->code + ); + + // auto loaders + $this->loader->set($item->code, $item->{$area}); + + // set uikit version 2 + $this->loader->uikit($item->code, $item->{$area}); + } + } + } + +} + diff --git a/src/489da602-27c7-418c-bf59-1d45ad42bdcc/settings.json b/src/489da602-27c7-418c-bf59-1d45ad42bdcc/settings.json new file mode 100644 index 0000000..1f35fba --- /dev/null +++ b/src/489da602-27c7-418c-bf59-1d45ad42bdcc/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "489da602-27c7-418c-bf59-1d45ad42bdcc", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Phpcustomview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Phpcustomview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection2": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection3": { + "use": "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7", + "as": "default" + }, + "use_selection4": { + "use": "39ea8150-f124-4e47-909d-641bf1c96d5e", + "as": "Templatelayout" + }, + "use_selection5": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Phpcustomview", + "description": "Model PHP Custom View Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md b/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md new file mode 100644 index 0000000..2abd56d --- /dev/null +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Event (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaThree** +```uml +@startuml +class Event #Gold { + # $activePlugins + + __construct(?Registry $params = null) + + trigger(string $event, mixed $data) : void +} + +note right of Event::__construct + Constructor + + since: 3.2.0 +end note + +note right of Event::trigger + Trigger and event + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php new file mode 100644 index 0000000..6dda2dc --- /dev/null +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php @@ -0,0 +1,100 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree; + + +use Joomla\Registry\Registry; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; + + +/** + * Compiler Events + * + * @since 3.2.0 + */ +class Event implements EventInterface +{ + /** + * event plugin trigger switch + * + * @var boolean + * @since 3.2.0 + */ + protected $activePlugins = false; + + /** + * Constructor + * + * @param Registry|null $params The component parameters + * + * @since 3.2.0 + */ + public function __construct(?Registry $params = null) + { + // Set the params + $params = $params ?: Helper::getParams('com_componentbuilder'); + // get active plugins + if (($plugins = $params->get('compiler_plugin', false)) + !== false) + { + foreach ($plugins as $plugin) + { + // get possible plugins + if (\JPluginHelper::isEnabled('extension', $plugin)) + { + // Import the appropriate plugin group. + \JPluginHelper::importPlugin('extension', $plugin); + // activate events + $this->activePlugins = true; + } + } + } + } + + /** + * Trigger and event + * + * @param string $event The event to trigger + * @param mixed $data The values to pass to the event/plugin + * + * @return void + * @throws \Exception + * @since 3.2.0 + */ + public function trigger(string $event, $data) + { + // only execute if plugins were loaded (active) + if ($this->activePlugins) + { + // Get the dispatcher. + $dispatcher = \JEventDispatcher::getInstance(); + + // Trigger this compiler event. + $results = $dispatcher->trigger($event, $data); + + // Check for errors encountered while trigger the event + if (count((array) $results) && in_array(false, $results, true)) + { + // Get the last error. + $error = $dispatcher->getError(); + + if (!($error instanceof \Exception)) + { + throw new \Exception($error); + } + } + } + } + +} + diff --git a/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json b/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json new file mode 100644 index 0000000..deb6bcd --- /dev/null +++ b/src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json @@ -0,0 +1,24 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "4b86f62e-ce41-4325-a11a-08148807d0df", + "implements": [ + "20ed72b0-fcac-4344-aee1-8a65e3bf221d" + ], + "implements_custom": "", + "load_selection": null, + "name": "Event", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaThree.Event", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaThree.Event", + "description": "Compiler Events\r\n\r\n@since 3.2.0", + "head": "use Joomla\\Registry\\Registry;" +} \ No newline at end of file diff --git a/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/README.md b/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/README.md new file mode 100644 index 0000000..4ddd601 --- /dev/null +++ b/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Line (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +abstract Line #Orange { + - static $add + + {static} _(int $nr, string $class) : string + - {static} add() : bool + - {static} init() : void +} + +note right of Line::_ + Set the line number in comments + + since: 3.2.0 + return: string +end note + +note right of Line::add + Check if we should add the line number + + since: 3.2.0 + return: bool +end note + +note right of Line::init + The constructor for add + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/code.php b/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/code.php new file mode 100644 index 0000000..45bdf95 --- /dev/null +++ b/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/code.php @@ -0,0 +1,79 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; + + +/** + * The Debug Line Number Factory + * + * @since 3.2.0 + */ +abstract class Line +{ + /** + * Should we add debug lines + * + * @since 3.2.0 + **/ + private static $add = 'check'; + + /** + * Set the line number in comments + * + * @param int $nr The line number + * @param string $class The class name + * + * @return string + * @since 3.2.0 + */ + public static function _(int $nr, string $class): string + { + if (self::add()) + { + return ' [' . $class . ' ' . $nr . ']'; + } + + return ''; + } + + /** + * Check if we should add the line number + * + * @return bool + * @since 3.2.0 + */ + private static function add(): bool + { + if (!is_bool(self::$add)) + { + self::init(); + } + + return self::$add; + } + + /** + * The constructor for add + * + * @return void + * @since 3.2.0 + */ + private static function init() + { + self::$add = Compiler::_('Config')->debug_line_nr; + } + +} + diff --git a/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/settings.json b/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/settings.json new file mode 100644 index 0000000..b4c8a0d --- /dev/null +++ b/src/4e6ff11d-bebf-42f5-8fd7-b2f882857222/settings.json @@ -0,0 +1,21 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Line", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Line", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Line", + "description": "The Debug Line Number Factory\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/README.md b/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/README.md new file mode 100644 index 0000000..07f88cd --- /dev/null +++ b/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Ajaxadmin (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Ajaxadmin #Gold { + # array $guiMapper + # Config $config + # Registry $registry + # Dispenser $dispenser + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(object $item, string $table = 'admin_view') : void +} + +note right of Ajaxadmin::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Dispenser $dispenser = null +end note + +note right of Ajaxadmin::set + Set Ajax Code + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/code.php b/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/code.php new file mode 100644 index 0000000..473e832 --- /dev/null +++ b/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/code.php @@ -0,0 +1,174 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Admin Ajax Class + * + * @since 3.2.0 + */ +class Ajaxadmin +{ + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'admin_view', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Dispenser|null $dispenser The compiler customcode dispenser + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, ?Dispenser $dispenser = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Set Ajax Code + * + * @param object $item The item data + * @param string $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'admin_view') + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + if (isset($item->add_php_ajax) && $item->add_php_ajax == 1) + { + // insure the token is added to edit view at least + $this->dispenser->hub['token'][$item->name_single_code] + = true; + + $add_ajax_site = false; + + if ($this->registry->get('builder.site_edit_view.' . $item->id, false)) + { + // we should add this site ajax to front ajax + $add_ajax_site = true; + $this->config->set('add_site_ajax', true); + } + + // check if controller input as been set + $item->ajax_input = (isset($item->ajax_input) + && JsonHelper::check($item->ajax_input)) + ? json_decode((string) $item->ajax_input, true) : null; + + if (ArrayHelper::check($item->ajax_input)) + { + if ($add_ajax_site) + { + $this->dispenser->hub['site']['ajax_controller'][$item->name_single_code] + = array_values($item->ajax_input); + } + + $this->dispenser->hub['admin']['ajax_controller'][$item->name_single_code] + = array_values($item->ajax_input); + + $this->config->set('add_ajax', true); + + unset($item->ajax_input); + } + + if (StringHelper::check($item->php_ajaxmethod)) + { + // make sure we are still in PHP + $this->guiMapper['type'] = 'php'; + + // update GUI mapper field + $this->guiMapper['field'] = 'php_ajaxmethod'; + + $this->dispenser->set( + $item->php_ajaxmethod, + 'admin', + 'ajax_model', + $item->name_single_code, + $this->guiMapper + ); + + if ($add_ajax_site) + { + $this->dispenser->set( + $item->php_ajaxmethod, + 'site', + 'ajax_model', + $item->name_single_code, + $this->guiMapper, + false, + false + ); + } + + // switch ajax on + $this->config->set('add_ajax', true); + + // unset anyway + unset($item->php_ajaxmethod); + } + } + } + +} + diff --git a/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/settings.json b/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/settings.json new file mode 100644 index 0000000..bd963fb --- /dev/null +++ b/src/4f575bd6-de97-41f8-80d6-259c8a6dd9ad/settings.json @@ -0,0 +1,45 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "4f575bd6-de97-41f8-80d6-259c8a6dd9ad", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Ajaxadmin", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Ajaxadmin", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection4": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection5": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection6": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Ajaxadmin", + "description": "Model Admin Ajax Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/README.md b/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/README.md new file mode 100644 index 0000000..84aba84 --- /dev/null +++ b/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/README.md @@ -0,0 +1,69 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Placefix (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +abstract Placefix #Orange { + + {static} _(string $string) : string + + {static} b() : string + + {static} d() : string + + {static} _h(string $string) : string + + {static} h() : string +} + +note right of Placefix::_ + Get a prefix and suffix added to given string + + since: 3.2.0 + return: string +end note + +note right of Placefix::b + Get a open prefix + + since: 3.2.0 + return: string +end note + +note right of Placefix::d + Get a close suffix + + since: 3.2.0 + return: string +end note + +note right of Placefix::_h + Get a hash prefix and suffix added to given string + + since: 3.2.0 + return: string +end note + +note right of Placefix::h + Get a hash-fix + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/code.php b/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/code.php new file mode 100644 index 0000000..a7da9d0 --- /dev/null +++ b/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/code.php @@ -0,0 +1,106 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +/** + * The Placeholder Prefix and Suffix Factory + * + * @since 3.2.0 + */ +abstract class Placefix +{ + /** + * The hash prefix and suffix + * + * @var string + * @since 3.2.0 + **/ + private static string $hhh = '#' . '#' . '#'; + + /** + * The open prefix + * + * @var string + * @since 3.2.0 + **/ + private static string $bbb = '[' . '[' . '['; + + /** + * The close suffix + * + * @var string + * @since 3.2.0 + **/ + private static string $ddd = ']' . ']' . ']'; + + /** + * Get a prefix and suffix added to given string + * + * @param string $class The class name + * + * @return string + * @since 3.2.0 + */ + public static function _(string $string): string + { + return self::b() . $string . self::d(); + } + + /** + * Get a open prefix + * + * @return string + * @since 3.2.0 + */ + public static function b(): string + { + return self::$bbb; + } + + /** + * Get a close suffix + * + * @return string + * @since 3.2.0 + */ + public static function d(): string + { + return self::$ddd; + } + + /** + * Get a hash prefix and suffix added to given string + * + * @param string $class The class name + * + * @return string + * @since 3.2.0 + */ + public static function _h(string $string): string + { + return self::h() . $string . self::h(); + } + + /** + * Get a hash-fix + * + * @return string + * @since 3.2.0 + */ + public static function h(): string + { + return self::$hhh; + } + +} + diff --git a/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/settings.json b/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/settings.json new file mode 100644 index 0000000..d0edf1c --- /dev/null +++ b/src/500f3a7f-c16d-4dd4-81b2-2df6776b5388/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Placefix", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Placefix", + "type": "abstract class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Placefix", + "description": "The Placeholder Prefix and Suffix Factory\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md new file mode 100644 index 0000000..bd9b852 --- /dev/null +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/README.md @@ -0,0 +1,109 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Utilities (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Utilities #Gold { + + register(Container $container) : void + + getFolder(Container $container) : Folder + + getFile(Container $container) : File + + getCounter(Container $container) : Counter + + getPaths(Container $container) : Paths + + getFiles(Container $container) : Files + + getConstantpaths(Container $container) : Constantpaths + + getDynamicpath(Container $container) : Dynamicpath + + getPathfix(Container $container) : Pathfix + + getStructure(Container $container) : Structure +} + +note right of Utilities::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Utilities::getFolder + Get the Compiler Folder + + since: 3.2.0 + return: Folder +end note + +note right of Utilities::getFile + Get the Compiler File + + since: 3.2.0 + return: File +end note + +note left of Utilities::getCounter + Get the Compiler Counter + + since: 3.2.0 + return: Counter +end note + +note right of Utilities::getPaths + Get the Compiler Paths + + since: 3.2.0 + return: Paths +end note + +note left of Utilities::getFiles + Get the Compiler Files Bucket + + since: 3.2.0 + return: Files +end note + +note right of Utilities::getConstantpaths + Get the Constant Paths + + since: 3.2.0 + return: Constantpaths +end note + +note left of Utilities::getDynamicpath + Get the Compiler Dynamic Path + + since: 3.2.0 + return: Dynamicpath +end note + +note right of Utilities::getPathfix + Get the Compiler Path Fixer + + since: 3.2.0 + return: Pathfix +end note + +note left of Utilities::getStructure + Get the Compiler Structure Dynamic Builder + + since: 3.2.0 + return: Structure +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php new file mode 100644 index 0000000..169c447 --- /dev/null +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/code.php @@ -0,0 +1,211 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Componentbuilder\Utilities\Constantpaths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Structure; + + +/** + * Utilities Service Provider + * + * @since 3.2.0 + */ +class Utilities implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Folder::class, 'Utilities.Folder') + ->share('Utilities.Folder', [$this, 'getFolder'], true); + + $container->alias(File::class, 'Utilities.File') + ->share('Utilities.File', [$this, 'getFile'], true); + + $container->alias(Counter::class, 'Utilities.Counter') + ->share('Utilities.Counter', [$this, 'getCounter'], true); + + $container->alias(Paths::class, 'Utilities.Paths') + ->share('Utilities.Paths', [$this, 'getPaths'], true); + + $container->alias(Files::class, 'Utilities.Files') + ->share('Utilities.Files', [$this, 'getFiles'], true); + + $container->alias(Constantpaths::class, 'Utilities.Constantpaths') + ->share('Utilities.Constantpaths', [$this, 'getConstantpaths'], true); + + $container->alias(Dynamicpath::class, 'Utilities.Dynamicpath') + ->share('Utilities.Dynamicpath', [$this, 'getDynamicpath'], true); + + $container->alias(Pathfix::class, 'Utilities.Pathfix') + ->share('Utilities.Pathfix', [$this, 'getPathfix'], true); + + $container->alias(Structure::class, 'Utilities.Structure') + ->share('Utilities.Structure', [$this, 'getStructure'], true); + } + + /** + * Get the Compiler Folder + * + * @param Container $container The DI container. + * + * @return Folder + * @since 3.2.0 + */ + public function getFolder(Container $container): Folder + { + return new Folder( + $container->get('Utilities.Counter'), + $container->get('Utilities.File') + ); + } + + /** + * Get the Compiler File + * + * @param Container $container The DI container. + * + * @return File + * @since 3.2.0 + */ + public function getFile(Container $container): File + { + return new File( + $container->get('Utilities.Counter') + ); + } + + /** + * Get the Compiler Counter + * + * @param Container $container The DI container. + * + * @return Counter + * @since 3.2.0 + */ + public function getCounter(Container $container): Counter + { + return new Counter( + $container->get('Content') + ); + } + + /** + * Get the Compiler Paths + * + * @param Container $container The DI container. + * + * @return Paths + * @since 3.2.0 + */ + public function getPaths(Container $container): Paths + { + return new Paths( + $container->get('Config'), + $container->get('Component') + ); + } + + /** + * Get the Compiler Files Bucket + * + * @param Container $container The DI container. + * + * @return Files + * @since 3.2.0 + */ + public function getFiles(Container $container): Files + { + return new Files(); + } + + /** + * Get the Constant Paths + * + * @param Container $container The DI container. + * + * @return Constantpaths + * @since 3.2.0 + */ + public function getConstantpaths(Container $container): Constantpaths + { + return new Constantpaths(); + } + + /** + * Get the Compiler Dynamic Path + * + * @param Container $container The DI container. + * + * @return Dynamicpath + * @since 3.2.0 + */ + public function getDynamicpath(Container $container): Dynamicpath + { + return new Dynamicpath( + $container->get('Placeholder'), + $container->get('Utilities.Constantpaths') + ); + } + + /** + * Get the Compiler Path Fixer + * + * @param Container $container The DI container. + * + * @return Pathfix + * @since 3.2.0 + */ + public function getPathfix(Container $container): Pathfix + { + return new Pathfix(); + } + + /** + * Get the Compiler Structure Dynamic Builder + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Component.Settings'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Counter'), + $container->get('Utilities.File'), + $container->get('Utilities.Files') + ); + } + +} + diff --git a/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json new file mode 100644 index 0000000..410abf1 --- /dev/null +++ b/src/516f93b8-5fff-41c6-aeaf-2d93180a12cc/settings.json @@ -0,0 +1,59 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "516f93b8-5fff-41c6-aeaf-2d93180a12cc", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Utilities", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Utilities", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "as": "default" + }, + "use_selection2": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection3": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection4": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection5": { + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "as": "default" + }, + "use_selection6": { + "use": "e0c8c931-52a0-4171-9909-e8769505bb1f", + "as": "default" + }, + "use_selection7": { + "use": "268b85ef-49f3-4c39-8187-bb12e38d19ee", + "as": "default" + }, + "use_selection8": { + "use": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "as": "default" + }, + "use_selection9": { + "use": "1efdded5-d6c8-452c-8f37-0374483a7b3f", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Utilities", + "description": "Utilities Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/README.md b/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/README.md new file mode 100644 index 0000000..7efa5cb --- /dev/null +++ b/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Createdate (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Createdate #Gold { + + get(mixed $item) : string +} + +note right of Createdate::get + Get the create date of an item + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/code.php b/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/code.php new file mode 100644 index 0000000..ae78161 --- /dev/null +++ b/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/code.php @@ -0,0 +1,52 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model - Get Create Date + * + * @since 3.2.0 + */ +class Createdate +{ + /** + * Get the create date of an item + * + * @param mixed $item The item data + * + * @return string The create data + * @since 3.2.0 + */ + public function get(&$item): string + { + if (isset($item['settings']->created) + && StringHelper::check($item['settings']->created)) + { + // first set the main date + $date = strtotime((string) $item['settings']->created); + } + else + { + // first set the main date + $date = strtotime("now"); + } + + return Factory::getDate($date)->format('jS F, Y'); + } + +} + diff --git a/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/settings.json b/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/settings.json new file mode 100644 index 0000000..c83d1ad --- /dev/null +++ b/src/53cf9828-7ad4-4856-aac1-7c4c67bd3121/settings.json @@ -0,0 +1,22 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "53cf9828-7ad4-4856-aac1-7c4c67bd3121", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Createdate", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Createdate", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Createdate", + "description": "Model - Get Create Date\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/55e61314-ba10-4e2b-92dd-b44adebabce9/README.md b/src/55e61314-ba10-4e2b-92dd-b44adebabce9/README.md new file mode 100644 index 0000000..884f94b --- /dev/null +++ b/src/55e61314-ba10-4e2b-92dd-b44adebabce9/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Conditions (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Conditions #Gold { + # TypeName $typeName + # FieldName $fieldName + + __construct(?TypeName $typeName = null, ?FieldName $fieldName = null) + + set(object $item) : void +} + +note right of Conditions::__construct + Constructor + + since: 3.2.0 +end note + +note right of Conditions::set + Set the conditions + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/55e61314-ba10-4e2b-92dd-b44adebabce9/code.php b/src/55e61314-ba10-4e2b-92dd-b44adebabce9/code.php new file mode 100644 index 0000000..94111db --- /dev/null +++ b/src/55e61314-ba10-4e2b-92dd-b44adebabce9/code.php @@ -0,0 +1,173 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; + + +/** + * Model Conditions Class + * + * @since 3.2.0 + */ +class Conditions +{ + /** + * Compiler Type Name + * + * @var TypeName + * @since 3.2.0 + */ + protected TypeName $typeName; + + /** + * Compiler Field Name + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldName; + + /** + * Constructor + * + * @param TypeName|null $typeName The compiler type name object. + * @param FieldName|null $fieldName The compiler field name object. + * + * @since 3.2.0 + */ + public function __construct(?TypeName $typeName = null, ?FieldName $fieldName = null) + { + $this->typeName = $typeName ?: Compiler::_('Field.Type.Name'); + $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); + } + + /** + * Set the conditions + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addconditions = (isset($item->addconditions) + && JsonHelper::check($item->addconditions)) + ? json_decode((string) $item->addconditions, true) : null; + + if (ArrayHelper::check($item->addconditions)) + { + $item->conditions = []; + $ne = 0; + foreach ($item->addconditions as $nr => $conditionValue) + { + if (ArrayHelper::check( + $conditionValue['target_field'] + ) && ArrayHelper::check($item->fields)) + { + foreach ( $conditionValue['target_field'] as $fieldKey => $fieldId) + { + foreach ($item->fields as $fieldValues) + { + if ((int) $fieldValues['field'] == (int) $fieldId) + { + // load the field details + $required = GetHelper::between( + $fieldValues['settings']->xml, + 'required="', '"' + ); + + $required = ($required === 'true' + || $required === '1') ? 'yes' : 'no'; + + $filter = GetHelper::between( + $fieldValues['settings']->xml, + 'filter="', '"' + ); + + $filter = StringHelper::check( + $filter + ) ? $filter : 'none'; + + // set the field name + $conditionValue['target_field'][$fieldKey] = [ + 'name' => $this->fieldName->get( + $fieldValues, $item->name_list_code + ), + 'type' => $this->typeName->get( + $fieldValues + ), + 'required' => $required, + 'filter' => $filter + ]; + + break; + } + } + } + } + + // load match field + if (ArrayHelper::check($item->fields) + && isset($conditionValue['match_field'])) + { + foreach ($item->fields as $fieldValue) + { + if ((int) $fieldValue['field'] == (int) $conditionValue['match_field']) + { + // set the type + $type = $this->typeName->get($fieldValue); + // set the field details + $conditionValue['match_name'] = $this->fieldName->get( + $fieldValue, $item->name_list_code + ); + $conditionValue['match_type'] = $type; + $conditionValue['match_xml'] = $fieldValue['settings']->xml; + + // if custom field load field being extended + if (!FieldHelper::check($type)) + { + $conditionValue['match_extends'] = GetHelper::between( + $fieldValue['settings']->xml, + 'extends="', '"' + ); + } + else + { + $conditionValue['match_extends'] = ''; + } + break; + } + } + } + + // set condition values + $item->conditions[$ne] = $conditionValue; + + $ne++; + } + } + + unset($item->addconditions); + } + +} + diff --git a/src/55e61314-ba10-4e2b-92dd-b44adebabce9/settings.json b/src/55e61314-ba10-4e2b-92dd-b44adebabce9/settings.json new file mode 100644 index 0000000..cdac61b --- /dev/null +++ b/src/55e61314-ba10-4e2b-92dd-b44adebabce9/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "55e61314-ba10-4e2b-92dd-b44adebabce9", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Conditions", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Conditions", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "eb33420d-359d-44a5-852e-613aef1feaae", + "as": "default" + }, + "use_selection2": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection3": { + "use": "7a5fd3f3-199e-43ba-a8e8-f473d6c030ec", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection6": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection7": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Conditions", + "description": "Model Conditions Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/README.md b/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/README.md new file mode 100644 index 0000000..796583c --- /dev/null +++ b/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/README.md @@ -0,0 +1,47 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Ajaxcustomview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Ajaxcustomview #Gold { + # array $guiMapper + # Config $config + # Dispenser $dispenser + + __construct(?Config $config = null, ?Dispenser $dispenser = null) + + set(object $item, string $table = 'site_view') : void +} + +note right of Ajaxcustomview::__construct + Constructor + + since: 3.2.0 +end note + +note right of Ajaxcustomview::set + Set Ajax Code + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/code.php b/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/code.php new file mode 100644 index 0000000..e4e0d39 --- /dev/null +++ b/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/code.php @@ -0,0 +1,151 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Custom Ajax Custom View Class + * + * @since 3.2.0 + */ +class Ajaxcustomview +{ + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'site_view', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Dispenser|null $dispenser The compiler customcode dispenser + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Dispenser $dispenser = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Set Ajax Code + * + * @param object $item The item data + * @param string $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'site_view') + { + // add_Ajax for this view + if (isset($item->add_php_ajax) && $item->add_php_ajax == 1) + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + // ajax target (since we only have two options really) + if ('site' === $this->config->build_target) + { + $target = 'site'; + } + else + { + $target = 'admin'; + } + + $add_ajax_site = false; + + // check if controller input as been set + $item->ajax_input = (isset($item->ajax_input) + && JsonHelper::check($item->ajax_input)) + ? json_decode((string) $item->ajax_input, true) : null; + + if (ArrayHelper::check($item->ajax_input)) + { + $this->dispenser->hub[$target]['ajax_controller'][$item->code] + = array_values($item->ajax_input); + + $add_ajax_site = true; + } + unset($item->ajax_input); + + // load the ajax class mathods (if set) + if (StringHelper::check($item->php_ajaxmethod)) + { + // set field + $this->guiMapper['field'] = 'php_ajaxmethod'; + $this->dispenser->set( + $item->php_ajaxmethod, + $target, + 'ajax_model', + $item->code, + $this->guiMapper + ); + + $add_ajax_site = true; + } + unset($item->php_ajaxmethod); + + // should ajax be set + if ($add_ajax_site) + { + // turn on ajax area + if ('site' === $this->config->build_target) + { + $this->config->set('add_site_ajax', true); + } + else + { + $this->config->set('add_ajax', true); + } + } + } + } + +} + diff --git a/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/settings.json b/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/settings.json new file mode 100644 index 0000000..8710b33 --- /dev/null +++ b/src/592aed4e-2c5f-4fc5-8f7a-409203d1af82/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "592aed4e-2c5f-4fc5-8f7a-409203d1af82", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Ajaxcustomview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Ajaxcustomview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection3": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Ajaxcustomview", + "description": "Model Custom Ajax Custom View Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/59895f37-50c8-4af3-9dad-230e18841953/README.md b/src/59895f37-50c8-4af3-9dad-230e18841953/README.md new file mode 100644 index 0000000..0604dee --- /dev/null +++ b/src/59895f37-50c8-4af3-9dad-230e18841953/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Libraries (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Libraries #Gold { + # Config $config + # Registry $registry + # Library $library + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(string $key, object $item, ...) : void +} + +note right of Libraries::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Library $library = null +end note + +note right of Libraries::set + Set Libraries + + since: 3.2.0 + return: void + + arguments: + string $key + object $item + string $target = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/59895f37-50c8-4af3-9dad-230e18841953/code.php b/src/59895f37-50c8-4af3-9dad-230e18841953/code.php new file mode 100644 index 0000000..e2023df --- /dev/null +++ b/src/59895f37-50c8-4af3-9dad-230e18841953/code.php @@ -0,0 +1,115 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Library\Data as Library; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Libraries Class + * + * @since 3.2.0 + */ +class Libraries +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Library Data + * + * @var Library + * @since 3.2.0 + */ + protected Library $library; + + /** + * Constructor + * + * @param Config|null $config The compiler config. + * @param Registry|null $registry The compiler registry. + * @param Library|null $library The compiler library data object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, ?Library $library = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->library = $library ?: Compiler::_('Library.Data'); + } + + /** + * Set Libraries + * + * @param string $key The key mapper + * @param object $item The item data + * @param string|null $target The area being targeted + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, object &$item, string $target = null) + { + // set the target + $target = $target ?: $this->config->build_target; + + // make sure json become array + if (JsonHelper::check($item->libraries)) + { + $item->libraries = json_decode((string) $item->libraries, true); + } + + // if we have an array add it + if (ArrayHelper::check($item->libraries)) + { + foreach ($item->libraries as $library) + { + if (!$this->registry->exists('builder.library_manager.' . + $target . '.' . $key . '.' . (int) $library) && $this->library->get((int) $library)) + { + $this->registry->set('builder.library_manager.' . + $target . '.' . $key . '.' . (int) $library, true); + } + } + } + elseif (is_numeric($item->libraries) + && !$this->registry->exists('builder.library_manager.' . + $target . '.' . $key . '.' . (int) $item->libraries) + && $this->library->get((int) $item->libraries)) + { + $this->registry->set('builder.library_manager.' . + $target . '.' . $key . '.' . (int) $item->libraries, true); + } + } + +} + diff --git a/src/59895f37-50c8-4af3-9dad-230e18841953/settings.json b/src/59895f37-50c8-4af3-9dad-230e18841953/settings.json new file mode 100644 index 0000000..f074d2e --- /dev/null +++ b/src/59895f37-50c8-4af3-9dad-230e18841953/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "59895f37-50c8-4af3-9dad-230e18841953", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Libraries", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Libraries", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "7175c1cd-2071-4cd7-b499-23881e168c3f", + "as": "Library" + }, + "use_selection4": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection5": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Libraries", + "description": "Model Libraries Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md b/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md new file mode 100644 index 0000000..422c2ff --- /dev/null +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/README.md @@ -0,0 +1,70 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Selection (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Dynamicget** +```uml +@startuml +class Selection #Gold { + # array $name + # Config $config + # Registry $registry + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + get(string $methodKey, string $viewCode, ...) : ?array + # name(int $id) : string +} + +note right of Selection::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?\JDatabaseDriver $db = null +end note + +note right of Selection::get + Get Data Selection of the dynamic get + + since: 3.2.0 + return: ?array + + arguments: + string $methodKey + string $viewCode + string $string + string $asset + string $as + string $type + ?int $rowType = null +end note + +note right of Selection::name + Get the Admin view table name + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php new file mode 100644 index 0000000..695095a --- /dev/null +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/code.php @@ -0,0 +1,281 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Dynamicget; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Dynamic Get Selection Class + * + * @since 3.2.0 + */ +class Selection +{ + /** + * Admin view table names + * + * @var array + * @since 3.2.0 + */ + protected array $name; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get Data Selection of the dynamic get + * + * @param string $methodKey The method unique key + * @param string $viewCode The code name of the view + * @param string $string The data string + * @param string $asset The asset in question + * @param string $as The as string + * @param string $type The target type (db||view) + * @param int|null $rowType The row type + * + * @return array|null the select query + * @since 3.2.0 + */ + public function get(string $methodKey, string $viewCode, + string $string, string $asset, string $as, string $type, ?int $rowType = null): ?array + { + if (StringHelper::check($string)) + { + if ('db' === $type) + { + $table = '#__' . $asset; + $queryName = $asset; + $view = ''; + } + elseif ('view' === $type) + { + $view = $this->name($asset); + $table = '#__' . $this->config->component_code_name . '_' . $view; + $queryName = $view; + } + else + { + return null; + } + + // just get all values from table if * is found + if ($string === '*' || strpos($string, '*') !== false) + { + if ($type == 'view') + { + // TODO move getViewTableColumns to its own class + $_string = Helper::_('getViewTableColumns', + [$asset, $as, $rowType] + ); + } + else + { + // TODO move getDbTableColumns to its own class + $_string = Helper::_('getDbTableColumns', + [$asset, $as, $rowType] + ); + } + + // get only selected values + $lines = explode(PHP_EOL, (string) $_string); + + // make sure to set the string to * + $string = '*'; + } + else + { + // get only selected values + $lines = explode(PHP_EOL, $string); + } + + // only continue if lines are available + if (ArrayHelper::check($lines)) + { + $gets = []; + $keys = []; + + // first load all options + foreach ($lines as $line) + { + if (strpos($line, 'AS') !== false) + { + $lineArray = explode("AS", $line); + } + elseif (strpos($line, 'as') !== false) + { + $lineArray = explode("as", $line); + } + else + { + $lineArray = array($line, null); + } + + // set the get and key + $get = trim($lineArray[0]); + $key = trim($lineArray[1]); + + // only add the view (we must adapt this) + if ($this->registry->exists('builder.get_as_lookup.' . $methodKey . '.' . $get) + && 'a' != $as + && is_numeric($rowType) && 1 == $rowType + && 'view' === $type + && strpos('#' . $key, '#' . $view . '_') === false) + { + // this is a problem (TODO) since we may want to not add the view name. + $key = $view . '_' . trim($key); + } + + // continue only if we have get + if (StringHelper::check($get)) + { + $gets[] = $this->db->quote($get); + if (StringHelper::check($key)) + { + $this->registry-> + set('builder.get_as_lookup.' . $methodKey . '.' . $get, $key); + } + else + { + $key = str_replace( + $as . '.', '', $get + ); + + $this->registry-> + set('builder.get_as_lookup.' . $methodKey . '.' . $get, $key); + } + + // set the keys + $keys[] = $this->db->quote( + $key + ); + + // make sure we have the view name + if (StringHelper::check($view)) + { + // prep the field name + $field = str_replace($as . '.', '', $get); + // load to the site fields memory bucket + $this->registry-> + set('builder.site_fields.' . $view . '.' . $field . '.' . $methodKey . '___' . $as, + ['site' => $viewCode, 'get' => $get, 'as' => $as, 'key' => $key]); + } + } + } + + if (ArrayHelper::check($gets) + && ArrayHelper::check($keys)) + { + // single joined selection needs the prefix to the values to avoid conflict in the names + // so we must still add then AS + if ($string == '*' && (is_null($rowType) || 1 != $rowType)) + { + $querySelect = "\$query->select('" . $as . ".*');"; + } + else + { + $querySelect = '$query->select($db->quoteName(' + . PHP_EOL . Indent::_(3) . 'array(' . implode( + ',', $gets + ) . '),' . PHP_EOL . Indent::_(3) . 'array(' + . implode(',', $keys) . ')));'; + } + $queryFrom = '$db->quoteName(' . $this->db->quote($table) + . ', ' . $this->db->quote($as) . ')'; + + // return the select query + return [ + 'select' => $querySelect, + 'from' => $queryFrom, + 'name' => $queryName, + 'table' => $table, + 'type' => $type, + 'select_gets' => $gets, + 'select_keys' => $keys + ]; + } + } + } + + return null; + } + + /** + * Get the Admin view table name + * + * @param int $id The item id to add + * + * @return string the admin view code name + * @since 3.2.0 + */ + protected function name(int $id): string + { + // get name if not set + if (!isset($this->name[$id])) + { + $this->name[$id] = StringHelper::safe( + GetHelper::var('admin_view', $id, 'id', 'name_single') + ); + } + + return $this->name[$id] ?? 'error'; + } + +} + diff --git a/src/5b021139-dad0-4e9b-882a-2b4d807795af/settings.json b/src/5b021139-dad0-4e9b-882a-2b4d807795af/settings.json new file mode 100644 index 0000000..ffaf680 --- /dev/null +++ b/src/5b021139-dad0-4e9b-882a-2b4d807795af/settings.json @@ -0,0 +1,50 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "5b021139-dad0-4e9b-882a-2b4d807795af", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Selection", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Dynamicget.Selection", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection6": { + "use": "640b5352-fb09-425f-a26e-cd44eda03f15", + "as": "default" + }, + "use_selection7": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Dynamicget.Selection", + "description": "Dynamic Get Selection Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/5c75b455-3d4c-452a-867e-e90424a64c88/README.md b/src/5c75b455-3d4c-452a-867e-e90424a64c88/README.md new file mode 100644 index 0000000..53a7983 --- /dev/null +++ b/src/5c75b455-3d4c-452a-867e-e90424a64c88/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class File (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class File #Gold { + # Counter $counter + # Paths $paths + + __construct(?Counter $counter = null, ?Paths $paths = null) + + html(string $path = '', string $root = 'component') : void + + write(string $path, string $data) : bool +} + +note right of File::__construct + Constructor + + since: 3.2.0 +end note + +note right of File::html + set HTML blank file to a path + + return: void +end note + +note right of File::write + Create a file on the server if it does not exist, or Overwrite existing files + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5c75b455-3d4c-452a-867e-e90424a64c88/code.php b/src/5c75b455-3d4c-452a-867e-e90424a64c88/code.php new file mode 100644 index 0000000..a6046da --- /dev/null +++ b/src/5c75b455-3d4c-452a-867e-e90424a64c88/code.php @@ -0,0 +1,109 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use Joomla\CMS\Filesystem\File as JoomlaFile; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Utilities\FileHelper; + + +/** + * File helper + * + * @since 3.2.0 + */ +class File +{ + /** + * Compiler Utilities Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Constructor + * + * @param Counter|null $counter The compiler counter object. + * @param Paths|null $paths The compiler paths object. + * + * @since 3.2.0 + */ + public function __construct(?Counter $counter = null, ?Paths $paths = null) + { + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + } + + /** + * set HTML blank file to a path + * + * @param string $path The path to where to set the blank html file + * @param string $root The root path + * + * @return void + */ + public function html(string $path = '', string $root = 'component') + { + if ('component' === $root) + { + $root = $this->paths->component_path . '/'; + } + + // use path if exist + if (strlen($path) > 0) + { + JoomlaFile::copy( + $this->paths->template_path . '/index.html', + $root . $path . '/index.html' + ); + } + else + { + JoomlaFile::copy( + $this->paths->template_path . '/index.html', + $root . '/index.html' + ); + } + + // count the file created + $this->counter->file++; + } + + /** + * Create a file on the server if it does not exist, or Overwrite existing files + * + * @param string $path The path and file name where to safe the data + * @param string $data The data to safe + * + * @return bool true On success + * @since 3.2.0 + */ + public function write(string $path, string $data): bool + { + return FileHelper::write($path, $data); + } + +} + diff --git a/src/5c75b455-3d4c-452a-867e-e90424a64c88/settings.json b/src/5c75b455-3d4c-452a-867e-e90424a64c88/settings.json new file mode 100644 index 0000000..31a735c --- /dev/null +++ b/src/5c75b455-3d4c-452a-867e-e90424a64c88/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "5c75b455-3d4c-452a-867e-e90424a64c88", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "File", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.File", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection2": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection3": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.File", + "description": "File helper\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Filesystem\\File as JoomlaFile;" +} \ No newline at end of file diff --git a/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/README.md b/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/README.md new file mode 100644 index 0000000..b2c2352 --- /dev/null +++ b/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customalias (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Customalias #Gold { + # Registry $registry + # FieldName $fieldName + + __construct(?Registry $registry = null, ?FieldName $fieldName = null) + + set(object $item) : void +} + +note right of Customalias::__construct + Constructor + + since: 3.2.0 +end note + +note right of Customalias::set + Set activate alias builder + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/code.php b/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/code.php new file mode 100644 index 0000000..8502253 --- /dev/null +++ b/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/code.php @@ -0,0 +1,110 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Custom Alias Class + * + * @since 3.2.0 + */ +class Customalias +{ + /** + * The compiler Registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * The compiler field name + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldName; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * @param FieldName|null $fieldName The compiler field name object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null, ?FieldName $fieldName = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); + } + + /** + * Set activate alias builder + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + if (!$this->registry->get('builder.custom_alias.' . $item->name_single_code, null) + && isset($item->alias_builder_type) && 2 == $item->alias_builder_type + && isset($item->alias_builder) && JsonHelper::check($item->alias_builder)) + { + // get the aliasFields + $alias_fields = (array) json_decode((string) $item->alias_builder, true); + + // get the active fields + $alias_fields = (array) array_filter( + $item->fields, function ($field) use ($alias_fields) { + // check if field is in view fields + if (in_array($field['field'], $alias_fields)) + { + return true; + } + + return false; + } + ); + + // check if all is well + if (ArrayHelper::check($alias_fields)) + { + // load the field names + $this->registry->set('builder.custom_alias.' . $item->name_single_code, + (array) array_map( + function ($field) use (&$item) { + return $this->fieldName->get( + $field, $item->name_list_code + ); + }, $alias_fields + ) + ); + } + } + + // unset + unset($item->alias_builder); + } + +} + diff --git a/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/settings.json b/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/settings.json new file mode 100644 index 0000000..2184f8d --- /dev/null +++ b/src/5f8e8fa6-3793-44af-882d-9cfb209434e9/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "5f8e8fa6-3793-44af-882d-9cfb209434e9", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Customalias", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Customalias", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection3": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Customalias", + "description": "Model Custom Alias Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md new file mode 100644 index 0000000..d4464f3 --- /dev/null +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class History (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class History #Gold { + # $currentVersion + + register(Container $container) : void + + getHistory(Container $container) : HistoryInterface + + getJ3History(Container $container) : J3History +} + +note right of History::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of History::getHistory + Get the History + + since: 3.2.0 + return: HistoryInterface +end note + +note right of History::getJ3History + Get the Joomla 3 History + + since: 3.2.0 + return: J3History +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php new file mode 100644 index 0000000..7b3a67d --- /dev/null +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php @@ -0,0 +1,88 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History; + + +/** + * History Service Provider + * + * @since 3.2.0 + */ +class History implements ServiceProviderInterface +{ + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3History::class, 'J3.History') + ->share('J3.History', [$this, 'getJ3History'], true); + + $container->alias(HistoryInterface::class, 'History') + ->share('History', [$this, 'getHistory'], true); + } + + /** + * Get the History + * + * @param Container $container The DI container. + * + * @return HistoryInterface + * @since 3.2.0 + */ + public function getHistory(Container $container): HistoryInterface + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.History'); + } + + /** + * Get the Joomla 3 History + * + * @param Container $container The DI container. + * + * @return J3History + * @since 3.2.0 + */ + public function getJ3History(Container $container): J3History + { + return new J3History( + $container->get('Config') + ); + } + +} + diff --git a/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json new file mode 100644 index 0000000..7411a90 --- /dev/null +++ b/src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "63782f74-7b03-4745-aa40-0adf8ed4e704", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "History", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.History", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "4325745f-da1f-4d4d-a591-3189fe8c06e5", + "as": "default" + }, + "use_selection1": { + "use": "87db51b9-1126-4c21-858b-53dbd3a68b61", + "as": "J3History" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.History", + "description": "History Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;\r\nuse Joomla\\CMS\\Version;" +} \ No newline at end of file diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md new file mode 100644 index 0000000..6156dc5 --- /dev/null +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/README.md @@ -0,0 +1,209 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Settings (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Settings #Gold { + # array $standardFolders + # array $standardRootFiles + # ?object $data + # Config $config + # Registry $registry + # EventInterface $event + # Placeholder $placeholder + # Component $component + # Paths $paths + # Dynamicpath $dynamicpath + # Pathfix $pathfix + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + exists() : bool + + structure() : object + + multiple() : object + + single() : object + + standardFolder(string $folder) : bool + + standardRootFile(string $file) : bool + - isSet() : bool + - get() : ?object + - readJsonFile(string $filePath) : ?object + - isValidData(object $versionData) : bool + - loadExtraFolders() : void + - addImportViewFolder() : void + - addPhpSpreadsheetFolder() : void + - addUikitFolder() : void + - addFooTableFolder() : void + - loadExtraFiles() : void + - addGoogleChartFiles() : void + - addFolders(object $versionData) : void + - addFiles(object $versionData) : void +} + +note right of Settings::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Placeholder $placeholder = null + ?Component $component = null + ?Paths $paths = null + ?Dynamicpath $dynamicpath = null + ?Pathfix $pathfix = null +end note + +note left of Settings::exists + Check if data set is loaded + + since: 3.2.0 + return: bool +end note + +note right of Settings::structure + Get Joomla - Folder Structure to Create + + since: 3.2.0 + return: object +end note + +note left of Settings::multiple + Get Joomla - Move Multiple Structure + + since: 3.2.0 + return: object +end note + +note right of Settings::single + Get Joomla - Move Single Structure + + since: 3.2.0 + return: object +end note + +note left of Settings::standardFolder + Check if Folder is a Standard Folder + + since: 3.2.0 + return: bool +end note + +note right of Settings::standardRootFile + Check if File is a Standard Root File + + since: 3.2.0 + return: bool +end note + +note left of Settings::isSet + Check if Data is Set + + since: 3.2.0 + return: bool +end note + +note right of Settings::get + get the Joomla Version Data + + since: 3.2.0 + return: ?object +end note + +note left of Settings::readJsonFile + Read the Json file data + + since: 3.2.0 + return: ?object +end note + +note right of Settings::isValidData + Check if this is valid data + + since: 3.2.0 + return: bool +end note + +note left of Settings::loadExtraFolders + Add Extra/Dynamic folders + + since: 3.2.0 + return: void +end note + +note right of Settings::addImportViewFolder + Add Import and Export Folder + + since: 3.2.0 + return: void +end note + +note left of Settings::addPhpSpreadsheetFolder + Add Php Spreadsheet Folder + + since: 3.2.0 + return: void +end note + +note right of Settings::addUikitFolder + Add Uikit Folders + + since: 3.2.0 + return: void +end note + +note left of Settings::addFooTableFolder + Add Foo Table Folder + + since: 3.2.0 + return: void +end note + +note right of Settings::loadExtraFiles + Add Extra/Dynamic files + + since: 3.2.0 + return: void +end note + +note left of Settings::addGoogleChartFiles + Add Google Chart Files + + since: 3.2.0 + return: void +end note + +note right of Settings::addFolders + Add Folders + + since: 3.2.0 + return: void +end note + +note left of Settings::addFiles + Add Files + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php new file mode 100644 index 0000000..41f3f40 --- /dev/null +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/code.php @@ -0,0 +1,756 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Component (Joomla Version) Settings + * + * @since 3.2.0 + */ +class Settings +{ + /** + * The standard folders + * + * @var array + * @since 3.2.0 + */ + protected array $standardFolders = [ + 'site', + 'admin', + 'media' + ]; + + /** + * The standard root files + * + * @var array + * @since 3.2.0 + */ + protected array $standardRootFiles = [ + 'access.xml', + 'config.xml', + 'controller.php', + 'index.html', + 'README.txt' + ]; + + /** + * Compiler Joomla Version Data + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $data = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Component Dynamic Path + * + * @var Dynamicpath + * @since 3.2.0 + **/ + protected Dynamicpath $dynamicpath; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Component|null $component The component class. + * @param Paths|null $paths The compiler paths object. + * @param Dynamicpath|null $dynamicpath The compiler dynamic path object. + * @param Pathfix|null $pathfix The compiler path fixing object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, + ?Component $component = null, ?Paths $paths = null, + ?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->component = $component ?: Compiler::_('Component'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); + + // add component endpoint file to stander list of root files + $this->standardRootFiles[] = $this->component->get('name_code') . '.php'; + } + + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool + { + if (!$this->isSet()) + { + // load the data + $this->data = $this->get(); + + if (!$this->isSet()) + { + return false; + } + } + + return true; + } + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object + { + return $this->data->create; + } + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object + { + return $this->data->move->dynamic; + } + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object + { + return $this->data->move->static; + } + + /** + * Check if Folder is a Standard Folder + * + * @param string $folder The folder name + * + * @return bool true if the folder exists + * @since 3.2.0 + */ + public function standardFolder(string $folder): bool + { + return in_array($folder, $this->standardFolders); + } + + /** + * Check if File is a Standard Root File + * + * @param string $file The file name + * + * @return bool true if the file exists + * @since 3.2.0 + */ + public function standardRootFile(string $file): bool + { + return in_array($file, $this->standardRootFiles); + } + + /** + * Check if Data is Set + * + * @return bool + * @since 3.2.0 + */ + private function isSet(): bool + { + return is_object($this->data) && + isset($this->data->create) && + isset($this->data->move) && + isset($this->data->move->static) && + isset($this->data->move->dynamic); + } + + /** + * get the Joomla Version Data + * + * @return object|null The version data + * @since 3.2.0 + */ + private function get(): ?object + { + // override option + $customSettings = $this->paths->template_path . '/settings_' . + $this->config->component_code_name . '.json'; + + // get the data + $version_data = $this->readJsonFile($customSettings); + + if (is_null($version_data) || !$this->isValidData($version_data)) + { + return null; + } + + $this->loadExtraFolders(); + $this->loadExtraFiles(); + + $this->addFolders($version_data); + $this->addFiles($version_data); + + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + + // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData + $this->event->trigger( + 'jcb_ce_onAfterSetJoomlaVersionData', + array(&$component_context, &$version_data) + ); + + return $version_data; + } + + /** + * Read the Json file data + * + * @param string $filePath + * + * @return object|null The version data + * @since 3.2.0 + */ + private function readJsonFile(string $filePath): ?object + { + if (FileHelper::exists($filePath)) + { + $jsonContent = FileHelper::getContent($filePath); + } + else + { + $jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json'); + } + + if (JsonHelper::check($jsonContent)) + { + return json_decode((string) $jsonContent); + } + + return null; + } + + /** + * Check if this is valid data + * + * @param object $versionData + * + * @return bool + * @since 3.2.0 + */ + private function isValidData(object $versionData): bool + { + return isset($versionData->create) && + isset($versionData->move) && + isset($versionData->move->static) && + isset($versionData->move->dynamic); + } + + /** + * Add Extra/Dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFolders() + { + if ($this->component->isArray('folders') || + $this->config->get('add_eximport', false) || + $this->config->get('uikit', 0) || + $this->config->get('footable', false)) + { + $this->addImportViewFolder(); + $this->addPhpSpreadsheetFolder(); + $this->addUikitFolder(); + $this->addFooTableFolder(); + } + } + + /** + * Add Import and Export Folder + * + * @return void + * @since 3.2.0 + */ + private function addImportViewFolder() + { + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folder' => 'importViews', + 'path' => 'admin/views/import', + 'rename' => 1 + ]); + } + } + + /** + * Add Php Spreadsheet Folder + * + * @return void + * @since 3.2.0 + */ + private function addPhpSpreadsheetFolder() + { + // move the phpspreadsheet Folder (TODO we must move this to a library package) + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', + 'path' => '/libraries/phpspreadsheet/', + 'rename' => 0 + ]); + } + } + + /** + * Add Uikit Folders + * + * @return void + * @since 3.2.0 + */ + private function addUikitFolder() + { + $uikit = $this->config->get('uikit', 0); + if (2 == $uikit || 1 == $uikit) + { + // move the UIKIT Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + if (2 == $uikit || 3 == $uikit) + { + // move the UIKIT-3 Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Foo Table Folder + * + * @return void + * @since 3.2.0 + */ + private function addFooTableFolder() + { + if (!$this->config->get('footable', false)) + { + return; + } + + $footable_version = $this->config->get('footable_version', 2); + + if (2 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + elseif (3 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Extra/Dynamic files + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFiles() + { + if ($this->component->isArray('files') || + $this->config->get('google_chart', false)) + { + $this->addGoogleChartFiles(); + } + } + + /** + * Add Google Chart Files + * + * @return void + * @since 3.2.0 + */ + private function addGoogleChartFiles() + { + if ($this->config->get('google_chart', false)) + { + // move the google chart files + $this->component->appendArray('files', [ + 'file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0 + ]); + $this->component->appendArray('files', [ + 'file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0 + ]); + } + } + + /** + * Add Folders + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFolders(object &$versionData) + { + if (!$this->component->isArray('folders')) + { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('folders') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'folder', 'folderpath'] + ); + + // fix custom path + if (isset($custom['path']) + && StringHelper::check($custom['path'])) + { + $custom['path'] = trim((string) $custom['path'], '/'); + } + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path folder + if (!isset($custom['folder']) && isset($custom['folderpath'])) + { + // update the dynamic path + $custom['folderpath'] = $this->dynamicpath->update( + $custom['folderpath'] + ); + + // set the folder path with / if does not have a drive/windows full path + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') + : '/' . trim($custom['folderpath'], '/'); + + // remove the file path + unset($custom['folderpath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we use the correct name + $pathArray = (array) explode('/', (string) $custom['path']); + $lastFolder = end($pathArray); + + // only rename folder if last has folder name + if (isset($custom['rename']) && $custom['rename'] == 1) + { + $custom['path'] = str_replace( + '/' . $lastFolder, '', (string) $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; + } + elseif ('full' === $customPath) + { + // make sure we use the correct name + $folderArray = (array) explode('/', (string) $custom['folder']); + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; + } + else + { + $rename = false; + $newname = ''; + } + + // insure we have no duplicates + $key_pointer = StringHelper::safe( + $custom['folder'] + ) . '_f' . $pointer_tracker; + + $pointer_tracker++; + + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set new folder to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']); + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer}->newName = $newname; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + } + + $this->component->remove('folders'); + } + + /** + * Add Files + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFiles(object &$versionData) + { + if (!$this->component->isArray('files')) { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('files') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'file', 'filepath'] + ); + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path file + if (!isset($custom['file']) && isset($custom['filepath'])) + { + // update the dynamic path + $custom['filepath'] = $this->dynamicpath->update( + $custom['filepath'] + ); + + // set the file path with / if does not have a drive/windows full path + $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); + + // remove the file path + unset($custom['filepath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we have not duplicates + $key_pointer = StringHelper::safe( + $custom['file'] + ) . '_g' . $pointer_tracker; + + $pointer_tracker++; + + // set new file to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']); + + // update the dynamic component name placholders in file names + $custom['path'] = $this->placeholder->update_( + $custom['path'] + ); + + // get the path info + $pathInfo = pathinfo((string) $custom['path']); + if (isset($pathInfo['extension']) && $pathInfo['extension']) + { + $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + } + elseif ('full' === $customPath) + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // get file array + $fileArray = (array) explode('/', (string) $custom['file']); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end($fileArray); + } + else + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = false; + } + + $versionData->move->static->{$key_pointer}->type = 'file'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) + && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + + // check if file should be updated + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) + { + $this->registry->appendArray('files.not.new', $key_pointer); + } + else + { + // update the file content + $this->registry->set('update.file.content.' . $key_pointer, true); + } + } + + $this->component->remove('files'); + } + +} + diff --git a/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json new file mode 100644 index 0000000..233b6b4 --- /dev/null +++ b/src/63dabe82-0f4a-4ade-9851-8518ade23de2/settings.json @@ -0,0 +1,65 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "JoomlaRegistry", + "guid": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Settings", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Settings", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection6": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection7": { + "use": "268b85ef-49f3-4c39-8187-bb12e38d19ee", + "as": "default" + }, + "use_selection8": { + "use": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "as": "default" + }, + "use_selection9": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection10": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection11": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Settings", + "description": "Compiler Component (Joomla Version) Settings\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md b/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md new file mode 100644 index 0000000..2bad66d --- /dev/null +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/README.md @@ -0,0 +1,156 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structuresingle (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Structuresingle #Gold { + # string $newName + # string $currentFullPath + # string $packageFullPath + # string $zipFullPath + # Config $config + # Registry $registry + # Settings $settings + # Component $component + # Content $content + # Counter $counter + # Paths $paths + # Files $files + # CMSApplication $app + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + build() : bool + - doLicenseCheck() : bool + - doReadmeCheck() : bool + - doChangelogCheck() : bool + - setNewName(object $details) : void + - setPaths(object $details) : void + - pathExist(object $details) : bool + - setTarget(string $target, object $details) : void + - moveFile() : void + - registerFile(string $target, object $details) : void + - setDynamicTarget(object $details) : void + - setDynamicFolders() : void +} + +note right of Structuresingle::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Settings $settings = null + ?Component $component = null + ?Content $content = null + ?Counter $counter = null + ?Paths $paths = null + ?Files $files = null + ?CMSApplication $app = null +end note + +note left of Structuresingle::build + Build the Single Files & Folders + + since: 3.2.0 + return: bool +end note + +note right of Structuresingle::doLicenseCheck + Check if license must be added + + since: 3.2.0 + return: bool +end note + +note left of Structuresingle::doReadmeCheck + Check if readme must be added + + since: 3.2.0 + return: bool +end note + +note right of Structuresingle::doChangelogCheck + Check if changelog must be added + + since: 3.2.0 + return: bool +end note + +note left of Structuresingle::setNewName + Set the new name + + since: 3.2.0 + return: void +end note + +note right of Structuresingle::setPaths + Set all needed paths + + since: 3.2.0 + return: void +end note + +note left of Structuresingle::pathExist + Check if path exists + + since: 3.2.0 + return: bool +end note + +note right of Structuresingle::setTarget + Set the target based on target type + + since: 3.2.0 + return: void +end note + +note left of Structuresingle::moveFile + Move/Copy the file into place + + since: 3.2.0 + return: void +end note + +note right of Structuresingle::registerFile + Register the file + + since: 3.2.0 + return: void +end note + +note left of Structuresingle::setDynamicTarget + Set Dynamic Target + + since: 3.2.0 + return: void +end note + +note right of Structuresingle::setDynamicFolders + Add the dynamic folders + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php b/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php new file mode 100644 index 0000000..f9b357d --- /dev/null +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/code.php @@ -0,0 +1,624 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\Folder; +use Joomla\CMS\Filesystem\File; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Content; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Single Files and Folders Builder Class + * + * @since 3.2.0 + */ +class Structuresingle +{ + /** + * The new name + * + * @var string + * @since 3.2.0 + */ + protected string $newName; + + /** + * Current Full Path + * + * @var string + * @since 3.2.0 + */ + protected string $currentFullPath; + + /** + * Package Full Path + * + * @var string + * @since 3.2.0 + */ + protected string $packageFullPath; + + /** + * ZIP Full Path + * + * @var string + * @since 3.2.0 + */ + protected string $zipFullPath; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Application object. + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Settings|null $settings The compiler component Joomla version settings object. + * @param Component|null $component The component class. + * @param Content|null $content The compiler content object. + * @param Counter|null $counter The compiler counter object. + * @param Paths|null $paths The compiler paths object. + * @param Files|null $files The compiler files object. + * @param CMSApplication|null $app The CMS Application object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Settings $settings = null, ?Component $component = null, + ?Content $content = null, ?Counter $counter = null, ?Paths $paths = null, + ?Files $files = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->component = $component ?: Compiler::_('Component'); + $this->content = $content ?: Compiler::_('Content'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Build the Single Files & Folders + * + * @return bool + * @since 3.2.0 + */ + public function build(): bool + { + if ($this->settings->exists()) + { + // TODO needs more looking at this must be dynamic actually + $this->registry->appendArray('files.not.new', 'LICENSE.txt'); + + // do license check + $LICENSE = $this->doLicenseCheck(); + + // do README check + $README = $this->doReadmeCheck(); + + // do CHANGELOG check + $CHANGELOG = $this->doChangelogCheck(); + + // start moving + foreach ($this->settings->single() as $target => $details) + { + // if not gnu/gpl license dont add the LICENSE.txt file + if ($details->naam === 'LICENSE.txt' && !$LICENSE) + { + continue; + } + + // if not needed do not add + if (($details->naam === 'README.md' || $details->naam === 'README.txt') + && !$README) + { + continue; + } + + // if not needed do not add + if ($details->naam === 'CHANGELOG.md' && !$CHANGELOG) + { + continue; + } + + // set new name + $this->setNewName($details); + + // set all paths + $this->setPaths($details); + + // check if the path exists + if ($this->pathExist($details)) + { + // set the target + $this->setTarget($target, $details); + } + + // set dynamic target as needed + $this->setDynamicTarget($details); + } + + return true; + } + + return false; + } + + /** + * Check if license must be added + * + * @return bool + * @since 3.2.0 + */ + private function doLicenseCheck(): bool + { + $licenseChecker = strtolower((string) $this->component->get('license', '')); + + if (strpos($licenseChecker, 'gnu') !== false + && strpos( + $licenseChecker, '2' + ) !== false + && (strpos($licenseChecker, 'gpl') !== false + || strpos( + $licenseChecker, 'General public license' + ) !== false)) + { + return true; + } + + return false; + } + + /** + * Check if readme must be added + * + * @return bool + * @since 3.2.0 + */ + private function doReadmeCheck(): bool + { + return (bool) $this->component->get('addreadme', false); + } + + /** + * Check if changelog must be added + * + * @return bool + * @since 3.2.0 + */ + private function doChangelogCheck(): bool + { + return (bool) $this->component->get('changelog', false); + } + + /** + * Set the new name + * + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setNewName(object $details) + { + // do the file renaming + if (isset($details->rename) && $details->rename) + { + if ($details->rename === 'new') + { + $this->newName = $details->newName; + } + else + { + $this->newName = str_replace( + $details->rename, + $this->config->component_code_name, + (string) $details->naam + ); + } + } + else + { + $this->newName = $details->naam; + } + } + + /** + * Set all needed paths + * + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setPaths(object $details) + { + // check if we have a target value + if (isset($details->_target)) + { + // set destination path + $zipPath = str_replace( + $details->_target['type'] . '/', '', (string) $details->path + ); + $path = str_replace( + $details->_target['type'] . '/', + $this->registry->get('dynamic_paths.' . $details->_target['key'], '') . '/', + (string) $details->path + ); + } + else + { + // set destination path + $zipPath = str_replace('c0mp0n3nt/', '', (string) $details->path); + $path = str_replace( + 'c0mp0n3nt/', $this->paths->component_path . '/', (string) $details->path + ); + } + + // set the template folder path + $templatePath = (isset($details->custom) && $details->custom) + ? (($details->custom !== 'full') ? $this->paths->template_path_custom + . '/' : '') : $this->paths->template_path . '/'; + + // set the final paths + $currentFullPath = (preg_match('/^[a-z]:/i', (string) $details->naam)) ? $details->naam + : $templatePath . '/' . $details->naam; + + $this->currentFullPath = str_replace('//', '/', (string) $currentFullPath); + + $this->packageFullPath = str_replace('//', '/', $path . '/' . $this->newName); + + $this->zipFullPath = str_replace( + '//', '/', $zipPath . '/' . $this->newName + ); + } + + /** + * Check if path exists + * + * @param object $details + * + * @return bool + * @since 3.2.0 + */ + private function pathExist(object $details): bool + { + // check if this has a type + if (!isset($details->type)) + { + return false; + } + // take action based on type + elseif ($details->type === 'file' && !File::exists($this->currentFullPath)) + { + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED', + $this->currentFullPath + ), 'Error' + ); + + return false; + } + elseif ($details->type === 'folder' && !Folder::exists($this->currentFullPath)) + { + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED', + $this->currentFullPath + ), 'Error' + ); + + return false; + } + + return true; + } + + /** + * Set the target based on target type + * + * @param string $target + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setTarget(string $target, object $details) + { + // take action based on type + if ($details->type === 'file') + { + // move the file + $this->moveFile(); + + // register the file + $this->registerFile($target, $details); + } + elseif ($details->type === 'folder') + { + // move the folder to its place + Folder::copy( + $this->currentFullPath, $this->packageFullPath, '', true + ); + + // count the folder created + $this->counter->folder++; + } + } + + /** + * Move/Copy the file into place + * + * @return void + * @since 3.2.0 + */ + private function moveFile() + { + // get base name && get the path only + $packageFullPath0nly = str_replace( + basename($this->packageFullPath), '', $this->packageFullPath + ); + + // check if path exist, if not creat it + if (!Folder::exists($packageFullPath0nly)) + { + Folder::create($packageFullPath0nly); + } + + // move the file to its place + File::copy($this->currentFullPath, $this->packageFullPath); + + // count the file created + $this->counter->file++; + } + + /** + * Register the file + * + * @param string $target + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function registerFile(string $target, object $details) + { + // store the new files + if (!in_array($target, $this->registry->get('files.not.new', []))) + { + if (isset($details->_target)) + { + $this->files->appendArray($details->_target['key'], + [ + 'path' => $this->packageFullPath, + 'name' => $this->newName, + 'zip' => $this->zipFullPath + ] + ); + } + else + { + $this->files->appendArray('static', + [ + 'path' => $this->packageFullPath, + 'name' => $this->newName, + 'zip' => $this->zipFullPath + ] + ); + } + } + + // ensure we update this file if needed + if ($this->registry->exists('update.file.content.' . $target)) + { + // remove the pointer + $this->registry->remove('update.file.content.' . $target); + + // set the full path + $this->registry->set('update.file.content.' . $this->packageFullPath, $this->packageFullPath); + } + } + + /** + * Set Dynamic Target + * + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setDynamicTarget(object $details) + { + // only add if no target found since those belong to plugins and modules + if (!isset($details->_target)) + { + // check if we should add the dynamic folder moving script to the installer script + $checker = array_values((array) explode('/', $this->zipFullPath)); + + // TODO <-- this may not be the best way, will keep an eye on this. + // We basicly only want to check if a folder is added that is not in the stdFolders array + if (isset($checker[0]) + && StringHelper::check($checker[0]) + && !$this->settings->standardFolder($checker[0])) + { + // activate dynamic folders + $this->setDynamicFolders(); + } + elseif (count((array) $checker) == 2 + && StringHelper::check($checker[0])) + { + $add_to_extra = false; + + // set the target + $eNAME = 'FILES'; + $ename = 'filename'; + + // this should not happen and must have been caught by the above if statment + if ($details->type === 'folder') + { + // only folders outside the standard folder are added + $eNAME = 'FOLDERS'; + $ename = 'folder'; + $add_to_extra = true; + } + // if this is a file, it can only be added to the admin/site/media folders + // all other folders are moved as a whole so their files do not need to be declared + elseif ($this->settings->standardFolder($checker[0]) + && !$this->settings->standardRootFile($checker[1])) + { + $add_to_extra = true; + } + + // add if valid folder/file + if ($add_to_extra) + { + // set the tab + $eTab = Indent::_(2); + if ('admin' === $checker[0]) + { + $eTab = Indent::_(3); + } + + // set the xml file + $key_ = 'EXSTRA_' + . StringHelper::safe( + $checker[0], 'U' + ) . '_' . $eNAME; + $this->content->add($key_, + PHP_EOL . $eTab . "<" . $ename . ">" + . $checker[1] . ""); + } + } + } + } + + /** + * Add the dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function setDynamicFolders() + { + // check if we should add the dynamic folder moving script to the installer script + if (!$this->registry->get('set_move_folders_install_script')) + { + // add the setDynamicF0ld3rs() method to the install scipt.php file + $this->registry->set('set_move_folders_install_script', true); + + // set message that this was done (will still add a tutorial link later) + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE'), + 'Notice' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED'), + 'Notice' + ); + } + } + +} + diff --git a/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json b/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json new file mode 100644 index 0000000..5d1b964 --- /dev/null +++ b/src/673954d3-78d3-445a-b99f-4b40d617c882/settings.json @@ -0,0 +1,62 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "673954d3-78d3-445a-b99f-4b40d617c882", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structuresingle", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Structuresingle", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "as": "default" + }, + "use_selection2": { + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection4": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection5": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection6": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection7": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection8": { + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "as": "default" + }, + "use_selection9": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection10": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Structuresingle", + "description": "Single Files and Folders Builder Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Filesystem\\Folder;\r\nuse Joomla\\CMS\\Filesystem\\File;" +} \ No newline at end of file diff --git a/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/README.md b/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/README.md new file mode 100644 index 0000000..9ef200f --- /dev/null +++ b/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Folder (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class Folder #Gold { + # Counter $counter + # File $file + + __construct(?Counter $counter = null, ?File $file = null) + + create(string $path, bool $addHtml = true) : void + + remove(string $path, ?array $ignore = null) : bool +} + +note right of Folder::__construct + Constructor + + since: 3.2.0 +end note + +note right of Folder::create + Create Path if not exist + + since: 3.2.0 + return: void +end note + +note right of Folder::remove + Remove folders with files + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/code.php b/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/code.php new file mode 100644 index 0000000..b59a62d --- /dev/null +++ b/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/code.php @@ -0,0 +1,176 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use Joomla\CMS\Filesystem\Folder as JoomlaFolder; +use Joomla\CMS\Filesystem\File as JoomlaFile; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Folder helper + * + * @since 3.2.0 + */ +class Folder +{ + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Constructor + * + * @param Counter|null $counter The compiler counter object. + * @param File|null $file The compiler file object. + * + * @since 3.2.0 + */ + public function __construct(?Counter $counter = null, ?File $file = null) + { + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->file = $file ?: Compiler::_('Utilities.File'); + } + + /** + * Create Path if not exist + * + * @param string $path The path to folder to create + * @param bool $addHtml The the switch to add the HTML + * + * @return void + * @since 3.2.0 + */ + public function create(string $path, bool $addHtml = true) + { + // check if the path exist + if (!JoomlaFolder::exists($path)) + { + // create the path + JoomlaFolder::create( + $path + ); + + // count the folder created + $this->counter->folder++; + + if ($addHtml) + { + // add index.html (boring I know) + $this->file->html( + $path, '' + ); + } + } + } + + /** + * Remove folders with files + * + * @param string $path The path to folder to remove + * @param array|null $ignore The folders and files to ignore and not remove + * + * @return boolean True if all are removed + * @since 3.2.0 + */ + public function remove(string $path, ?array $ignore = null): bool + { + if (JoomlaFolder::exists($path)) + { + $it = new \RecursiveDirectoryIterator($path); + $it = new \RecursiveIteratorIterator($it, \RecursiveIteratorIterator::CHILD_FIRST); + + // remove ending / + $path = rtrim($path, '/'); + + // now loop the files & folders + foreach ($it as $file) + { + if ('.' === $file->getBasename() || '..' === $file->getBasename()) continue; + + // set file dir + $file_dir = $file->getPathname(); + + // check if this is a dir or a file + if ($file->isDir()) + { + $keeper = false; + if (ArrayHelper::check($ignore)) + { + foreach ($ignore as $keep) + { + if (strpos((string) $file_dir, $path . '/' . $keep) !== false) + { + $keeper = true; + } + } + } + + if ($keeper) + { + continue; + } + + JoomlaFolder::delete($file_dir); + } + else + { + $keeper = false; + if (ArrayHelper::check($ignore)) + { + foreach ($ignore as $keep) + { + if (strpos((string) $file_dir, $path . '/'. $keep) !== false) + { + $keeper = true; + } + } + } + + if ($keeper) + { + continue; + } + + JoomlaFile::delete($file_dir); + } + } + + // delete the root folder if ignore not set + if (!ArrayHelper::check($ignore)) + { + return JoomlaFolder::delete($path); + } + + return true; + } + return false; + } + +} + diff --git a/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/settings.json b/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/settings.json new file mode 100644 index 0000000..60de127 --- /dev/null +++ b/src/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1/settings.json @@ -0,0 +1,34 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Folder", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Folder", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection2": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection3": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Folder", + "description": "Folder helper\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Filesystem\\Folder as JoomlaFolder;\r\nuse Joomla\\CMS\\Filesystem\\File as JoomlaFile;" +} \ No newline at end of file diff --git a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/README.md b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/README.md new file mode 100644 index 0000000..6a443ab --- /dev/null +++ b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/README.md @@ -0,0 +1,60 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structure (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Structure #Gold { + # Settings $settings + # Paths $paths + # Folder $folder + + __construct(?Settings $settings = null, ?Paths $paths = null, ...) + + build() : bool + # folders(object $folders, string $path) : void +} + +note right of Structure::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Settings $settings = null + ?Paths $paths = null + ?Folder $folder = null +end note + +note right of Structure::build + Build the Component Structure + + since: 3.2.0 + return: bool +end note + +note right of Structure::folders + Create the folder and subfolders + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php new file mode 100644 index 0000000..567ca5b --- /dev/null +++ b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/code.php @@ -0,0 +1,118 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Build/Create Component Structure + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Utilities Folder + * + * @var Folder + * @since 3.2.0 + */ + protected Folder $folder; + + /** + * Constructor + * + * @param Settings|null $settings The compiler component joomla version settings object. + * @param Paths|null $paths The compiler paths object. + * @param Folder|null $folder The compiler folder object. + * + * @since 3.2.0 + */ + public function __construct(?Settings $settings = null, ?Paths $paths = null, ?Folder $folder = null) + { + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->folder = $folder ?: Compiler::_('Utilities.Folder'); + } + + /** + * Build the Component Structure + * + * @return bool + * @since 3.2.0 + */ + public function build(): bool + { + if ($this->settings->exists()) + { + // setup the main component path + $this->folder->create($this->paths->component_path); + + // build the version structure + $this->folders( + $this->settings->structure(), + $this->paths->component_path + ); + + return true; + } + + return false; + } + + /** + * Create the folder and subfolders + * + * @param object $folders The object[] of folders + * @param string $path The path + * + * @return void + * @since 3.2.0 + */ + protected function folders(object $folders, string $path) + { + foreach ($folders as $folder => $sub_folders) + { + $new_path = $path . '/' . $folder; + $this->folder->create($new_path); + + if (ObjectHelper::check($sub_folders)) + { + $this->folders($sub_folders, $new_path); + } + } + } + +} + diff --git a/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json new file mode 100644 index 0000000..aa45592 --- /dev/null +++ b/src/6c89c663-78f5-4078-9fac-7047f2eaaf96/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "6c89c663-78f5-4078-9fac-7047f2eaaf96", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structure", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Structure", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "as": "default" + }, + "use_selection2": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection3": { + "use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "as": "default" + }, + "use_selection4": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Structure", + "description": "Build\/Create Component Structure\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/README.md b/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/README.md new file mode 100644 index 0000000..bcb1508 --- /dev/null +++ b/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface ExtractorInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode** +```uml +@startuml +interface ExtractorInterface #Lavender { + + run() : void +} + +note right of ExtractorInterface::run + get the custom code from the local files + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/code.php b/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/code.php new file mode 100644 index 0000000..dcbd15a --- /dev/null +++ b/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/code.php @@ -0,0 +1,30 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; + + +/** + * Customcode Extractor Interface + * + * @since 3.2.0 + */ +interface ExtractorInterface +{ + /** + * get the custom code from the local files + * + * @return void + * @since 3.2.0 + */ + public function run(); +} + diff --git a/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/settings.json b/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/settings.json new file mode 100644 index 0000000..c8b00d6 --- /dev/null +++ b/src/6da2afa5-6087-46dd-80a0-74c6434bcb18/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "6da2afa5-6087-46dd-80a0-74c6434bcb18", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "ExtractorInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Customcode.ExtractorInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Customcode.ExtractorInterface", + "description": "Customcode Extractor Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/README.md b/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/README.md new file mode 100644 index 0000000..ec92ec5 --- /dev/null +++ b/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Historyadminview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Historyadminview #Gold { + # Config $config + # HistoryInterface $history + # Updatesql $updatesql + + __construct(?Config $config = null, ?HistoryInterface $history = null, ...) + + set(object $item) : void +} + +note right of Historyadminview::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?HistoryInterface $history = null + ?Updatesql $updatesql = null +end note + +note right of Historyadminview::set + check if an update SQL is needed + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/code.php b/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/code.php new file mode 100644 index 0000000..d85d087 --- /dev/null +++ b/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/code.php @@ -0,0 +1,126 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Admin View History Class + * + * @since 3.2.0 + */ +class Historyadminview +{ + /** + * The compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler history + * + * @var HistoryInterface + * @since 3.2.0 + */ + protected HistoryInterface $history; + + /** + * The compiler update sql + * + * @var Updatesql + * @since 3.2.0 + */ + protected Updatesql $updatesql; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param HistoryInterface|null $history The compiler history object. + * @param Updatesql|null $updatesql The compiler updatesql object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?HistoryInterface $history = null, + ?Updatesql $updatesql = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->history = $history ?: Compiler::_('History'); + $this->updatesql = $updatesql ?: Compiler::_('Model.Updatesql'); + } + + /** + * check if an update SQL is needed + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + if (($old = $this->history->get('admin_view', $item->id)) !== null) + { + // check if the view name changed + if (StringHelper::check($old->name_single)) + { + $this->updatesql->set( + StringHelper::safe( + $old->name_single + ), $item->name_single_code, 'table_name', + $item->name_single_code + ); + } + + // loop the mysql table settings + foreach ($this->config->mysql_table_keys as $mysql_table_key => $mysql_table_val) + { + // check if the table engine changed + if (isset($old->{'mysql_table_' . $mysql_table_key}) + && isset($item->{'mysql_table_' . $mysql_table_key})) + { + $this->updatesql->set( + $old->{'mysql_table_' . $mysql_table_key}, + $item->{'mysql_table_' . $mysql_table_key}, + 'table_' . $mysql_table_key, $item->name_single_code + ); + } + // check if there is no history on table engine, and it changed from the default/global + elseif (isset($item->{'mysql_table_' . $mysql_table_key}) + && StringHelper::check( + $item->{'mysql_table_' . $mysql_table_key} + ) + && !is_numeric( + $item->{'mysql_table_' . $mysql_table_key} + )) + { + $this->updatesql->set( + $mysql_table_val['default'], + $item->{'mysql_table_' . $mysql_table_key}, + 'table_' . $mysql_table_key, $item->name_single_code + ); + } + } + } + } + +} + diff --git a/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/settings.json b/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/settings.json new file mode 100644 index 0000000..8a1db0f --- /dev/null +++ b/src/6dfbf568-f3cd-4ea7-af04-6859447b5462/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "6dfbf568-f3cd-4ea7-af04-6859447b5462", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Historyadminview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Historyadminview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "4325745f-da1f-4d4d-a591-3189fe8c06e5", + "as": "default" + }, + "use_selection3": { + "use": "b80296eb-4718-4ed3-894d-69f3ac293733", + "as": "default" + }, + "use_selection4": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Historyadminview", + "description": "Model Admin View History Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/6e64917c-d687-4ef3-a655-811319f5a81e/README.md b/src/6e64917c-d687-4ef3-a655-811319f5a81e/README.md new file mode 100644 index 0000000..c652b6b --- /dev/null +++ b/src/6e64917c-d687-4ef3-a655-811319f5a81e/README.md @@ -0,0 +1,118 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Autoloader (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power** +```uml +@startuml +class Autoloader #Gold { + # Power $power + # Config $config + # Content $content + # string $helper + + __construct(?Power $power = null, ?Config $config = null, ...) + + set() : void + - loadPluginAutoloader() : bool + - loadHelperAutoloader() : bool + - loadSiteAutoloader() : bool + - getPluginAutoloader() : string + - getHelperAutoloader() : string + - getBLockSiteLoading() : ?string + - getAutoloader(int $tabSpace) : ?string + - getComposer(int $tabSpace) : ?string +} + +note right of Autoloader::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Power $power = null + ?Config $config = null + ?Content $content = null +end note + +note left of Autoloader::set + Set the autoloader into the active content array + + since: 3.2.0 + return: void +end note + +note right of Autoloader::loadPluginAutoloader + Should we load the plugin autoloader + + since: 3.2.0 + return: bool +end note + +note left of Autoloader::loadHelperAutoloader + Should we load the helper class autoloader + + since: 3.2.0 + return: bool +end note + +note right of Autoloader::loadSiteAutoloader + Should we load the autoloader in site area + + since: 3.2.0 + return: bool +end note + +note left of Autoloader::getPluginAutoloader + Get helper autoloader code + + since: 3.2.0 + return: string +end note + +note right of Autoloader::getHelperAutoloader + Get helper autoloader code + + since: 3.2.0 + return: string +end note + +note left of Autoloader::getBLockSiteLoading + Get code that will block the plugin from loading +the autoloader in the site area + + since: 3.2.0 + return: ?string +end note + +note right of Autoloader::getAutoloader + Get autoloader code + + since: 3.2.0 + return: ?string +end note + +note left of Autoloader::getComposer + Get the composer autoloader routine + + since: 3.2.0 + return: ?string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php b/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php new file mode 100644 index 0000000..b27af38 --- /dev/null +++ b/src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php @@ -0,0 +1,414 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Power; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Content; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Compiler Autoloader + * + * @since 3.2.0 + */ +class Autoloader +{ + /** + * Power Objects + * + * @var Power + * @since 3.2.0 + **/ + protected Power $power; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Helper Class Autoloader + * + * @var string + * @since 3.2.0 + **/ + protected string $helper = ''; + + /** + * Constructor. + * + * @param Power|null $power The power object. + * @param Config|null $config The compiler config object. + * @param Content|null $content The compiler content object. + * + * @since 3.2.0 + */ + public function __construct(?Power $power = null, ?Config $config = null, ?Content $content = null) + { + $this->power = $power ?: Compiler::_('Power'); + $this->config = $config ?: Compiler::_('Config'); + $this->content = $content ?: Compiler::_('Content'); + + // reset all autoloaders power placeholders + $this->content->set('ADMIN_POWER_HELPER', ''); + $this->content->set('SITE_POWER_HELPER', ''); + $this->content->set('CUSTOM_POWER_AUTOLOADER', ''); + } + + /** + * Set the autoloader into the active content array + * + * @return void + * @since 3.2.0 + */ + public function set() + { + if (ArrayHelper::check($this->power->namespace)) + { + /************************* IMPORTANT SORT NOTICE *********************************************** + * make sure the name space values are sorted from the longest string to the shortest + * so that the search do not mistakenly match a shorter namespace before a longer one + * that has the same short namespace for example: + * NameSpace\SubName\Sub <- will always match first + * NameSpace\SubName\SubSubName + * Should the shorter namespace be listed [first] it will match both of these: + * NameSpace\SubName\Sub\ClassName + * ^^^^^^^^^^^^^^^^^^^^^^ + * NameSpace\SubName\SubSubName\ClassName + * ^^^^^^^^^^^^^^^^^^^^^^ + ***********************************************************************************************/ + uksort($this->power->namespace, fn($a, $b) => strlen((string) $b) - strlen((string) $a)); + + // check if we are using a plugin + if ($this->loadPluginAutoloader()) + { + $this->content->set('PLUGIN_POWER_AUTOLOADER', $this->getPluginAutoloader()); + } + + // load to the helper class + if ($this->loadHelperAutoloader()) + { + // load to admin helper class + $this->content->add('ADMIN_POWER_HELPER', $this->getHelperAutoloader()); + + // load to site helper class if needed + if ($this->loadSiteAutoloader()) + { + $this->content->add('SITE_POWER_HELPER', $this->getHelperAutoloader()); + } + } + + // to add to custom files + $this->content->add('CUSTOM_POWER_AUTOLOADER', $this->getHelperAutoloader()); + } + } + + /** + * Should we load the plugin autoloader + * + * @return bool + * @since 3.2.0 + */ + private function loadPluginAutoloader(): bool + { + return $this->content->exist('PLUGIN_POWER_AUTOLOADER'); + } + + /** + * Should we load the helper class autoloader + * + * @return bool + * @since 3.2.0 + */ + private function loadHelperAutoloader(): bool + { + // for now we load it if the plugin is not loaded + // but we may want to add a switch that + // controls this behaviour. + return !$this->loadPluginAutoloader(); + } + + /** + * Should we load the autoloader in site area + * + * @return bool + * @since 3.2.0 + */ + private function loadSiteAutoloader(): bool + { + return (!$this->config->remove_site_folder || !$this->config->remove_site_edit_folder); + } + + /** + * Get helper autoloader code + * + * @return string + * @since 3.2.0 + */ + private function getPluginAutoloader(): string + { + // load the code + $code = []; + + // if we should not load in the site are + if (($script = $this->getBLockSiteLoading()) !== null) + { + $code[] = $script; + } + + // add the composer stuff here + if (($script = $this->getComposer(2)) !== null) + { + $code[] = $script; + } + + // get the helper autoloader + if (($script = $this->getAutoloader(2)) !== null) + { + $code[] = $script; + } + + // if we have any + if (!empty($code)) + { + return PHP_EOL . PHP_EOL . implode(PHP_EOL . PHP_EOL, $code); + } + + return ''; + } + + /** + * Get helper autoloader code + * + * @return string + * @since 3.2.0 + */ + private function getHelperAutoloader(): string + { + // check if it was already build + if (!empty($this->helper)) + { + return $this->helper; + } + + // load the code + $code = []; + + // add the composer stuff here + if (($script = $this->getComposer(0)) !== null) + { + $code[] = $script; + } + + // get the helper autoloader + if (($script = $this->getAutoloader(0)) !== null) + { + $code[] = $script; + } + + // if we have any + if (!empty($code)) + { + $this->helper = PHP_EOL . PHP_EOL . implode(PHP_EOL . PHP_EOL, $code); + } + + return $this->helper; + } + + /** + * Get code that will block the plugin from loading + * the autoloader in the site area + * + * @return string|null + * @since 3.2.0 + */ + private function getBLockSiteLoading(): ?string + { + // if we should not load in the site are + if (!$this->loadSiteAutoloader()) + { + // we add code to prevent this plugin from triggering on the site area + $not_site = []; + $not_site[] = Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' do not run the autoloader in the site area'; + $not_site[] = Indent::_(2) . 'if ($this->app->isClient(\'site\'))'; + $not_site[] = Indent::_(2) . '{'; + $not_site[] = Indent::_(3) . 'return;'; + $not_site[] = Indent::_(2) . '}'; + + return implode(PHP_EOL, $not_site); + } + + return null; + } + + /** + * Get autoloader code + * + * @param int $tabSpace The dynamic tab spacer + * + * @return string|null + * @since 3.2.0 + */ + private function getAutoloader(int $tabSpace): ?string + { + if (($size = ArrayHelper::check($this->power->namespace)) > 0) + { + // we start building the spl_autoload_register function call + $autoload_method = []; + $autoload_method[] = Indent::_($tabSpace) . '//' + . Line::_(__Line__, __Class__) . ' register this component namespace'; + $autoload_method[] = Indent::_($tabSpace) . 'spl_autoload_register(function ($class) {'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$search = ['; + + // counter to manage the comma in the actual array + $counter = 1; + foreach ($this->power->namespace as $base_dir => $prefix) + { + // don't add the ending comma on last value + if ($size == $counter) + { + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + } + else + { + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + } + $counter++; + } + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '];'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// Start the search and load if found'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found = false;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found_base_dir = "";'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found_len = 0;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '$len = strlen($prefix);'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' we have a match so load the values'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found = true;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found_base_dir = $base_dir;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found_len = $len;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' done here'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . 'break;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '}'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; + + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' check if we found a match'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'if (!$found)'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; + + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' not found so move to the next registered autoloader'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'return;'; + + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; + + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' get the relative class name'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// with .php'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' if the file exists, require it'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'if (file_exists($file))'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'require $file;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; + $autoload_method[] = Indent::_($tabSpace) . '});'; + + return implode(PHP_EOL, $autoload_method); + } + + return null; + } + + /** + * Get the composer autoloader routine + * + * @param int $tabSpace The dynamic tab spacer + * + * @return string|null + * @since 3.2.0 + */ + private function getComposer(int $tabSpace): ?string + { + if (ArrayHelper::check($this->power->composer)) + { + // load the composer routine + $composer_routine = []; + + // counter to manage the comma in the actual array + $add_once = []; + foreach ($this->power->composer as $access_point) + { + // don't add the ending comma on last value + if (empty($add_once[$access_point])) + { + $composer_routine[] = Indent::_($tabSpace) . "\$composer_autoloader = JPATH_LIBRARIES . '/$access_point';"; + $composer_routine[] = Indent::_($tabSpace) . 'if (file_exists($composer_autoloader))'; + $composer_routine[] = Indent::_($tabSpace) . "{"; + $composer_routine[] = Indent::_($tabSpace) . Indent::_(1) . 'require_once $composer_autoloader;'; + $composer_routine[] = Indent::_($tabSpace) . "}"; + + $add_once[$access_point] = true; + } + } + + // this is just about the [autoloader or autoloaders] in the comment ;) + if (count($add_once) == 1) + { + array_unshift($composer_routine, Indent::_($tabSpace) . '//' + . Line::_(__Line__, __Class__) . ' add the autoloader for the composer classes'); + } + else + { + array_unshift($composer_routine, Indent::_($tabSpace) . '//' + . Line::_(__Line__, __Class__) . ' add the autoloaders for the composer classes'); + } + + return implode(PHP_EOL, $composer_routine); + } + + return null; + } + +} + diff --git a/src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json b/src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json new file mode 100644 index 0000000..ca72f6f --- /dev/null +++ b/src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json @@ -0,0 +1,45 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "6e64917c-d687-4ef3-a655-811319f5a81e", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Autoloader", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Autoloader", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "as": "default" + }, + "use_selection2": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection3": { + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + }, + "use_selection4": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection5": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection6": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Autoloader", + "description": "Compiler Autoloader\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/6f20369a-8536-4870-a1a3-cda254c939c8/README.md b/src/6f20369a-8536-4870-a1a3-cda254c939c8/README.md new file mode 100644 index 0000000..d8249fb --- /dev/null +++ b/src/6f20369a-8536-4870-a1a3-cda254c939c8/README.md @@ -0,0 +1,102 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Paths (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class Paths #Gold { + # Config $config + # Component $component + + __construct(?Config $config = null, ?Component $component = null) + + __get(string $key) : string + # key(string $key) : string + - setTemplatePath() : void + - setComponentSalesName() : void + - setComponentBackupName() : void + - setComponentFolderName() : void + - setComponentPath() : void + - setTemplatePathCustom() : void +} + +note right of Paths::__construct + Constructor + + since: 3.2.0 +end note + +note left of Paths::__get + getting any valid paths + + since: 3.2.0 + return: string +end note + +note right of Paths::key + Model the key + + since: 3.2.0 + return: string +end note + +note left of Paths::setTemplatePath + Set the template path + + since: 3.2.0 + return: void +end note + +note right of Paths::setComponentSalesName + Set component sales name + + since: 3.2.0 + return: void +end note + +note left of Paths::setComponentBackupName + Set component backup name + + since: 3.2.0 + return: void +end note + +note right of Paths::setComponentFolderName + Set component folder name + + since: 3.2.0 + return: void +end note + +note left of Paths::setComponentPath + Set component path + + since: 3.2.0 + return: void +end note + +note right of Paths::setTemplatePathCustom + set the template path for custom TODO: just use custom_folder_path in config + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php b/src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php new file mode 100644 index 0000000..9104dda --- /dev/null +++ b/src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php @@ -0,0 +1,204 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Interfaces\Mappersingleinterface; +use VDM\Joomla\Componentbuilder\Abstraction\MapperSingle; + + +/** + * Compiler Utilities Paths + * + * @since 3.2.0 + */ +class Paths extends MapperSingle implements Mappersingleinterface +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Component|null $component The component class. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Component $component = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->component = $component ?: Compiler::_('Component'); + + // set the template path + $this->setTemplatePath(); + + // set component sales name + $this->setComponentSalesName(); + + // set component backup name + $this->setComponentBackupName(); + + // set component folder name + $this->setComponentFolderName(); + + // set component path + $this->setComponentPath(); + + // set the template path for custom + $this->setTemplatePathCustom(); + } + + /** + * getting any valid paths + * + * @param string $key The value's key/path name + * + * @return string The path found as a string + * @since 3.2.0 + * @throws \InvalidArgumentException If $key is not a valid function name. + */ + public function __get(string $key): string + { + // check if it has been set + if ($this->exist($key)) + { + return $this->get($key); + } + + throw new \InvalidArgumentException(sprintf('Path %s could not be found in the Paths Class.', $key)); + } + + /** + * Model the key + * + * @param string $key The key to model + * + * @return string + * @since 3.2.0 + */ + protected function key(string $key): string + { + return $key; + } + + /** + * Set the template path + * + * @return void + * + * @since 3.2.0 + */ + private function setTemplatePath(): void + { + $this->set('template_path', + $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_' + . $this->config->joomla_versions[$this->config->joomla_version]['folder_key'] + ); + } + + /** + * Set component sales name + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentSalesName(): void + { + $this->set('component_sales_name', + 'com_' . $this->component->get('sales_name') . '__J' + . $this->config->joomla_version + ); + } + + /** + * Set component backup name + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentBackupName(): void + { + $this->set('component_backup_name', + 'com_' . $this->component->get('sales_name') . '_v' . str_replace( + '.', '_', (string) $this->component->get('component_version') + ) . '__J' . $this->config->joomla_version + ); + } + + /** + * Set component folder name + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentFolderName(): void + { + $this->set('component_folder_name', + 'com_' . $this->component->get('name_code') . '_v' . str_replace( + '.', '_', (string) $this->component->get('component_version') + ) . '__J' . $this->config->joomla_version + ); + } + + /** + * Set component path + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentPath(): void + { + $this->set('component_path', + $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + . $this->get('component_folder_name') + ); + } + + /** + * set the template path for custom TODO: just use custom_folder_path in config + * + * @return void + * + * @since 3.2.0 + */ + private function setTemplatePathCustom(): void + { + $this->set('template_path_custom', + $this->config->get( + 'custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom' + ) + ); + } + +} + diff --git a/src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json b/src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json new file mode 100644 index 0000000..cede047 --- /dev/null +++ b/src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "extends": "c6bbc3ee-58e7-4463-adba-5c5ae839ee36", + "extends_custom": "JoomlaRegistry", + "guid": "6f20369a-8536-4870-a1a3-cda254c939c8", + "implements": [ + "78527c29-24ad-4735-ad4c-ec33a4952d9b" + ], + "implements_custom": "", + "load_selection": null, + "name": "Paths", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Paths", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Paths", + "description": "Compiler Utilities Paths\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md new file mode 100644 index 0000000..c1a839f --- /dev/null +++ b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/README.md @@ -0,0 +1,60 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Library** +```uml +@startuml +class Data #Gold { + # Config $config + # Registry $registry + # Customcode $customcode + # Gui $gui + # FieldData $field + # Filesfolders $filesFolders + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + get(int $id) : object|bool +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Customcode $customcode = null + ?Gui $gui = null + ?FieldData $field = null + ?Filesfolders $filesFolders = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get Media Library Data and store globally in registry + + since: 3.2.0 + return: object|bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php new file mode 100644 index 0000000..ab27101 --- /dev/null +++ b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/code.php @@ -0,0 +1,356 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Library; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Field\Data as FieldData; +use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Library Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Field Data + * + * @var FieldData + * @since 3.2.0 + */ + protected FieldData $field; + + /** + * Compiler Files Folders + * + * @var Filesfolders + * @since 3.2.0 + */ + protected Filesfolders $filesFolders; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param FieldData|null $field The compiler field data object. + * @param Filesfolders|null $filesFolders The compiler files folders object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Customcode $customcode = null, ?Gui $gui = null, + ?FieldData $field = null, ?Filesfolders $filesFolders = null, + ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->field = $field ?: Compiler::_('Field.Data'); + $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get Media Library Data and store globally in registry + * + * @param int $id the library id + * + * @return object|bool object on success + * @since 3.2.0 + */ + public function get(int $id) + { + // check if the lib has already been set + if (!$this->registry->exists("builder.libraries.$id")) + { + // get some switches + $uikit = $this->config->get('uikit', 0); + $footable_version = $this->config->get('footable_version', 0); + + // make sure we should continue and that the lib is not already being loaded + switch ($id) + { + case 1: // No Library + return false; + break; + case 3: // Uikit v3 + if (2 == $uikit || 3 == $uikit) + { + // already being loaded + $this->registry->set("builder.libraries.$id", false); + } + break; + case 4: // Uikit v2 + if (2 == $uikit || 1 == $uikit) + { + // already being loaded + $this->registry->set("builder.libraries.$id", false); + } + break; + case 5: // FooTable v2 + if (2 == $footable_version) + { + // already being loaded + $this->registry->set("builder.libraries.$id", false); + } + break; + case 6: // FooTable v3 + if (3 == $footable_version) + { + // already being loaded + $this->registry->set("builder.libraries.$id", false); + } + break; + } + } + + // check if the lib has already been set + if (!$this->registry->exists("builder.libraries.$id")) + { + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'a.id', + 'a.name', + 'a.how', + 'a.type', + 'a.addconditions', + 'b.addconfig', + 'c.addfiles', + 'c.addfolders', + 'c.addfilesfullpath', + 'c.addfoldersfullpath', + 'c.addurls', + 'a.php_setdocument' + ), array( + 'id', + 'name', + 'how', + 'type', + 'addconditions', + 'addconfig', + 'addfiles', + 'addfolders', + 'addfilesfullpath', + 'addfoldersfullpath', + 'addurls', + 'php_setdocument' + ) + ) + ); + + // from these tables + $query->from('#__componentbuilder_library AS a'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_library_config', 'b') + . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('b.library') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_library_files_folders_urls', 'c' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('c.library') . ')' + ); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $query->where($this->db->quoteName('a.target') . ' = 1'); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + + // Load the results as a list of stdClass objects + $library = $this->db->loadObject(); + + // check if this lib uses build-in behaviour + if ($library->how == 4) + { + // fall back on build-in features + $buildin = [ + 3 => ['uikit' => 3], + 4 => ['uikit' => 1], + 5 => ['footable_version' => 2, 'footable' => true], + 6 => ['footable_version' => 3, 'footable' => true] + ]; + + if (isset($buildin[$library->id]) + && ArrayHelper::check( + $buildin[$library->id] + )) + { + // set the lib switch + foreach ($buildin[$library->id] as $lib => $val) + { + // ---- we are targeting these ---- + // $this->config->uikit + // $this->config->footable_version + // $this->config->footable + $this->config->set($lib, $val); + } + // since we are falling back on build-in feature + $library->how = 0; + } + else + { + // since we did not find build in behaviour we must load always. + $library->how = 1; + } + } + + // check if this lib has dynamic behaviour + if ($library->how > 0) + { + // set files and folders + $this->filesFolders->set($library); + + // add config fields only if needed + if ($library->how > 1) + { + // set the config data + $library->addconfig = (isset($library->addconfig) + && JsonHelper::check( + $library->addconfig + )) ? json_decode((string) $library->addconfig, true) : null; + + if (ArrayHelper::check($library->addconfig)) + { + $library->config = array_map( + function ($array) { + $array['alias'] = 0; + $array['title'] = 0; + $array['settings'] = $this->field->get( + $array['field'] + ); + + return $array; + }, array_values($library->addconfig) + ); + } + } + // if this lib is controlled by custom script + if (3 == $library->how) + { + // set Needed PHP + if (isset($library->php_setdocument) + && StringHelper::check( + $library->php_setdocument + )) + { + $library->document = $this->gui->set( + $this->customcode->update( + base64_decode((string) $library->php_setdocument) + ), + array( + 'table' => 'library', + 'field' => 'php_setdocument', + 'id' => (int) $id, + 'type' => 'php') + ); + } + } + // if this lib is controlled by conditions + elseif (2 == $library->how) + { + // set the addconditions data + $library->addconditions = (isset($library->addconditions) + && JsonHelper::check( + $library->addconditions + )) ? json_decode((string) $library->addconditions, true) : null; + + if (ArrayHelper::check( + $library->addconditions + )) + { + $library->conditions = array_values( + $library->addconditions + ); + } + } + + unset($library->php_setdocument); + unset($library->addconditions); + unset($library->addconfig); + + // load to global lib + $this->registry->set("builder.libraries.$id", $library); + } + else + { + $this->registry->set("builder.libraries.$id", false); + } + } + + // if set return + return $this->registry->get("builder.libraries.$id", false); + } + +} + diff --git a/src/7175c1cd-2071-4cd7-b499-23881e168c3f/settings.json b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/settings.json new file mode 100644 index 0000000..f5772d6 --- /dev/null +++ b/src/7175c1cd-2071-4cd7-b499-23881e168c3f/settings.json @@ -0,0 +1,58 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "7175c1cd-2071-4cd7-b499-23881e168c3f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Library.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection4": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection5": { + "use": "ce826b66-0f2d-43da-8005-41b8e4cb21ee", + "as": "FieldData" + }, + "use_selection6": { + "use": "f4578c04-a81e-4218-b80d-b0612196eaf0", + "as": "default" + }, + "use_selection7": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection8": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection9": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Library.Data", + "description": "Library Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md b/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md new file mode 100644 index 0000000..02ae935 --- /dev/null +++ b/src/766a9524-37df-4604-91a7-b98a6150ee26/README.md @@ -0,0 +1,81 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin** +```uml +@startuml +class Data #Gold { + # array $data + # Config $config + # Customcode $customcode + # Gui $gui + # Placeholder $placeholder + # Language $language + # Field $field + # FieldName $fieldName + # Filesfolders $filesFolders + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Customcode $customcode = null, ...) + + get(int $id = null) : object|array|null + + exists(int $id = null) : bool + + set(int $id) : bool +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Placeholder $placeholder = null + ?Language $language = null + ?Field $field = null + ?FieldName $fieldName = null + ?Filesfolders $filesFolders = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get the Joomla Plugin/s + + since: 3.2.0 + return: object|array|null +end note + +note right of Data::exists + Check if the Joomla Plugin/s exists + + since: 3.2.0 + return: bool +end note + +note right of Data::set + Set the Joomla Plugin + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php b/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php new file mode 100644 index 0000000..29b92a5 --- /dev/null +++ b/src/766a9524-37df-4604-91a7-b98a6150ee26/code.php @@ -0,0 +1,881 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Filter\OutputFilter; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Field; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\PluginHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; + + +/** + * Joomla Plugin Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Joomla Plugins Data + * + * @var array + * @since 3.2.0 + */ + protected array $data = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Compiler Field + * + * @var Field + * @since 3.2.0 + */ + protected Field $field; + + /** + * Compiler field name + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldName; + + /** + * Compiler Files Folders + * + * @var Filesfolders + * @since 3.2.0 + */ + protected Filesfolders $filesFolders; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Language|null $language The compiler Language object. + * @param Field|null $field The compiler field data object. + * @param FieldName|null $fieldName The compiler field name object. + * @param Filesfolders|null $filesFolders The compiler files folders object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Customcode $customcode = null, + ?Gui $gui = null, ?Placeholder $placeholder = null, + ?Language $language = null, ?Field $field = null, ?FieldName $fieldName = null, + ?Filesfolders $filesFolders = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->language = $language ?: Compiler::_('Language'); + $this->field = $field ?: Compiler::_('Field'); + $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); + $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get the Joomla Plugin/s + * + * @param int|null $id the plugin id + * + * @return object|array|null if ID found it returns object, if no ID given it returns all set + * @since 3.2.0 + */ + public function get(int $id = null) + { + if (is_null($id) && $this->exists()) + { + return $this->data; + } + elseif ($this->exists($id)) + { + return $this->data[$id]; + } + + return null; + } + + /** + * Check if the Joomla Plugin/s exists + * + * @param int|null $id the plugin id + * + * @return bool if ID found it returns true, if no ID given it returns true if any are set + * @since 3.2.0 + */ + public function exists(int $id = null): bool + { + if (is_null($id)) + { + return ArrayHelper::check($this->data); + } + elseif (isset($this->data[$id])) + { + return true; + } + + return $this->set($id); + } + + /** + * Set the Joomla Plugin + * + * @param int $id the plugin id + * + * @return bool true on success + * @since 3.2.0 + */ + public function set(int $id): bool + { + if (isset($this->data[$id])) + { + return true; + } + else + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'g.name', + 'e.name', + 'e.head', + 'e.comment', + 'e.id', + 'f.addfiles', + 'f.addfolders', + 'f.addfilesfullpath', + 'f.addfoldersfullpath', + 'f.addurls', + 'u.version_update', + 'u.id' + ), array( + 'group', + 'extends', + 'class_head', + 'comment', + 'class_id', + 'addfiles', + 'addfolders', + 'addfilesfullpath', + 'addfoldersfullpath', + 'addurls', + 'version_update', + 'version_update_id' + ) + ) + ); + // from these tables + $query->from('#__componentbuilder_joomla_plugin AS a'); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_group', 'g' + ) . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') + . ' = ' . $this->db->quoteName('g.id') . ')' + ); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_class_extends', 'e') + . ' ON (' . $this->db->quoteName('a.class_extends') . ' = ' + . $this->db->quoteName('e.id') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_updates', 'u' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('u.joomla_plugin') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_files_folders_urls', 'f' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('f.joomla_plugin') . ')' + ); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $query->where($this->db->quoteName('a.published') . ' >= 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // get the plugin data + $plugin = $this->db->loadObject(); + + // tweak system to set stuff to the plugin domain + $_backup_target = $this->config->build_target; + $_backup_lang = $this->config->lang_target; + $_backup_langPrefix = $this->config->lang_prefix; + + // set some keys + $plugin->target_type = 'P|uG!n'; + $plugin->key = $plugin->id . '_' . $plugin->target_type; + + // update to point to plugin + $this->config->build_target = $plugin->key; + $this->config->lang_target = $plugin->key; + + // set version if not set + if (empty($plugin->plugin_version)) + { + $plugin->plugin_version = '1.0.0'; + } + + // set GUI mapper + $guiMapper = array('table' => 'joomla_plugin', + 'id' => (int) $id, 'type' => 'php'); + + // update the name if it has dynamic values + $plugin->name = $this->placeholder->update_( + $this->customcode->update($plugin->name) + ); + + // update the name if it has dynamic values + $plugin->code_name + = ClassfunctionHelper::safe( + $plugin->name + ); + + // set official name + $plugin->official_name = ucwords( + $plugin->group . ' - ' . $plugin->name + ); + + // set lang prefix + $plugin->lang_prefix = PluginHelper::safeLangPrefix( + $plugin->code_name, + $plugin->group + ); + + // set langPrefix + $this->config->lang_prefix = $plugin->lang_prefix; + + // set plugin class name + $plugin->class_name + = PluginHelper::safeClassName( + $plugin->code_name, + $plugin->group + ); + + // set plugin install class name + $plugin->installer_class_name + = PluginHelper::safeInstallClassName( + $plugin->code_name, + $plugin->group + ); + + // set plugin folder name + $plugin->folder_name + = PluginHelper::safeFolderName( + $plugin->code_name, + $plugin->group + ); + + // set the zip name + $plugin->zip_name = $plugin->folder_name . '_v' . str_replace( + '.', '_', (string) $plugin->plugin_version + ) . '__J' . $this->config->joomla_version; + + // set plugin file name + $plugin->file_name = strtolower((string) $plugin->code_name); + + // set plugin context + $plugin->context = $plugin->folder_name . '.' . $plugin->id; + + // set official_name lang strings + $this->language->set( + $plugin->key, $this->config->lang_prefix, $plugin->official_name + ); + + // set some placeholder for this plugin + $this->placeholder->set('Plugin_name', $plugin->official_name); + $this->placeholder->set('PLUGIN_NAME', $plugin->official_name); + $this->placeholder->set('Plugin', ucfirst((string) $plugin->code_name)); + $this->placeholder->set('plugin', strtolower((string) $plugin->code_name)); + $this->placeholder->set('Plugin_group', ucfirst((string) $plugin->group)); + $this->placeholder->set('plugin_group', strtolower((string) $plugin->group)); + $this->placeholder->set('plugin.version', $plugin->plugin_version); + $this->placeholder->set('VERSION', $plugin->plugin_version); + $this->placeholder->set('plugin_version', str_replace( + '.', '_', (string) $plugin->plugin_version + )); + + // set description + $this->placeholder->set('DESCRIPTION', ''); + if (!isset($plugin->description) + || !StringHelper::check( + $plugin->description + )) + { + $plugin->description = ''; + } + else + { + $plugin->description = $this->placeholder->update_( + $this->customcode->update($plugin->description) + ); + $this->language->set( + $plugin->key, $plugin->lang_prefix . '_DESCRIPTION', + $plugin->description + ); + // set description + $this->placeholder->set('DESCRIPTION', $plugin->description); + $plugin->description = '

' . $plugin->description . '

'; + } + + // get author name + $project_author = $this->config->project_author; + + // we can only set these if the component was passed + $plugin->xml_description = "

" . $plugin->official_name + . " (v." . $plugin->plugin_version + . ")

" + . $plugin->description . "

Created by " . trim( + (string) OutputFilter::cleanText($project_author) + ) . "
Development started " + . Factory::getDate($plugin->created)->format("jS F, Y") + . "

"; + + // set xml discription + $this->language->set( + $plugin->key, $plugin->lang_prefix . '_XML_DESCRIPTION', + $plugin->xml_description + ); + + // update the readme if set + if ($plugin->addreadme == 1 && !empty($plugin->readme)) + { + $plugin->readme = $this->placeholder->update_( + $this->customcode->update(base64_decode((string) $plugin->readme)) + ); + } + else + { + $plugin->addreadme = 0; + unset($plugin->readme); + } + + // open some base64 strings + if (!empty($plugin->main_class_code)) + { + // set GUI mapper field + $guiMapper['field'] = 'main_class_code'; + // base64 Decode main_class_code. + $plugin->main_class_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $plugin->main_class_code) + ) + ), + $guiMapper + ); + } + + // set the head :) + if ($plugin->add_head == 1 && !empty($plugin->head)) + { + // set GUI mapper field + $guiMapper['field'] = 'head'; + // base64 Decode head. + $plugin->head = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $plugin->head) + ) + ), + $guiMapper + ); + } + elseif (!empty($plugin->class_head)) + { + // base64 Decode head. + $plugin->head = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $plugin->class_head) + ) + ), + array( + 'table' => 'class_extends', + 'field' => 'head', + 'id' => (int) $plugin->class_id, + 'type' => 'php') + ); + } + unset($plugin->class_head); + + // set the comment + if (!empty($plugin->comment)) + { + // base64 Decode comment. + $plugin->comment = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $plugin->comment) + ) + ), + array( + 'table' => 'class_extends', + 'field' => 'comment', + 'id' => (int) $plugin->class_id, + 'type' => 'php') + ); + } + + // start the config array + $plugin->config_fields = []; + // create the form arrays + $plugin->form_files = []; + $plugin->fieldsets_label = []; + $plugin->fieldsets_paths = []; + $plugin->add_rule_path = []; + $plugin->add_field_path = []; + // set global fields rule to default component path + $plugin->fields_rules_paths = 1; + // set the fields data + $plugin->fields = (isset($plugin->fields) + && JsonHelper::check($plugin->fields)) + ? json_decode((string) $plugin->fields, true) : null; + if (ArrayHelper::check($plugin->fields)) + { + // ket global key + $key = $plugin->key; + $dynamic_fields = array('fieldset' => 'basic', + 'fields_name' => 'params', + 'file' => 'config'); + foreach ($plugin->fields as $n => &$form) + { + if (isset($form['fields']) + && ArrayHelper::check( + $form['fields'] + )) + { + // make sure the dynamic_field is set to dynamic_value by default + foreach ( + $dynamic_fields as $dynamic_field => + $dynamic_value + ) + { + if (!isset($form[$dynamic_field]) + || !StringHelper::check( + $form[$dynamic_field] + )) + { + $form[$dynamic_field] = $dynamic_value; + } + else + { + if ('fields_name' === $dynamic_field + && strpos((string) $form[$dynamic_field], '.') + !== false) + { + $form[$dynamic_field] + = $form[$dynamic_field]; + } + else + { + $form[$dynamic_field] + = StringHelper::safe( + $form[$dynamic_field] + ); + } + } + } + // check if field is external form file + if (!isset($form['plugin']) || $form['plugin'] != 1) + { + // now build the form key + $unique = $form['file'] . $form['fields_name'] + . $form['fieldset']; + } + else + { + // now build the form key + $unique = $form['fields_name'] + . $form['fieldset']; + } + // set global fields rule path switchs + if ($plugin->fields_rules_paths == 1 + && isset($form['fields_rules_paths']) + && $form['fields_rules_paths'] == 2) + { + $plugin->fields_rules_paths = 2; + } + // set where to path is pointing + $plugin->fieldsets_paths[$unique] + = $form['fields_rules_paths']; + // add the label if set to lang + if (isset($form['label']) + && StringHelper::check( + $form['label'] + )) + { + $plugin->fieldsets_label[$unique] + = $this->language->key($form['label']); + } + // check for extra rule paths + if (isset($form['addrulepath']) + && ArrayHelper::check($form['addrulepath'])) + { + foreach ($form['addrulepath'] as $add_rule_path) + { + if (StringHelper::check($add_rule_path['path'])) + { + $plugin->add_rule_path[$unique] = $add_rule_path['path']; + } + } + } + // check for extra field paths + if (isset($form['addfieldpath']) + && ArrayHelper::check($form['addfieldpath'])) + { + foreach ($form['addfieldpath'] as $add_field_path) + { + if (StringHelper::check($add_field_path['path'])) + { + $plugin->add_field_path[$unique] = $add_field_path['path']; + } + } + } + // build the fields + $form['fields'] = array_map( + function ($field) use ($key, $unique) { + // make sure the alias and title is 0 + $field['alias'] = 0; + $field['title'] = 0; + // set the field details + $this->field->set( + $field, $key, $key, $unique + ); + // update the default if set + if (StringHelper::check( + $field['custom_value'] + ) + && isset($field['settings'])) + { + if (($old_default + = GetHelper::between( + $field['settings']->xml, + 'default="', '"', false + )) !== false) + { + // replace old default + $field['settings']->xml + = str_replace( + 'default="' . $old_default + . '"', 'default="' + . $field['custom_value'] . '"', + (string) $field['settings']->xml + ); + } + else + { + // add the default (hmmm not ideal but okay it should work) + $field['settings']->xml + = 'default="' + . $field['custom_value'] . '" ' + . $field['settings']->xml; + } + } + unset($field['custom_value']); + + // return field + return $field; + }, array_values($form['fields']) + ); + // check if field is external form file + if (!isset($form['plugin']) || $form['plugin'] != 1) + { + // load the form file + if (!isset($plugin->form_files[$form['file']])) + { + $plugin->form_files[$form['file']] + = []; + } + if (!isset($plugin->form_files[$form['file']][$form['fields_name']])) + { + $plugin->form_files[$form['file']][$form['fields_name']] + = []; + } + if (!isset($plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']])) + { + $plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']] + = []; + } + // do some house cleaning (for fields) + foreach ($form['fields'] as $field) + { + // so first we lock the field name in + $this->fieldName->get( + $field, $plugin->key, $unique + ); + // add the fields to the global form file builder + $plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']][] + = $field; + } + // remove form + unset($plugin->fields[$n]); + } + else + { + // load the config form + if (!isset($plugin->config_fields[$form['fields_name']])) + { + $plugin->config_fields[$form['fields_name']] + = []; + } + if (!isset($plugin->config_fields[$form['fields_name']][$form['fieldset']])) + { + $plugin->config_fields[$form['fields_name']][$form['fieldset']] + = []; + } + // do some house cleaning (for fields) + foreach ($form['fields'] as $field) + { + // so first we lock the field name in + $this->fieldName->get( + $field, $plugin->key, $unique + ); + // add the fields to the config builder + $plugin->config_fields[$form['fields_name']][$form['fieldset']][] + = $field; + } + // remove form + unset($plugin->fields[$n]); + } + } + else + { + unset($plugin->fields[$n]); + } + } + } + unset($plugin->fields); + + // set files and folders + $this->filesFolders->set($plugin); + + // add PHP in plugin install + $plugin->add_install_script = true; + $addScriptMethods = [ + 'php_preflight', + 'php_postflight', + 'php_method' + ]; + $addScriptTypes = [ + 'install', + 'update', + 'uninstall' + ]; + foreach ($addScriptMethods as $scriptMethod) + { + foreach ($addScriptTypes as $scriptType) + { + if (isset( $plugin->{'add_' . $scriptMethod . '_' . $scriptType}) + && $plugin->{'add_' . $scriptMethod . '_' . $scriptType} == 1 + && StringHelper::check( + $plugin->{$scriptMethod . '_' . $scriptType} + )) + { + // set GUI mapper field + $guiMapper['field'] = $scriptMethod . '_' . $scriptType; + $plugin->{$scriptMethod . '_' . $scriptType} = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $plugin->{$scriptMethod . '_' . $scriptType} + ) + ) + ), + $guiMapper + ); + } + else + { + unset($plugin->{$scriptMethod . '_' . $scriptType}); + $plugin->{'add_' . $scriptMethod . '_' . $scriptType} = 0; + } + } + } + + // add_sql + if ($plugin->add_sql == 1 + && StringHelper::check($plugin->sql)) + { + $plugin->sql = $this->placeholder->update_( + $this->customcode->update(base64_decode((string) $plugin->sql)) + ); + } + else + { + unset($plugin->sql); + $plugin->add_sql = 0; + } + + // add_sql_uninstall + if ($plugin->add_sql_uninstall == 1 + && StringHelper::check( + $plugin->sql_uninstall + )) + { + $plugin->sql_uninstall = $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $plugin->sql_uninstall) + ) + ); + } + else + { + unset($plugin->sql_uninstall); + $plugin->add_sql_uninstall = 0; + } + + // update the URL of the update_server if set + if ($plugin->add_update_server == 1 + && StringHelper::check( + $plugin->update_server_url + )) + { + $plugin->update_server_url = $this->placeholder->update_( + $this->customcode->update($plugin->update_server_url) + ); + } + + // add the update/sales server FTP details if that is the expected protocol + $serverArray = array('update_server', 'sales_server'); + foreach ($serverArray as $server) + { + if ($plugin->{'add_' . $server} == 1 + && is_numeric( + $plugin->{$server} + ) + && $plugin->{$server} > 0) + { + // get the server protocol + $plugin->{$server . '_protocol'} + = GetHelper::var( + 'server', (int) $plugin->{$server}, 'id', 'protocol' + ); + } + else + { + $plugin->{$server} = 0; + // only change this for sales server (update server can be added locally to the zip file) + if ('sales_server' === $server) + { + $plugin->{'add_' . $server} = 0; + } + $plugin->{$server . '_protocol'} = 0; + } + } + + // set the update server stuff (TODO) + // update_server_xml_path + // update_server_xml_file_name + + // rest globals + $this->config->build_target = $_backup_target; + $this->config->lang_target = $_backup_lang; + $this->config->set('lang_prefix', $_backup_langPrefix); + + $this->placeholder->remove('Plugin_name'); + $this->placeholder->remove('Plugin'); + $this->placeholder->remove('plugin'); + $this->placeholder->remove('Plugin_group'); + $this->placeholder->remove('plugin_group'); + $this->placeholder->remove('plugin.version'); + $this->placeholder->remove('plugin_version'); + $this->placeholder->remove('VERSION'); + $this->placeholder->remove('DESCRIPTION'); + $this->placeholder->remove('PLUGIN_NAME'); + + $this->data[$id] = $plugin; + + return true; + } + } + + return false; + } + +} + diff --git a/src/766a9524-37df-4604-91a7-b98a6150ee26/settings.json b/src/766a9524-37df-4604-91a7-b98a6150ee26/settings.json new file mode 100644 index 0000000..590fb18 --- /dev/null +++ b/src/766a9524-37df-4604-91a7-b98a6150ee26/settings.json @@ -0,0 +1,78 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "766a9524-37df-4604-91a7-b98a6150ee26", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Joomlaplugin.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection3": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection6": { + "use": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "as": "default" + }, + "use_selection7": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection8": { + "use": "f4578c04-a81e-4218-b80d-b0612196eaf0", + "as": "default" + }, + "use_selection9": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection10": { + "use": "30c5b4c2-f75f-4d15-869a-f8bfedd87358", + "as": "default" + }, + "use_selection11": { + "use": "3cf76fbf-fd95-4a33-878e-7aff6d36b7f6", + "as": "default" + }, + "use_selection12": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection13": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection14": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Joomlaplugin.Data", + "description": "Joomla Plugin Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Filter\\OutputFilter;" +} \ No newline at end of file diff --git a/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/README.md b/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/README.md new file mode 100644 index 0000000..7d2f1b2 --- /dev/null +++ b/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/README.md @@ -0,0 +1,77 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface Mappersingleinterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface Mappersingleinterface #Lavender { + + isActive() : bool + + set(string $key, mixed $value) : void + + get(string $key) : mixed + + exist(string $key) : bool + + add(string $key, mixed $value) : void + + remove(string $key) : void +} + +note right of Mappersingleinterface::isActive + Check if any values are set in the active array + + since: 3.2.0 + return: bool +end note + +note right of Mappersingleinterface::set + Set content + + since: 3.2.0 + return: void +end note + +note right of Mappersingleinterface::get + Get content + + since: 3.2.0 + return: mixed +end note + +note right of Mappersingleinterface::exist + Does key exist + + since: 3.2.0 + return: bool +end note + +note right of Mappersingleinterface::add + Add content + + since: 3.2.0 + return: void +end note + +note right of Mappersingleinterface::remove + Remove content + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/code.php b/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/code.php new file mode 100644 index 0000000..b00e1fb --- /dev/null +++ b/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/code.php @@ -0,0 +1,82 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * The Single Mapper Interface + */ +interface Mappersingleinterface +{ + /** + * Check if any values are set in the active array + * + * @return bool Returns true if the active array is not empty, false otherwise + * @since 3.2.0 + */ + public function isActive(): bool; + + /** + * Set content + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, $value); + + /** + * Get content + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $key); + + /** + * Does key exist + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $key): bool; + + /** + * Add content + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add(string $key, $value); + + /** + * Remove content + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove(string $key); + +} + diff --git a/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/settings.json b/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/settings.json new file mode 100644 index 0000000..4b6307d --- /dev/null +++ b/src/78527c29-24ad-4735-ad4c-ec33a4952d9b/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "78527c29-24ad-4735-ad4c-ec33a4952d9b", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Mappersingleinterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Mappersingleinterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Mappersingleinterface", + "description": "The Single Mapper Interface" +} \ No newline at end of file diff --git a/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/README.md b/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/README.md new file mode 100644 index 0000000..ff80602 --- /dev/null +++ b/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/README.md @@ -0,0 +1,66 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Dynamicget (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Dynamicget #Gold { + # array $jointer + # array $operator + # array $guiMapper + # Config $config + # Registry $registry + # Customcode $customcode + # Gui $gui + # Placeholder $placeholder + # Selection $selection + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(object $item, string $view_code, ...) : void +} + +note right of Dynamicget::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Placeholder $placeholder = null + ?Selection $selection = null +end note + +note right of Dynamicget::set + Set Dynamic Get + + since: 3.2.0 + return: void + + arguments: + object $item + string $view_code + string $context +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/code.php b/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/code.php new file mode 100644 index 0000000..4b218a2 --- /dev/null +++ b/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/code.php @@ -0,0 +1,582 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Selection; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Dynamic Get Class + * + * @since 3.2.0 + */ +class Dynamicget +{ + /** + * The joint types + * + * @var array + * @since 3.2.0 + */ + protected array $jointer = [ + 1 => 'LEFT', + 2 => 'LEFT OUTER', + 3 => 'INNER', + 4 => 'RIGHT', + 5 => 'RIGHT OUTER' + ]; + + /** + * The operator types + * + * @var array + * @since 3.2.0 + */ + protected array $operator = [ + 1 => '=', + 2 => '!=', + 3 => '<>', + 4 => '>', + 5 => '<', + 6 => '>=', + 7 => '<=', + 8 => '!<', + 9 => '!>', + 10 => 'IN', + 11 => 'NOT IN' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'dynamic_get', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Dynamic Get Selection + * + * @var Selection + * @since 3.2.0 + **/ + protected Selection $selection; + + /** + * Constructor + * + * @param Config|null $config The compiler config. + * @param Registry|null $registry The compiler registry. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Selection|null $selection The compiler dynamic get selection object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, ?Customcode $customcode = null, + ?Gui $gui = null, ?Placeholder $placeholder = null, ?Selection $selection = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->selection = $selection ?: Compiler::_('Dynamicget.Selection'); + } + + /** + * Set Dynamic Get + * + * @param object $item The item data + * @param string $view_code The view code name + * @param string $context The context for events + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $view_code, string $context) + { + // reset buckets + $item->main_get = []; + $item->custom_get = []; + + // should joined and other tweaks be added + $add_tweaks_joints = true; + + // set source data + switch ($item->main_source) + { + case 1: + // check if auto sync is set + if ($item->select_all == 1) + { + $item->view_selection = '*'; + } + // set the view data + $item->main_get[0]['selection'] = $this->selection->get( + $item->key, $view_code, + $item->view_selection, + $item->view_table_main, 'a', 'view' + ); + $item->main_get[0]['as'] = 'a'; + $item->main_get[0]['key'] = $item->key; + $item->main_get[0]['context'] = $context; + unset($item->view_selection); + break; + case 2: + // check if auto sync is set + if ($item->select_all == 1) + { + $item->db_selection = '*'; + } + // set the database data + $item->main_get[0]['selection'] = $this->selection->get( + $item->key, $view_code, + $item->db_selection, + $item->db_table_main, 'a', 'db' + ); + $item->main_get[0]['as'] = 'a'; + $item->main_get[0]['key'] = $item->key; + $item->main_get[0]['context'] = $context; + unset($item->db_selection); + break; + case 3: + // set GUI mapper field + $this->guiMapper['field'] = 'php_custom_get'; + // get the custom query + $customQueryString + = $this->gui->set( + $this->customcode->update( + base64_decode((string) $item->php_custom_get) + ), + $this->guiMapper + ); + + // get the table name + $_searchQuery + = GetHelper::between( + $customQueryString, '$query->from(', ')' + ); + + if (StringHelper::check( + $_searchQuery + ) + && strpos((string) $_searchQuery, '#__') !== false) + { + $_queryName = GetHelper::between( + $_searchQuery, '#__', "'" + ); + + if (!StringHelper::check( + $_queryName + )) + { + $_queryName = GetHelper::between( + $_searchQuery, '#__', '"' + ); + } + } + + // set to blank if not found + if (!isset($_queryName) + || !StringHelper::check( + $_queryName + )) + { + $_queryName = ''; + } + + // set custom script + $item->main_get[0]['selection'] = [ + 'select' => $customQueryString, + 'from' => '', 'table' => '', 'type' => '', + 'name' => $_queryName]; + $item->main_get[0]['as'] = 'a'; + $item->main_get[0]['key'] = $item->key; + $item->main_get[0]['context'] = $context; + + // do not add + $add_tweaks_joints = false; + + break; + } + + // only add if main source is not custom + if ($add_tweaks_joints) + { + // set join_view_table details + $item->join_view_table = json_decode( + (string) $item->join_view_table, true + ); + + if (ArrayHelper::check( + $item->join_view_table + )) + { + // start the part of a table bucket + $_part_of_a = []; + // build relationship + $_relationship = array_map( + function ($op) use (&$_part_of_a) { + $bucket = []; + // array(on_field_as, on_field) + $bucket['on_field'] = array_map( + 'trim', + explode('.', (string) $op['on_field']) + ); + // array(join_field_as, join_field) + $bucket['join_field'] = array_map( + 'trim', + explode('.', (string) $op['join_field']) + ); + // triget filed that has table a relationship + if ($op['row_type'] == 1 + && ($bucket['on_field'][0] === 'a' + || isset($_part_of_a[$bucket['on_field'][0]]) + || isset($_part_of_a[$bucket['join_field'][0]]))) + { + $_part_of_a[$op['as']] = $op['as']; + } + + return $bucket; + }, $item->join_view_table + ); + + // loop joints + foreach ( + $item->join_view_table as $nr => &$option + ) + { + if (StringHelper::check( + $option['selection'] + )) + { + // convert the type + $option['type'] + = $this->jointer[$option['type']]; + // convert the operator + $option['operator'] + = $this->operator[$option['operator']]; + // get the on field values + $on_field + = $_relationship[$nr]['on_field']; + // get the join field values + $join_field + = $_relationship[$nr]['join_field']; + // set selection + $option['selection'] + = $this->selection->get( + $item->key, + $view_code, + $option['selection'], + $option['view_table'], + $option['as'], + 'view', + $option['row_type'] + ); + $option['key'] = $item->key; + $option['context'] = $context; + // load to the getters + if ($option['row_type'] == 1) + { + $item->main_get[] = $option; + if ($on_field[0] === 'a' + || isset($_part_of_a[$join_field[0]]) + || isset($_part_of_a[$on_field[0]])) + { + $this->registry-> + set('builder.site_main_get.' . $this->config->build_target . + '.' . $view_code . '.' . $option['as'], $option['as']); + } + else + { + $this->registry-> + set('builder.site_dynamic_get.' . $this->config->build_target . + '.' . $view_code . '.' . $option['as'] . '.' . $join_field[1], $on_field[0]); + } + } + elseif ($option['row_type'] == 2) + { + $item->custom_get[] = $option; + if ($on_field[0] != 'a') + { + $this->registry-> + set('builder.site_dynamic_get.' . $this->config->build_target . + '.' . $view_code . '.' . $option['as'] . '.' . $join_field[1], $on_field[0]); + } + } + } + unset($item->join_view_table[$nr]); + } + } + unset($item->join_view_table); + + // set join_db_table details + $item->join_db_table = json_decode( + (string) $item->join_db_table, true + ); + + if (ArrayHelper::check( + $item->join_db_table + )) + { + // start the part of a table bucket + $_part_of_a = []; + // build relationship + $_relationship = array_map( + function ($op) use (&$_part_of_a) { + $bucket = []; + // array(on_field_as, on_field) + $bucket['on_field'] = array_map( + 'trim', + explode('.', (string) $op['on_field']) + ); + // array(join_field_as, join_field) + $bucket['join_field'] = array_map( + 'trim', + explode('.', (string) $op['join_field']) + ); + // triget filed that has table a relationship + if ($op['row_type'] == 1 + && ($bucket['on_field'][0] === 'a' + || isset($_part_of_a[$bucket['on_field'][0]]) + || isset($_part_of_a[$bucket['join_field'][0]]))) + { + $_part_of_a[$op['as']] = $op['as']; + } + + return $bucket; + }, $item->join_db_table + ); + + // loop joints + foreach ( + $item->join_db_table as $nr => &$option1 + ) + { + if (StringHelper::check( + $option1['selection'] + )) + { + // convert the type + $option1['type'] + = $this->jointer[$option1['type']]; + // convert the operator + $option1['operator'] + = $this->operator[$option1['operator']]; + // get the on field values + $on_field + = $_relationship[$nr]['on_field']; + // get the join field values + $join_field + = $_relationship[$nr]['join_field']; + // set selection + $option1['selection'] + = $this->selection->get( + $item->key, + $view_code, + $option1['selection'], + $option1['db_table'], + $option1['as'], + 'db', + $option1['row_type'] + ); + $option1['key'] = $item->key; + $option1['context'] = $context; + // load to the getters + if ($option1['row_type'] == 1) + { + $item->main_get[] = $option1; + if ($on_field[0] === 'a' + || isset($_part_of_a[$join_field[0]]) + || isset($_part_of_a[$on_field[0]])) + { + $this->registry-> + set('builder.site_main_get.' . $this->config->build_target . + '.' . $view_code . '.' . $option1['as'], $option1['as']); + } + else + { + $this->registry-> + set('builder.site_dynamic_get.' . $this->config->build_target . + '.' . $view_code . '.' . $option1['as'] . '.' . $join_field[1], $on_field[0]); + } + } + elseif ($option1['row_type'] == 2) + { + $item->custom_get[] = $option1; + if ($on_field[0] != 'a') + { + $this->registry-> + set('builder.site_dynamic_get.' . $this->config->build_target . + '.' . $view_code . '.' . $option1['as'] . '.' . $join_field[1], $on_field[0]); + } + } + } + unset($item->join_db_table[$nr]); + } + } + unset($item->join_db_table); + + // set filter details + $item->filter = json_decode( + (string) $item->filter, true + ); + + if (ArrayHelper::check( + $item->filter + )) + { + foreach ($item->filter as $nr => &$option2) + { + if (isset($option2['operator'])) + { + $option2['operator'] = $this->operator[$option2['operator']]; + $option2['state_key'] = $this->placeholder->update_( + $this->customcode->update( + $option2['state_key'] + ) + ); + $option2['key'] = $item->key; + } + else + { + unset($item->filter[$nr]); + } + } + } + + // set where details + $item->where = json_decode((string) $item->where, true); + if (ArrayHelper::check( + $item->where + )) + { + foreach ($item->where as $nr => &$option3) + { + if (isset($option3['operator'])) + { + $option3['operator'] + = $this->operator[$option3['operator']]; + } + else + { + unset($item->where[$nr]); + } + } + } + else + { + unset($item->where); + } + + // set order details + $item->order = json_decode((string) $item->order, true); + if (!ArrayHelper::check( + $item->order + )) + { + unset($item->order); + } + + // set grouping + $item->group = json_decode((string) $item->group, true); + if (!ArrayHelper::check( + $item->group + )) + { + unset($item->group); + } + + // set global details + $item->global = json_decode( + (string) $item->global, true + ); + + if (!ArrayHelper::check( + $item->global + )) + { + unset($item->global); + } + } + else + { + // when we have a custom query script we do not add the dynamic options + unset($item->join_view_table); + unset($item->join_db_table); + unset($item->filter); + unset($item->where); + unset($item->order); + unset($item->group); + unset($item->global); + } + } + +} + diff --git a/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/settings.json b/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/settings.json new file mode 100644 index 0000000..c561a24 --- /dev/null +++ b/src/79740ee8-4d10-4b51-9ff5-18e1386ec1c6/settings.json @@ -0,0 +1,57 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "79740ee8-4d10-4b51-9ff5-18e1386ec1c6", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Dynamicget", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Dynamicget", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection4": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection5": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection6": { + "use": "5b021139-dad0-4e9b-882a-2b4d807795af", + "as": "default" + }, + "use_selection7": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection8": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection9": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Dynamicget", + "description": "Model Dynamic Get Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/797579e8-b272-41ed-91de-428cb0b3e089/README.md b/src/797579e8-b272-41ed-91de-428cb0b3e089/README.md new file mode 100644 index 0000000..bde132a --- /dev/null +++ b/src/797579e8-b272-41ed-91de-428cb0b3e089/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Hash (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode** +```uml +@startuml +class Hash #Gold { + # Placeholder $placeholder + + __construct(?Placeholder $placeholder = null) + + set(string $script) : string +} + +note right of Hash::__construct + Constructor. + + since: 3.2.0 +end note + +note right of Hash::set + Set the MD5 hashed string or file or string + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/797579e8-b272-41ed-91de-428cb0b3e089/code.php b/src/797579e8-b272-41ed-91de-428cb0b3e089/code.php new file mode 100644 index 0000000..2af2ae1 --- /dev/null +++ b/src/797579e8-b272-41ed-91de-428cb0b3e089/code.php @@ -0,0 +1,110 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; + + +/** + * Compiler Custom Code MD5 + * + * @since 3.2.0 + */ +class Hash +{ + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The compiler placeholder object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + } + + /** + * Set the MD5 hashed string or file or string + * + * @param string $script The code string + * + * @return string + * @since 3.2.0 + */ + public function set(string $script): string + { + // check if we should hash a string + if (strpos($script, 'HASH' . 'STRING((((') !== false) + { + // get the strings + $values = GetHelper::allBetween( + $script, 'HASH' . 'STRING((((', '))))' + ); + $locker = []; + // convert them + foreach ($values as $value) + { + $locker['HASH' . 'STRING((((' . $value . '))))'] + = md5((string) $value); + } + + // update the script + return $this->placeholder->update($script, $locker); + } + // check if we should hash a file + if (strpos($script, 'HASH' . 'FILE((((') !== false) + { + // get the strings + $values = GetHelper::allBetween( + $script, 'HASH' . 'FILE((((', '))))' + ); + $locker = []; + // convert them + foreach ($values as $path) + { + // we first get the file if it exist + if ($value = FileHelper::getContent($path)) + { + // now we hash the file content + $locker['HASH' . 'FILE((((' . $path . '))))'] + = md5((string) $value); + } + else + { + // could not retrieve the file so we show error + $locker['HASH' . 'FILE((((' . $path . '))))'] + = 'ERROR'; + } + } + + // update the script + return $this->placeholder->update($script, $locker); + } + + return $script; + } + +} + diff --git a/src/797579e8-b272-41ed-91de-428cb0b3e089/settings.json b/src/797579e8-b272-41ed-91de-428cb0b3e089/settings.json new file mode 100644 index 0000000..de85c45 --- /dev/null +++ b/src/797579e8-b272-41ed-91de-428cb0b3e089/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "797579e8-b272-41ed-91de-428cb0b3e089", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Hash", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode.Hash", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection1": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection2": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection3": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.Hash", + "description": "Compiler Custom Code MD5\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/README.md b/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/README.md new file mode 100644 index 0000000..a94a7d0 --- /dev/null +++ b/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/README.md @@ -0,0 +1,36 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class FieldHelper (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +abstract FieldHelper #Orange { + + {static} check(string $type, string $option = 'default') : bool +} + +note right of FieldHelper::check + Field Checker + + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/code.php b/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/code.php new file mode 100644 index 0000000..df8209c --- /dev/null +++ b/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/code.php @@ -0,0 +1,83 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +/** + * The Field Helper + * + * @since 3.2.0 + */ +abstract class FieldHelper +{ + /** + * Field Grouping https://docs.joomla.org/Form_field + **/ + protected static $fields = [ + 'default' => [ + 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', 'checkboxes', 'chromestyle', + 'color', 'combo', 'componentlayout', 'contentlanguage', 'contenttype', 'databaseconnection', 'components', + 'editor', 'editors', 'email', 'file', 'file', 'filelist', 'folderlist', 'groupedlist', 'headertag', 'helpsite', 'hidden', 'imagelist', + 'integer', 'language', 'list', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', + 'moduletag', 'note', 'number', 'password', 'plugins', 'predefinedlist', 'radio', 'range', 'repeatable', 'rules', + 'sessionhandler', 'spacer', 'sql', 'subform', 'tag', 'tel', 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ], + 'plain' => [ + 'cachehandler', 'calendar', 'checkbox', 'chromestyle', 'color', 'componentlayout', 'contenttype', 'editor', 'editors', 'captcha', + 'email', 'file', 'headertag', 'helpsite', 'hidden', 'integer', 'language', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'templatestyle', + 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', 'tag', 'tel', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ], + 'option' => [ + 'accesslevel', 'category', 'checkboxes', 'combo', 'contentlanguage', 'databaseconnection', 'components', + 'filelist', 'folderlist', 'imagelist', 'list', 'plugins', 'predefinedlist', 'radio', 'sessionhandler', 'sql', 'groupedlist' + ], + 'text' => [ + 'calendar', 'color', 'editor', 'email', 'number', 'password', 'range', 'tel', 'text', 'textarea', 'url' + ], + 'list' => [ + 'checkbox', 'checkboxes', 'list', 'radio', 'groupedlist', 'combo' + ], + 'dynamic' => [ + 'category', 'file', 'filelist', 'folderlist', 'headertag', 'imagelist', 'integer', 'media', 'meter', 'rules', 'tag', 'timezone', 'user' + ], + 'spacer' => [ + 'note', 'spacer' + ], + 'special' => [ + 'contentlanguage', 'moduleposition', 'plugin', 'repeatable', 'subform' + ], + 'search' => [ + 'editor', 'email', 'tel', 'text', 'textarea', 'url', 'subform' + ] + ]; + + /** + * Field Checker + * + * @param string $type The field type + * @param string $option The field grouping + * + * @return bool if the field was found + */ + public static function check(string $type, string $option = 'default'): bool + { + // now check + if (isset(self::$fields[$option]) && + in_array($type, self::$fields[$option])) + { + return true; + } + return false; + } + +} + diff --git a/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/settings.json b/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/settings.json new file mode 100644 index 0000000..e782e48 --- /dev/null +++ b/src/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "7a5fd3f3-199e-43ba-a8e8-f473d6c030ec", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "FieldHelper", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.FieldHelper", + "type": "abstract class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.FieldHelper", + "description": "The Field Helper\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/README.md b/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/README.md new file mode 100644 index 0000000..537d346 --- /dev/null +++ b/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class LockBase (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode** +```uml +@startuml +class LockBase #Gold { + # Placeholder $placeholder + + __construct(?Placeholder $placeholder = null) + + set(string $script) : string +} + +note right of LockBase::__construct + Constructor. + + since: 3.2.0 +end note + +note right of LockBase::set + Set a string as bsae64 (basic) + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/code.php b/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/code.php new file mode 100644 index 0000000..7db3a4b --- /dev/null +++ b/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/code.php @@ -0,0 +1,86 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\LockBaseInterface; + + +/** + * Compiler Custom Code Base64 + * + * @since 3.2.0 + */ +class LockBase implements LockBaseInterface +{ + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The compiler placeholder object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + } + + /** + * Set a string as bsae64 (basic) + * + * @param string $script The code string + * + * @return string + * @since 3.2.0 + */ + public function set(string $script): string + { + if (\strpos($script, 'LOCK'.'BASE64((((') !== false) + { + // get the strings + $values = GetHelper::allBetween( + $script, 'LOCK'.'BASE64((((', '))))' + ); + $locker = []; + // convert them + foreach ($values as $value) + { + $locker['LOCK'.'BASE64((((' . $value . '))))'] + = "base64_decode( preg_replace('/\s+/', ''," . + PHP_EOL . Indent::_(2) . "'" . + wordwrap( + base64_encode((string) $value), 64, PHP_EOL . Indent::_(2), true + ) . + "'))"; + } + + // update the script + return $this->placeholder->update($script, $locker); + } + + return $script; + } + +} + diff --git a/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/settings.json b/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/settings.json new file mode 100644 index 0000000..61d048c --- /dev/null +++ b/src/7c07c9d6-34cd-4491-934a-ef0a83f414c0/settings.json @@ -0,0 +1,35 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "7c07c9d6-34cd-4491-934a-ef0a83f414c0", + "implements": [ + "a3c515f5-4adf-4eb3-b637-0a1add550da6" + ], + "implements_custom": "", + "load_selection": null, + "name": "LockBase", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode.LockBase", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection1": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection2": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection3": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.LockBase", + "description": "Compiler Custom Code Base64\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/README.md b/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/README.md new file mode 100644 index 0000000..2b94eb5 --- /dev/null +++ b/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface Cryptinterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface Cryptinterface #Lavender { + + encrypt(string $string, string $key) : string + + decrypt(string $string, string $key) : string +} + +note right of Cryptinterface::encrypt + Encrypt a string as needed + + since: 3.2.0 + return: string +end note + +note right of Cryptinterface::decrypt + Decrypt a string as needed + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php b/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php new file mode 100644 index 0000000..572b90a --- /dev/null +++ b/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php @@ -0,0 +1,43 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * The Crypt Interface + */ +interface Cryptinterface +{ + /** + * Encrypt a string as needed + * + * @param string $string The string to encrypt + * @param string $key The encryption key + * + * @return string + * @since 3.2.0 + **/ + public function encrypt(string $string, string $key): string; + + /** + * Decrypt a string as needed + * + * @param string $string The string to decrypt + * @param string $key The decryption key + * + * @return string + * @since 3.2.0 + **/ + public function decrypt(string $string, string $key): string; + +} + diff --git a/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json b/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json new file mode 100644 index 0000000..28eee94 --- /dev/null +++ b/src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "81de8f57-dd9c-4a17-964f-848cd4a0743b", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Cryptinterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Cryptinterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Cryptinterface", + "description": "The Crypt Interface" +} \ No newline at end of file diff --git a/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/README.md b/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/README.md new file mode 100644 index 0000000..d3f9b76 --- /dev/null +++ b/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface Serverinterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface Serverinterface #Lavender { + + set(object $details) : self + + move(string $localPath, string $fileName) : bool +} + +note right of Serverinterface::set + set the server details + + since: 3.2.0 + return: self +end note + +note right of Serverinterface::move + move a file to server with the FTP client + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php b/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php new file mode 100644 index 0000000..7e14f78 --- /dev/null +++ b/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php @@ -0,0 +1,42 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * The Core Server Interface + */ +interface Serverinterface +{ + /** + * set the server details + * + * @param object $details The server details + * + * @return self + * @since 3.2.0 + **/ + public function set(object $details); + + /** + * move a file to server with the FTP client + * + * @param string $localPath The full local path to the file + * @param string $fileName The file name + * + * @return bool + * @since 3.2.0 + **/ + public function move(string $localPath, string $fileName): bool; + +} + diff --git a/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json b/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json new file mode 100644 index 0000000..5182296 --- /dev/null +++ b/src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "86ac0760-26f5-4746-9c7f-ce77860f80f8", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Serverinterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Serverinterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Serverinterface", + "description": "The Core Server Interface" +} \ No newline at end of file diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md new file mode 100644 index 0000000..7d9cb05 --- /dev/null +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/README.md @@ -0,0 +1,57 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class History (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaThree** +```uml +@startuml +class History #Gold { + # ?object $tmp + # Config $config + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + + get(string $type, int $id) : ?object + # set(object $object, int $action) : bool +} + +note right of History::__construct + Constructor + + since: 3.2.0 +end note + +note right of History::get + Get Item History object + + since: 3.2.0 + return: ?object +end note + +note right of History::set + Set Item History Watch +0 = remove watch +1 = add watch + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php new file mode 100644 index 0000000..2cfe3f8 --- /dev/null +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/code.php @@ -0,0 +1,232 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree; + + +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 + * + * @var \JDatabaseDriver + * @since 3.2.0 + */ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param \JDatabaseDriver|null $db The Database Driver object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = $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'); + } + +} + diff --git a/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json new file mode 100644 index 0000000..a64350f --- /dev/null +++ b/src/87db51b9-1126-4c21-858b-53dbd3a68b61/settings.json @@ -0,0 +1,36 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "87db51b9-1126-4c21-858b-53dbd3a68b61", + "implements": [ + "4325745f-da1f-4d4d-a591-3189fe8c06e5" + ], + "implements_custom": "", + "load_selection": null, + "name": "History", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaThree.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.JoomlaThree.History", + "description": "Compiler History\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/README.md b/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/README.md new file mode 100644 index 0000000..72c92bc --- /dev/null +++ b/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Customview #Gold { + + register(Container $container) : void + + getCustomviewData(Container $container) : CustomviewData + + getDynamicgetData(Container $container) : DynamicgetData + + getDynamicgetSelection(Container $container) : DynamicgetSelection +} + +note right of Customview::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Customview::getCustomviewData + Get the Compiler Customview Data + + since: 3.2.0 + return: CustomviewData +end note + +note right of Customview::getDynamicgetData + Get the Compiler Dynamicget Data + + since: 3.2.0 + return: DynamicgetData +end note + +note right of Customview::getDynamicgetSelection + Get the Compiler Dynamicget Selection + + since: 3.2.0 + return: DynamicgetSelection +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/code.php b/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/code.php new file mode 100644 index 0000000..0d9212d --- /dev/null +++ b/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/code.php @@ -0,0 +1,114 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customview\Data as CustomviewData; +use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Data as DynamicgetData; +use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Selection as DynamicgetSelection; + + +/** + * Compiler Customview + * + * @since 3.2.0 + */ +class Customview implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CustomviewData::class, 'Customview.Data') + ->share('Customview.Data', [$this, 'getCustomviewData'], true); + + $container->alias(DynamicgetData::class, 'Dynamicget.Data') + ->share('Dynamicget.Data', [$this, 'getDynamicgetData'], true); + + $container->alias(DynamicgetSelection::class, 'Dynamicget.Selection') + ->share('Dynamicget.Selection', [$this, 'getDynamicgetSelection'], true); + } + + /** + * Get the Compiler Customview Data + * + * @param Container $container The DI container. + * + * @return CustomviewData + * @since 3.2.0 + */ + public function getCustomviewData(Container $container): CustomviewData + { + return new CustomviewData( + $container->get('Config'), + $container->get('Event'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Model.Libraries'), + $container->get('Templatelayout.Data'), + $container->get('Dynamicget.Data'), + $container->get('Model.Loader'), + $container->get('Model.Javascriptcustomview'), + $container->get('Model.Csscustomview'), + $container->get('Model.Phpcustomview'), + $container->get('Model.Ajaxcustomview'), + $container->get('Model.Custombuttons') + ); + } + + /** + * Get the Compiler Dynamicget Data + * + * @param Container $container The DI container. + * + * @return DynamicgetData + * @since 3.2.0 + */ + public function getDynamicgetData(Container $container): DynamicgetData + { + return new DynamicgetData( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Customcode'), + $container->get('Customcode.Dispenser'), + $container->get('Customcode.Gui'), + $container->get('Model.Dynamicget') + ); + } + + /** + * Get the Compiler Dynamicget Selection + * + * @param Container $container The DI container. + * + * @return DynamicgetSelection + * @since 3.2.0 + */ + public function getDynamicgetSelection(Container $container): DynamicgetSelection + { + return new DynamicgetSelection( + $container->get('Config'), + $container->get('Registry') + ); + } + +} + diff --git a/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/settings.json b/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/settings.json new file mode 100644 index 0000000..061a991 --- /dev/null +++ b/src/87faa133-4cac-4816-ae41-5c3f9a2f76aa/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "87faa133-4cac-4816-ae41-5c3f9a2f76aa", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Customview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Customview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "3b6895da-d9eb-4164-90b1-4632a4cc2474", + "as": "CustomviewData" + }, + "use_selection1": { + "use": "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46", + "as": "DynamicgetData" + }, + "use_selection2": { + "use": "5b021139-dad0-4e9b-882a-2b4d807795af", + "as": "DynamicgetSelection" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Customview", + "description": "Compiler Customview\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md new file mode 100644 index 0000000..4518abe --- /dev/null +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/README.md @@ -0,0 +1,101 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Component (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Component #Gold { + + register(Container $container) : void + + getComponent(Container $container) : CompilerComponent + + getSettings(Container $container) : Settings + + getDashboard(Container $container) : Dashboard + + getPlaceholder(Container $container) : Placeholder + + getData(Container $container) : Data + + getStructure(Container $container) : Structure + + getStructuresingle(Container $container) : Structuresingle + + getStructuremultiple(Container $container) : Structuremultiple +} + +note right of Component::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Component::getComponent + Get the Component + + since: 3.2.0 + return: CompilerComponent +end note + +note right of Component::getSettings + Get the Compiler Component (version) Settings + + since: 3.2.0 + return: Settings +end note + +note left of Component::getDashboard + Get the Compiler Component Dynamic Dashboard + + since: 3.2.0 + return: Dashboard +end note + +note right of Component::getPlaceholder + Get the Component Placeholders + + since: 3.2.0 + return: Placeholder +end note + +note left of Component::getData + Get the Component Data + + since: 3.2.0 + return: Data +end note + +note right of Component::getStructure + Get the Compiler Structure + + since: 3.2.0 + return: Structure +end note + +note left of Component::getStructuresingle + Get the Compiler Structure Single + + since: 3.2.0 + return: Structuresingle +end note + +note right of Component::getStructuremultiple + Get the Compiler Structure Multiple + + since: 3.2.0 + return: Structuremultiple +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php new file mode 100644 index 0000000..1cd89eb --- /dev/null +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/code.php @@ -0,0 +1,232 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component\Data; +use VDM\Joomla\Componentbuilder\Compiler\Component\Structure; +use VDM\Joomla\Componentbuilder\Compiler\Component\Structuresingle; +use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; + + +/** + * Component Service Provider + * + * @since 3.2.0 + */ +class Component implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerComponent::class, 'Component') + ->share('Component', [$this, 'getComponent'], true); + + $container->alias(Settings::class, 'Component.Settings') + ->share('Component.Settings', [$this, 'getSettings'], true); + + $container->alias(Dashboard::class, 'Component.Dashboard') + ->share('Component.Dashboard', [$this, 'getDashboard'], true); + + $container->alias(Placeholder::class, 'Component.Placeholder') + ->share('Component.Placeholder', [$this, 'getPlaceholder'], true); + + $container->alias(Data::class, 'Component.Data') + ->share('Component.Data', [$this, 'getData'], true); + + $container->alias(Structure::class, 'Component.Structure') + ->share('Component.Structure', [$this, 'getStructure'], true); + + $container->alias(Structuresingle::class, 'Component.Structure.Single') + ->share('Component.Structure.Single', [$this, 'getStructuresingle'], true); + + $container->alias(Structuremultiple::class, 'Component.Structure.Multiple') + ->share('Component.Structure.Multiple', [$this, 'getStructuremultiple'], true); + } + + /** + * Get the Component + * + * @param Container $container The DI container. + * + * @return CompilerComponent + * @since 3.2.0 + */ + public function getComponent(Container $container): CompilerComponent + { + return new CompilerComponent( + $container->get('Component.Data') + ); + } + + /** + * Get the Compiler Component (version) Settings + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + return new Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get the Compiler Component Dynamic Dashboard + * + * @param Container $container The DI container. + * + * @return Dashboard + * @since 3.2.0 + */ + public function getDashboard(Container $container): Dashboard + { + return new Dashboard( + $container->get('Registry'), + $container->get('Component') + ); + } + + /** + * Get the Component Placeholders + * + * @param Container $container The DI container. + * + * @return Placeholder + * @since 3.2.0 + */ + public function getPlaceholder(Container $container): Placeholder + { + return new Placeholder( + $container->get('Config') + ); + } + + /** + * Get the Component Data + * + * @param Container $container The DI container. + * + * @return Data + * @since 3.2.0 + */ + public function getData(Container $container): Data + { + return new Data( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component.Placeholder'), + $container->get('Customcode.Dispenser'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Field'), + $container->get('Field.Name'), + $container->get('Field.Unique.Name'), + $container->get('Model.Filesfolders'), + $container->get('Model.Historycomponent'), + $container->get('Model.Whmcs'), + $container->get('Model.Sqltweaking'), + $container->get('Model.Adminviews'), + $container->get('Model.Siteviews'), + $container->get('Model.Customadminviews'), + $container->get('Model.Updateserver'), + $container->get('Model.Joomlamodules'), + $container->get('Model.Joomlaplugins') + ); + } + + /** + * Get the Compiler Structure + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Component.Settings'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Folder') + ); + } + + /** + * Get the Compiler Structure Single + * + * @param Container $container The DI container. + * + * @return Structuresingle + * @since 3.2.0 + */ + public function getStructuresingle(Container $container): Structuresingle + { + return new Structuresingle( + $container->get('Config'), + $container->get('Registry'), + $container->get('Component.Settings'), + $container->get('Component'), + $container->get('Content'), + $container->get('Utilities.Counter'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Files') + ); + } + + /** + * Get the Compiler Structure Multiple + * + * @param Container $container The DI container. + * + * @return Structuremultiple + * @since 3.2.0 + */ + public function getStructuremultiple(Container $container): Structuremultiple + { + return new Structuremultiple( + $container->get('Config'), + $container->get('Registry'), + $container->get('Component.Settings'), + $container->get('Component'), + $container->get('Model.Createdate'), + $container->get('Model.Modifieddate'), + $container->get('Utilities.Structure') + ); + } + +} + diff --git a/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json new file mode 100644 index 0000000..8135152 --- /dev/null +++ b/src/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c/settings.json @@ -0,0 +1,51 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Component", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Component", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "CompilerComponent" + }, + "use_selection1": { + "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "as": "default" + }, + "use_selection2": { + "use": "cfe62a32-8818-4bfb-8751-2f1e109b5336", + "as": "default" + }, + "use_selection3": { + "use": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", + "as": "default" + }, + "use_selection4": { + "use": "ef9578e5-4c9d-46bf-866f-3a94bdc7b753", + "as": "default" + }, + "use_selection5": { + "use": "6c89c663-78f5-4078-9fac-7047f2eaaf96", + "as": "default" + }, + "use_selection6": { + "use": "673954d3-78d3-445a-b99f-4b40d617c882", + "as": "default" + }, + "use_selection7": { + "use": "b69a23db-0a62-4840-a9c5-b2d8d63ecc6c", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Component", + "description": "Component Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md new file mode 100644 index 0000000..8505480 --- /dev/null +++ b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md @@ -0,0 +1,70 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface ModelInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface ModelInterface #Lavender { + + value(mixed $value, string $field, ...) : mixed + + item(object $item, ?string $table = null) : ?object + + items(?array $items = null, ?string $table = null) : ?array + + last(?string $table = null) : ?int +} + +note right of ModelInterface::value + Model the value +Example: $this->value(value, 'value_key', 'table_name'); + + since: 3.2.0 + return: mixed + + arguments: + mixed $value + string $field + ?string $table = null +end note + +note right of ModelInterface::item + Model the values of an item +Example: $this->item(Object, 'table_name'); + + since: 3.2.0 + return: ?object +end note + +note right of ModelInterface::items + Model the values of multiple items +Example: $this->items(Array, 'table_name'); + + since: 3.2.0 + return: ?array +end note + +note right of ModelInterface::last + Get last modeled ID +Example: $this->last('table_name'); + + since: 3.2.0 + return: ?int +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php new file mode 100644 index 0000000..2760500 --- /dev/null +++ b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php @@ -0,0 +1,71 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * Model Interface + * + * @since 3.2.0 + */ +interface ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'value_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null); + + /** + * Model the values of an item + * Example: $this->item(Object, 'table_name'); + * + * @param object $item The item object + * @param string|null $table The table + * + * @return object|null + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): ?object; + + /** + * Model the values of multiple items + * Example: $this->items(Array, 'table_name'); + * + * @param array|null $items The array of item objects + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null): ?array; + + /** + * Get last modeled ID + * Example: $this->last('table_name'); + * + * @param string|null $table The table + * + * @return int|null + * @since 3.2.0 + */ + public function last(?string $table = null): ?int; + +} + diff --git a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/settings.json b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/settings.json new file mode 100644 index 0000000..4765142 --- /dev/null +++ b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "ModelInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.ModelInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.ModelInterface", + "description": "Model Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/README.md b/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/README.md new file mode 100644 index 0000000..477612e --- /dev/null +++ b/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class UniqueName (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class UniqueName #Gold { + # Registry $registry + + __construct(?Registry $registry = null) + + set(string $name, string $view) : void + + get(string $name, string $view) : string +} + +note right of UniqueName::__construct + Constructor + + since: 3.2.0 +end note + +note right of UniqueName::set + Count how many times the same field is used per view + + since: 3.2.0 + return: void +end note + +note right of UniqueName::get + Naming each field with an unique name + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/code.php b/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/code.php new file mode 100644 index 0000000..affe4c2 --- /dev/null +++ b/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/code.php @@ -0,0 +1,112 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Registry; + + +/** + * Compiler Field Unique Name + * + * @since 3.2.0 + */ +class UniqueName +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Count how many times the same field is used per view + * + * @param string $name The name of the field + * @param string $view The name of the view + * + * @return void + * @since 3.2.0 + */ + public function set(string $name, string $view) + { + if (($number = $this->registry->get("unique.names.${view}.counter.${name}")) === null) + { + $this->registry->set("unique.names.${view}.counter.${name}", 1); + + return; + } + + // count how many times the field is used + $this->registry->set("unique.names.${view}.counter.${name}", ++$number); + + return; + } + + /** + * Naming each field with an unique name + * + * @param string $name The name of the field + * @param string $view The name of the view + * + * @return string the name + * @since 3.2.0 + */ + public function get(string $name, string $view): string + { + // only increment if the field name is used multiple times + if ($this->registry->get("unique.names.${view}.counter.${name}") > 1) + { + $counter = 1; + // set the unique name + $unique_name = FieldHelper::safe( + $name . '_' . $counter + ); + + while ($this->registry->get("unique.names.${view}.names.${unique_name}") !== null) + { + // increment the number + $counter++; + // try again + $unique_name = FieldHelper::safe( + $name . '_' . $counter + ); + } + + // set the new name number + $this->registry->set("unique.names.${view}.names.${unique_name}", $counter); + + // return the unique name + return $unique_name; + } + + return $name; + } + +} + diff --git a/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/settings.json b/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/settings.json new file mode 100644 index 0000000..9463875 --- /dev/null +++ b/src/8c018533-e967-4bf2-9bd9-9e92966fcb5e/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "8c018533-e967-4bf2-9bd9-9e92966fcb5e", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "UniqueName", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.UniqueName", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "9ef0eb24-aae4-4f5a-99af-d724db44808f", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.UniqueName", + "description": "Compiler Field Unique Name\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md b/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md new file mode 100644 index 0000000..8863ea7 --- /dev/null +++ b/src/8eee7df5-2775-41a9-9372-c46c5939a252/README.md @@ -0,0 +1,100 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Language (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Language #Gold { + # array $content + # Config $config + + __construct(?Config $config = null) + + key(string $string) : string + + exist(string $target, ?string $language = null) : bool + + get(string $target, string $language) : string + + getTarget(string $target) : array + + setTarget(string $target, ?array $content) : void + + set(string $target, string $language, ...) : void + # fix(string $string) : string +} + +note right of Language::__construct + Constructor. + + since: 3.2.0 +end note + +note left of Language::key + Get the language string key + + since: 3.2.0 + return: string +end note + +note right of Language::exist + check if the language string exist + + since: 3.2.0 + return: bool +end note + +note left of Language::get + get the language string + + since: 3.2.0 + return: string +end note + +note right of Language::getTarget + get target array + + since: 3.2.0 + return: array +end note + +note left of Language::setTarget + set target array + + since: 3.2.0 + return: void +end note + +note right of Language::set + set the language content values to language content array + + since: 3.2.0 + return: void + + arguments: + string $target + string $language + string $string + bool $addPrefix = false +end note + +note left of Language::fix + We need to remove all text breaks from all language strings + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php b/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php new file mode 100644 index 0000000..8370943 --- /dev/null +++ b/src/8eee7df5-2775-41a9-9372-c46c5939a252/code.php @@ -0,0 +1,202 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\LanguageInterface; + + +/** + * Compiler Language Content + * + * @since 3.2.0 + */ +class Language implements LanguageInterface +{ + /** + * The language content + * + * @var array + * @since 3.2.0 + **/ + protected array $content = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Get the language string key + * + * @param string $string The plan text string (English) + * + * @return string The key language string (all uppercase) + * @since 3.2.0 + */ + public function key($string): string + { + // this is there to insure we don't break already added Language strings + if (StringHelper::safe($string, 'U', '_', false, false) + === $string) + { + return false; + } + + // build language key + $key_lang = $this->config->lang_prefix . '_' . StringHelper::safe( + $string, 'U' + ); + + // set the language string + $this->set($this->config->lang_target, $key_lang, $string); + + return $key_lang; + } + + /** + * check if the language string exist + * + * @param string $target The target area for the language string + * @param string|null $language The language key string + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $target, ?string $language = null): bool + { + if ($language) + { + return isset($this->content[$target][$language]); + } + + return isset($this->content[$target]); + } + + /** + * get the language string + * + * @param string $target The target area for the language string + * @param string|null $language The language key string + * + * @return Mixed The language string found or empty string if none is found + * @since 3.2.0 + */ + public function get(string $target, string $language): string + { + if (isset($this->content[$target][$language])) + { + return $this->content[$target][$language]; + } + + return ''; + } + + /** + * get target array + * + * @param string $target The target area for the language string + * + * @return array The target array or empty array if none is found + * @since 3.2.0 + */ + public function getTarget(string $target): array + { + if (isset($this->content[$target]) && ArrayHelper::check($this->content[$target])) + { + return $this->content[$target]; + } + + return []; + } + + /** + * set target array + * + * @param string $target The target area for the language string + * @param array|null $content The language content string + * + * @return void + * @since 3.2.0 + */ + public function setTarget(string $target, ?array $content) + { + $this->content[$target] = $content; + } + + /** + * set the language content values to language content array + * + * @param string $target The target area for the language string + * @param string $language The language key string + * @param string $string The language string + * @param bool $addPrefix The switch to add langPrefix + * + * @return void + * @since 3.2.0 + */ + public function set(string $target, string $language, string $string, bool $addPrefix = false) + { + if ($addPrefix && empty( + $this->content[$target][$this->config->lang_prefix . '_' . $language] + )) + { + $this->content[$target][$this->config->lang_prefix . '_' . $language] + = $this->fix($string); + } + elseif (empty($this->content[$target][$language])) + { + $this->content[$target][$language] = $this->fix( + $string + ); + } + } + + /** + * We need to remove all text breaks from all language strings + * + * @param string $string The language string + * + * @return string + * @since 3.2.0 + */ + protected function fix(string $string): string + { + if ($this->config->remove_line_breaks) + { + return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string)); + } + + return trim($string); + } + +} + diff --git a/src/8eee7df5-2775-41a9-9372-c46c5939a252/settings.json b/src/8eee7df5-2775-41a9-9372-c46c5939a252/settings.json new file mode 100644 index 0000000..fb00529 --- /dev/null +++ b/src/8eee7df5-2775-41a9-9372-c46c5939a252/settings.json @@ -0,0 +1,35 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "8eee7df5-2775-41a9-9372-c46c5939a252", + "implements": [ + "d6592c9b-93a6-41b3-83c7-c43a0a80cb83" + ], + "implements_custom": "", + "load_selection": null, + "name": "Language", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Language", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Language", + "description": "Compiler Language Content\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/README.md b/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/README.md new file mode 100644 index 0000000..36c8087 --- /dev/null +++ b/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/README.md @@ -0,0 +1,62 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Modifieddate (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Modifieddate #Gold { + # array $last + + get(array $item) : string + # getDate(array $item) : int + # getModified(array $item) : int + # getKey(array $item) : string +} + +note right of Modifieddate::get + Get the last modified date of an item + + since: 3.2.0 + return: string +end note + +note right of Modifieddate::getDate + Get the last modified date of an item + + since: 3.2.0 + return: int +end note + +note right of Modifieddate::getModified + Get the last modified date of an item's sub items + + since: 3.2.0 + return: int +end note + +note right of Modifieddate::getKey + Get the key for an item + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/code.php b/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/code.php new file mode 100644 index 0000000..754056c --- /dev/null +++ b/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/code.php @@ -0,0 +1,155 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model - Get Modified Date + * + * @since 3.2.0 + */ +class Modifieddate +{ + /** + * The array of last modified dates + * + * @var array + * @since 3.2.0 + */ + protected array $last = []; + + /** + * Get the last modified date of an item + * + * @param array $item The item data + * + * @return string The modified date + * @since 3.2.0 + */ + public function get(array $item): string + { + $key = $this->getKey($item); + + if (!isset($this->last[$key])) + { + $date = max($this->getDate($item), $this->getModified($item)); + + $this->last[$key] = Factory::getDate($date)->format( + 'jS F, Y' + ); + } + + return $this->last[$key]; + } + + /** + * Get the last modified date of an item + * + * @param array $item The item data + * + * @return int The modified date as int + * @since 3.2.0 + */ + protected function getDate(array $item): int + { + if (isset($item['settings']) && isset($item['settings']->modified) + && StringHelper::check($item['settings']->modified) + && '0000-00-00 00:00:00' !== $item['settings']->modified) + { + return strtotime((string) $item['settings']->modified); + } + + return strtotime("now"); + } + + /** + * Get the last modified date of an item's sub items + * + * @param array $item The item data + * + * @return int The modified date as int + * @since 3.2.0 + */ + protected function getModified(array $item): int + { + $date = 0; + + // if not settings is found + if (!isset($item['settings']) || !ObjectHelper::check($item['settings'])) + { + return $date; + } + + // check if we have fields + if (isset($item['settings']->fields) && ArrayHelper::check($item['settings']->fields)) + { + foreach ($item['settings']->fields as $field) + { + if (isset($field['settings']) + && ObjectHelper::check($field['settings']) + && isset($field['settings']->modified) + && StringHelper::check($field['settings']->modified) + && '0000-00-00 00:00:00' !== $field['settings']->modified) + { + $modified = strtotime((string) $field['settings']->modified); + $date = max($date, $modified); + } + } + } + // check if we have a main dynamic get + elseif (isset($item['settings']->main_get) + && ObjectHelper::check($item['settings']->main_get) + && isset($item['settings']->main_get->modified) + && StringHelper::check($item['settings']->main_get->modified) + && '0000-00-00 00:00:00' !== $item['settings']->main_get->modified) + { + $modified = strtotime((string) $item['settings']->main_get->modified); + $date = max($date, $modified); + } + + return $date; + } + + /** + * Get the key for an item + * + * @param array $item The item data + * + * @return string The key + * @since 3.2.0 + */ + protected function getKey(array $item): string + { + if (isset($item['adminview'])) + { + return $item['adminview'] . 'admin'; + } + elseif (isset($item['siteview'])) + { + return $item['siteview'] . 'site'; + } + elseif (isset($item['customadminview'])) + { + return $item['customadminview'] . 'customadmin'; + } + + return 'error'; + } + +} + diff --git a/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/settings.json b/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/settings.json new file mode 100644 index 0000000..003b74a --- /dev/null +++ b/src/9127e428-5dee-46cb-b3a9-ab5b91ea6df3/settings.json @@ -0,0 +1,30 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Modifieddate", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Modifieddate", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Modifieddate", + "description": "Model - Get Modified Date\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/9387215f-a965-4421-acf3-5e8f9d11382f/README.md b/src/9387215f-a965-4421-acf3-5e8f9d11382f/README.md new file mode 100644 index 0000000..eb24980 --- /dev/null +++ b/src/9387215f-a965-4421-acf3-5e8f9d11382f/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Name (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class Name #Gold { + # Registry $registry + # array $unique + # Placeholder $placeholder + # UniqueName $uniqueName + + __construct(?Placeholder $placeholder = null, ?UniqueName $uniqueName = null, ...) + + get(array $field, ?string $listViewName = null, ...) : string +} + +note right of Name::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Placeholder $placeholder = null + ?UniqueName $uniqueName = null + ?Registry $registry = null +end note + +note right of Name::get + Get the field's actual name + + since: 3.2.0 + return: string + + arguments: + array $field + ?string $listViewName = null + string $amicably = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9387215f-a965-4421-acf3-5e8f9d11382f/code.php b/src/9387215f-a965-4421-acf3-5e8f9d11382f/code.php new file mode 100644 index 0000000..6a00b32 --- /dev/null +++ b/src/9387215f-a965-4421-acf3-5e8f9d11382f/code.php @@ -0,0 +1,234 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\String\TypeHelper; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; +use VDM\Joomla\Componentbuilder\Compiler\Registry; + + +/** + * Compiler Field Name + * + * @since 3.2.0 + */ +class Name +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Unique Field Names + * + * @var array + * @since 3.2.0 + */ + protected array $unique; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Field Unique Name + * + * @var UniqueName + * @since 3.2.0 + */ + protected UniqueName $uniqueName; + + /** + * Constructor + * + * @param Placeholder|null $placeholder The compiler component placeholder object. + * @param UniqueName|null $uniqueName The compiler field unique name object. + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, ?UniqueName $uniqueName = null, ?Registry $registry = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name'); + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Get the field's actual name + * + * @param array $field The field array + * @param string|null $listViewName The list view name + * @param string $amicably The peaceful resolve (for fields in subforms in same view :) + * + * @return string Success returns field name + * @since 3.2.0 + */ + public function get(array &$field, ?string $listViewName = null, string $amicably = ''): string + { + // return the unique name if already set + if ($listViewName && StringHelper::check($listViewName) + && isset($field['hash']) + && isset( + $this->unique[$listViewName . $amicably . $field['hash']] + )) + { + return $this->unique[$listViewName . $amicably . $field['hash']]; + } + + // always make sure we have a field name and type + if (!isset($field['settings']) || !isset($field['settings']->type_name) + || !isset($field['settings']->name)) + { + return 'error'; + } + + // set the type name + $type_name = TypeHelper::safe( + $field['settings']->type_name + ); + + // set the name of the field + $name = FieldHelper::safe($field['settings']->name); + + // check that we have the properties + if (ArrayHelper::check($field['settings']->properties)) + { + foreach ($field['settings']->properties as $property) + { + if ($property['name'] === 'name') + { + // if category then name must be catid (only one per view) + if ($type_name === 'category') + { + // quick check if this is a category linked to view page + $requeSt_id = GetHelper::between( + $field['settings']->xml, 'name="', '"' + ); + if (strpos($requeSt_id, '_request_id') !== false + || strpos($requeSt_id, '_request_catid') !== false) + { + // keep it then, don't change + $name = $this->placeholder->update_( + $requeSt_id + ); + } + else + { + $name = 'catid'; + } + + // if list view name is set + if (StringHelper::check($listViewName)) + { + // check if we should use another Text Name as this views name + $otherName = $this->placeholder->update_( + GetHelper::between( + $field['settings']->xml, 'othername="', '"' + ) + ); + $otherViews = $this->placeholder->update_( + GetHelper::between( + $field['settings']->xml, 'views="', '"' + ) + ); + $otherView = $this->placeholder->update_( + GetHelper::between( + $field['settings']->xml, 'view="', '"' + ) + ); + // This is to link other view category + if (StringHelper::check($otherName) + && StringHelper::check( + $otherViews + ) && StringHelper::check( + $otherView + )) + { + // set other category details + $this->registry->set("category.other.name.${listViewName}", [ + 'name' => FieldHelper::safe( + $otherName + ), + 'views' => StringHelper::safe( + $otherViews + ), + 'view' => StringHelper::safe( + $otherView + ) + ]); + } + } + } + // if tag is set then enable all tag options for this view (only one per view) + elseif ($type_name === 'tag') + { + $name = 'tags'; + } + // if the field is set as alias it must be called alias + elseif (isset($field['alias']) && $field['alias']) + { + $name = 'alias'; + } + else + { + // get value from xml + $xml = FieldHelper::safe( + $this->placeholder->update_( + GetHelper::between( + $field['settings']->xml, 'name="', '"' + ) + ) + ); + // check if a value was found + if (StringHelper::check($xml)) + { + $name = $xml; + } + } + // exit foreach loop + break; + } + } + } + + // return the value unique + if (StringHelper::check($listViewName) && isset($field['hash'])) + { + $this->unique[$listViewName . $amicably . $field['hash']] + = $this->uniqueName->get($name, $listViewName . $amicably); + + // now return the unique name + return $this->unique[$listViewName . $amicably . $field['hash']]; + } + + // fall back to global + return $name; + } + +} + diff --git a/src/9387215f-a965-4421-acf3-5e8f9d11382f/settings.json b/src/9387215f-a965-4421-acf3-5e8f9d11382f/settings.json new file mode 100644 index 0000000..7303e54 --- /dev/null +++ b/src/9387215f-a965-4421-acf3-5e8f9d11382f/settings.json @@ -0,0 +1,53 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "9387215f-a965-4421-acf3-5e8f9d11382f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Name", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.Name", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "a8935cbe-7701-40dc-bfd5-675f2d600954", + "as": "default" + }, + "use_selection4": { + "use": "9ef0eb24-aae4-4f5a-99af-d724db44808f", + "as": "default" + }, + "use_selection5": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection6": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection7": { + "use": "8c018533-e967-4bf2-9bd9-9e92966fcb5e", + "as": "default" + }, + "use_selection8": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Name", + "description": "Compiler Field Name\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/README.md b/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/README.md new file mode 100644 index 0000000..a14352b --- /dev/null +++ b/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/README.md @@ -0,0 +1,133 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Parser (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power** +```uml +@startuml +class Parser << (F,LightGreen) >> #Green { + + code(string $code) : array + - properties(string $code) : ?array + - methods(string $code) : ?array + - extractDocBlock(string $code, string $declaration) : ?string + - extractFunctionArgumentDetails(?string $comment, ?string $arguments) : ?array + - extractReturnType(?string $returnType, ?string $comment) : ?string + - extractArgTypesFromComment(string $comment) : ?array + - extractArgTypesArguments(?string $arguments) : ?array + - extractReturnTypeFromComment(string $comment) : ?string + - extractSinceVersion(?string $comment) : ?string + - extractDeprecatedVersion(?string $comment) : ?string + - removeWhiteSpaceFromComment(string $comment) : string + - mergeArgumentTypes(array $argTypesFromDeclaration, ?array $argTypesFromComments) : array +} + +note right of Parser::code + Get properties and method declarations and other details from the given code. + + since: 3.2.0 + return: array +end note + +note left of Parser::properties + Extracts properties declarations and other details from the given code. + + since: 3.2.0 + return: ?array +end note + +note right of Parser::methods + Extracts method declarations and other details from the given code. + + since: 3.2.0 + return: ?array +end note + +note left of Parser::extractDocBlock + Extracts the PHPDoc block for a given function declaration. + + since: 3.2.0 + return: ?string +end note + +note right of Parser::extractFunctionArgumentDetails + Extracts the function argument details. + + since: 3.2.0 + return: ?array +end note + +note left of Parser::extractReturnType + Extracts the function return type. + + since: 3.2.0 + return: ?string +end note + +note right of Parser::extractArgTypesFromComment + Extracts argument types from a given comment. + + since: 3.2.0 + return: ?array +end note + +note left of Parser::extractArgTypesArguments + Extracts argument types from a given declaration. + + since: 3.2.0 + return: ?array +end note + +note right of Parser::extractReturnTypeFromComment + Extracts return type from a given declaration. + + since: 3.2.0 + return: ?string +end note + +note left of Parser::extractSinceVersion + Extracts the version number from the @since tag in the given comment. + + since: 3.2.0 + return: ?string +end note + +note right of Parser::extractDeprecatedVersion + Extracts the version number from the deprecated tag in the given comment. + + since: 3.2.0 + return: ?string +end note + +note left of Parser::removeWhiteSpaceFromComment + Remove all white space from each line of the comment + + since: 3.2.0 + return: string +end note + +note right of Parser::mergeArgumentTypes + Merges the types from the comments and the arguments. + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php b/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php new file mode 100644 index 0000000..e917fe5 --- /dev/null +++ b/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php @@ -0,0 +1,432 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power; + + +/** + * Compiler Power Parser + * Very basic php class methods parser, does not catch all edge-cases! + * Use this only on code that are following standard good practices + * Suggested improvements are welcome + * @since 3.2.0 + */ +final class Parser +{ + /** + * Get properties and method declarations and other details from the given code. + * + * @param string $code The code containing class properties & methods + * + * @return array An array of properties & method declarations of the given code + * @since 3.2.0 + */ + public function code(string $code): array + { + return [ + 'properties' => $this->properties($code), + 'methods' => $this->methods($code) + ]; + } + + /** + * Extracts properties declarations and other details from the given code. + * + * @param string $code The code containing class properties + * + * @return array|null An array of properties declarations and details + * @since 3.2.0 + */ + private function properties(string $code): ?array + { + // regex to target all properties + $access = '(?var|public|protected|private)'; + $type = '(?(?:\?|)[\p{L}0-9\\\\]*\s+)?'; + $static = '(?static)?'; + $name = '\$(?\p{L}[\p{L}0-9]*)'; + $default = '(?:\s*=\s*(?\[[^\]]*\]|\d+|\'[^\']*?\'|"[^"]*?"|false|true|null))?'; + $property_pattern = "/\b{$access}\s*{$type}{$static}\s*{$name}{$default};/u"; + + preg_match_all($property_pattern, $code, $matches, PREG_SET_ORDER); + + if ($matches != []) + { + $properties = []; + foreach ($matches as $n => $match) + { + $declaration = $match[0] ?? null; + + if (is_string($declaration)) + { + $comment = $this->extractDocBlock($code, $declaration); + $declaration = trim(preg_replace('/\s{2,}/', ' ', + preg_replace('/[\r\n]+/', ' ', $declaration))); + + $properties[] = [ + 'name' => isset($match['name']) ? '$' . $match['name'] : 'error', + 'access' => $match['access'] ?? 'public', + 'type' => isset($match['type']) ? trim($match['type']) : null, + 'static' => (bool) $match['static'] ?? false, + 'default' => $match['default'] ?? null, + 'comment' => $comment, + 'declaration' => $declaration + ]; + } + } + + return $properties; + } + + return null; + } + + /** + * Extracts method declarations and other details from the given code. + * + * @param string $code The code containing class methods + * + * @return array|null An array of method declarations and details + * @since 3.2.0 + */ + private function methods(string $code): ?array + { + // regex to target all methods/functions + $final_modifier = '(?Pfinal)?\s*'; + $abstract_modifier = '(?Pabstract)?\s*'; + $access_modifier = '(?Ppublic|protected|private)?\s*'; + $static_modifier = '(?Pstatic)?\s*'; + $modifier = "{$final_modifier}{$abstract_modifier}{$access_modifier}{$static_modifier}"; + $name = '(?P\w+)'; + $arguments = '(?P\(.*?\))?'; + $return_type = '(?P\s*:\s*(?:\?[\w\\\\]+|\\\\?[\w\\\\]+(?:\|\s*(?:\?[\w\\\\]+|\\\\?[\w\\\\]+))*)?)?'; + $method_pattern = "/(^\s*?\b{$modifier}function\s+{$name}{$arguments}{$return_type})/sm"; + + preg_match_all($method_pattern, $code, $matches, PREG_SET_ORDER); + + if ($matches != []) + { + $methods = []; + foreach ($matches as $n => $match) + { + $full_declaration = $match[0] ?? null; + + if (is_string($full_declaration)) + { + $comment = $this->extractDocBlock($code, $full_declaration); + + $full_declaration = trim(preg_replace('/\s{2,}/', ' ', + preg_replace('/[\r\n]+/', ' ', $full_declaration))); + + // now load what we found + $methods[] = [ + 'name' => $match['name'] ?? 'error', + 'access' => $match['access_modifier'] ?? 'public', + 'static' => (bool) $match['static_modifier'] ?? false, + 'final' => (bool) $match['final_modifier'] ?? false, + 'abstract' => (bool) $match['abstract_modifier'] ?? false, + 'return_type' => $this->extractReturnType($match['return_type'] ?? null, $comment), + 'since' => $this->extractSinceVersion($comment), + 'deprecated' => $this->extractDeprecatedVersion($comment), + 'arguments' => $this->extractFunctionArgumentDetails($comment, $match['arguments'] ?? null), + 'comment' => $comment, + 'declaration' => str_replace(["\r\n", "\r", "\n"], '', $full_declaration) + ]; + } + } + + return $methods; + } + + return null; + } + + /** + * Extracts the PHPDoc block for a given function declaration. + * + * @param string $code The source code containing the function + * @param string $declaration The part of the function declaration + * + * @return string|null The PHPDoc block, or null if not found + * @since 3.2.0 + */ + private function extractDocBlock(string $code, string $declaration): ?string + { + // Split the code string with the function declaration + $parts = explode($declaration, $code); + if (count($parts) < 2) + { + // Function declaration not found in the code + return null; + } + + // Get the part with the comment (if any) + $comment = $parts[0]; + + // Split the last part using the comment block start marker + $commentParts = preg_split('/(})?\s+(?=\s*\/\*)(\*)?/', $comment); + + // Get the last comment block + $lastCommentPart = end($commentParts); + + // Search for the comment block in the last comment part + if (preg_match('/(\/\*\*[\s\S]*?\*\/)\s*$/u', $lastCommentPart, $matches)) + { + $comment = $matches[1] ?? null; + // check if we actually have a comment + if ($comment) + { + return $this->removeWhiteSpaceFromComment($comment); + } + } + + return null; + } + + /** + * Extracts the function argument details. + * + * @param string|null $comment The function comment if found + * @param string|null $arguments The arguments found on function declaration + * + * @return array|null The function argument details + * @since 3.2.0 + */ + private function extractFunctionArgumentDetails(?string $comment, ?string $arguments): ?array + { + $arg_types_from_declaration = $this->extractArgTypesArguments($arguments); + $arg_types_from_comments = null; + + if ($comment) + { + $arg_types_from_comments = $this->extractArgTypesFromComment($comment); + } + + // merge the types + if ($arg_types_from_declaration) + { + return $this->mergeArgumentTypes($arg_types_from_declaration, $arg_types_from_comments); + } + + return null; + } + + /** + * Extracts the function return type. + * + * @param string|null $returnType The return type found in declaration + * @param string|null $comment The function comment if found + * + * @return string|null The function return type + * @since 3.2.0 + */ + private function extractReturnType(?string $returnType, ?string $comment): ?string + { + if ($returnType === null && $comment) + { + return $this->extractReturnTypeFromComment($comment); + } + + return trim(trim($returnType, ':')); + } + + /** + * Extracts argument types from a given comment. + * + * @param string $comment The comment containing the argument types + * + * @return array|null An array of argument types + * @since 3.2.0 + */ + private function extractArgTypesFromComment(string $comment): ?array + { + preg_match_all('/@param\s+((?:[^\s|]+(?:\|)?)+)?\s+\$([^\s]+)/', $comment, $matches, PREG_SET_ORDER); + + if ($matches !== []) + { + $arg_types = []; + + foreach ($matches as $match) + { + $arg = $match[2] ?? null; + $type = $match[1] ?: null; + if (is_string($arg)) + { + $arg_types['$' .$arg] = $type; + } + } + + return $arg_types; + } + + return null; + } + + /** + * Extracts argument types from a given declaration. + * + * @param string|null $arguments The arguments found on function declaration + * + * @return array|null An array of argument types + * @since 3.2.0 + */ + private function extractArgTypesArguments(?string $arguments): ?array + { + if ($arguments) + { + $args = preg_split('/,(?![^()\[\]]*(\)|\]))/', trim($arguments, '()')); + if ($args !== []) + { + $argument_types = []; + foreach ($args as $arg) + { + $eqPos = strpos($arg, '='); + + if ($eqPos !== false) + { + $arg_parts = [ + substr($arg, 0, $eqPos), + substr($arg, $eqPos + 1) + ]; + } + else + { + $arg_parts = [$arg]; + } + + if (preg_match('/(?:(\??(?:\w+|\\\\[\w\\\\]+)(?:\|\s*\??(?:\w+|\\\\[\w\\\\]+))*)\s+)?\$(\w+)/', $arg_parts[0], $arg_matches)) + { + $type = $arg_matches[1] ?: null; + $name = $arg_matches[2] ?: null; + $default = isset($arg_parts[1]) ? preg_replace('/\s{2,}/', ' ', + preg_replace('/[\r\n]+/', ' ', trim($arg_parts[1]))) : null; + + if (is_string($name)) + { + $argument_types['$' . $name] = [ + 'type' => $type, + 'default' => $default, + ]; + } + } + } + + return $argument_types; + } + } + + return null; + } + + /** + * Extracts return type from a given declaration. + * + * @param string $comment The comment containing the return type + * + * @return string|null The return type + * @since 3.2.0 + */ + private function extractReturnTypeFromComment(string $comment): ?string + { + if (preg_match('/@return\s+((?:[^\s|]+(?:\|)?)+)/', $comment, $matches)) + { + return $matches[1] ?: null; + } + + return null; + } + + /** + * Extracts the version number from the @since tag in the given comment. + * + * @param string|null $comment The comment containing the @since tag and version number + * + * @return string|null The extracted version number or null if not found + * @since 3.2.0 + */ + private function extractSinceVersion(?string $comment): ?string + { + if (is_string($comment) && preg_match('/@since\s+(v?\d+(?:\.\d+)*(?:-(?:alpha|beta|rc)\d*)?)/', $comment, $matches)) + { + return $matches[1] ?: null; + } + + return null; + } + + /** + * Extracts the version number from the deprecated tag in the given comment. + * + * @param string|null $comment The comment containing the deprecated tag and version number + * + * @return string|null The extracted version number or null if not found + * @since 3.2.0 + */ + private function extractDeprecatedVersion(?string $comment): ?string + { + if (is_string($comment) && preg_match('/@deprecated\s+(v?\d+(?:\.\d+)*(?:-(?:alpha|beta|rc)\d*)?)/', $comment, $matches)) + { + return $matches[1] ?: null; + } + + return null; + } + + /** + * Remove all white space from each line of the comment + * + * @param string $comment The function declaration containing the return type + * + * @return string The return comment + * @since 3.2.0 + */ + private function removeWhiteSpaceFromComment(string $comment): string + { + // Remove comment markers and leading/trailing whitespace + $comment = preg_replace('/^\/\*\*[\r\n\s]*|[\r\n\s]*\*\/$/m', '', $comment); + $comment = preg_replace('/^[\s]*\*[\s]?/m', '', $comment); + + // Split the comment into lines + $lines = preg_split('/\r\n|\r|\n/', $comment); + + // Remove white spaces from each line + $trimmedLines = array_map('trim', $lines); + + // Join the lines back together + return implode("\n", array_filter($trimmedLines)); + } + + /** + * Merges the types from the comments and the arguments. + * + * @param array $argTypesFromDeclaration An array of argument types and default values from the declaration + * @param array|null $argTypesFromComments An array of argument types from the comments + * + * @return array A merged array of argument information + * @since 3.2.0 + */ + private function mergeArgumentTypes(array $argTypesFromDeclaration, ?array $argTypesFromComments): array + { + $mergedArguments = []; + + foreach ($argTypesFromDeclaration as $name => $declarationInfo) + { + $mergedArguments[$name] = [ + 'name' => $name, + 'type' => $declarationInfo['type'] ?: $argTypesFromComments[$name] ?? null, + 'default' => $declarationInfo['default'] ?: null, + ]; + } + + return $mergedArguments; + } + +} + diff --git a/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json b/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json new file mode 100644 index 0000000..22e2ee6 --- /dev/null +++ b/src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "95d0e03f-24fd-4412-bc2e-f0899fcc3205", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Parser", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Parser", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Parser", + "description": "Compiler Power Parser\r\n Very basic php class methods parser, does not catch all edge-cases!\r\n Use this only on code that are following standard good practices\r\n Suggested improvements are welcome\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/97698747-c2ce-4e09-a470-acf6d8e86281/README.md b/src/97698747-c2ce-4e09-a470-acf6d8e86281/README.md new file mode 100644 index 0000000..25c2e95 --- /dev/null +++ b/src/97698747-c2ce-4e09-a470-acf6d8e86281/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface PlaceholderInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component** +```uml +@startuml +interface PlaceholderInterface #Lavender { + + get() : array +} + +note right of PlaceholderInterface::get + get all System Placeholders + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/97698747-c2ce-4e09-a470-acf6d8e86281/code.php b/src/97698747-c2ce-4e09-a470-acf6d8e86281/code.php new file mode 100644 index 0000000..74ff3f8 --- /dev/null +++ b/src/97698747-c2ce-4e09-a470-acf6d8e86281/code.php @@ -0,0 +1,31 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component; + + +/** + * Component Placeholder Interface + * + * @since 3.2.0 + */ +interface PlaceholderInterface +{ + /** + * get all System Placeholders + * + * @return array The global placeholders + * + * @since 3.2.0 + */ + public function get(): array; +} + diff --git a/src/97698747-c2ce-4e09-a470-acf6d8e86281/settings.json b/src/97698747-c2ce-4e09-a470-acf6d8e86281/settings.json new file mode 100644 index 0000000..c455146 --- /dev/null +++ b/src/97698747-c2ce-4e09-a470-acf6d8e86281/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "97698747-c2ce-4e09-a470-acf6d8e86281", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "PlaceholderInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Component.PlaceholderInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Component.PlaceholderInterface", + "description": "Component Placeholder Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/README.md b/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/README.md new file mode 100644 index 0000000..226a37d --- /dev/null +++ b/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/README.md @@ -0,0 +1,50 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class DatabaseName (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class DatabaseName #Gold { + # Registry $registry + + __construct(?Registry $registry = null) + + get(string $nameListCode, int $fieldId, ...) : ?string +} + +note right of DatabaseName::__construct + Constructor + + since: 3.2.0 +end note + +note right of DatabaseName::get + get the field database name and AS prefix + + since: 3.2.0 + return: ?string + + arguments: + string $nameListCode + int $fieldId + string $targetArea = 'builder.list' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/code.php b/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/code.php new file mode 100644 index 0000000..345146e --- /dev/null +++ b/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/code.php @@ -0,0 +1,102 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Registry; + + +/** + * Compiler Field Database Name + * + * @since 3.2.0 + */ +class DatabaseName +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $config The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * get the field database name and AS prefix + * + * @param string $nameListCode The list view name + * @param int $fieldId The field ID + * @param string $targetArea The area being targeted + * + * @return string|null + * @since 3.2.0 + */ + public function get(string $nameListCode, int $fieldId, string $targetArea = 'builder.list'): ?string + { + if (($fields = $this->registry->get("${targetArea}.${nameListCode}")) !== null) + { + if ($fieldId < 0) + { + switch ($fieldId) + { + case -1: + return 'a.id'; + case -2: + return 'a.ordering'; + case -3: + return 'a.published'; + } + } + foreach ($fields as $field) + { + if ($field['id'] == $fieldId) + { + // now check if this is a category + if ($field['type'] === 'category') + { + return 'c.title'; + } + // set the custom code + elseif (ArrayHelper::check( + $field['custom'] + )) + { + return $field['custom']['db'] . "." + . $field['custom']['text']; + } + else + { + return 'a.' . $field['code']; + } + } + } + } + + return null; + } + +} + diff --git a/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/settings.json b/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/settings.json new file mode 100644 index 0000000..17098e2 --- /dev/null +++ b/src/99368a6f-2f64-4d4e-ad3a-544d4020ecc6/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "99368a6f-2f64-4d4e-ad3a-544d4020ecc6", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "DatabaseName", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.DatabaseName", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.DatabaseName", + "description": "Compiler Field Database Name\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/README.md b/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/README.md new file mode 100644 index 0000000..85209ed --- /dev/null +++ b/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Joomlaplugin (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Joomlaplugin #Gold { + + register(Container $container) : void + + getData(Container $container) : Data + + getStructure(Container $container) : Structure +} + +note right of Joomlaplugin::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Joomlaplugin::getData + Get the Joomla Plugin Data + + since: 3.2.0 + return: Data +end note + +note right of Joomlaplugin::getStructure + Get the Joomla Plugin Structure Builder + + since: 3.2.0 + return: Structure +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php b/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php new file mode 100644 index 0000000..a8343f1 --- /dev/null +++ b/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php @@ -0,0 +1,92 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Data; +use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure; + + +/** + * Joomla Plugin Service Provider + * + * @since 3.2.0 + */ +class Joomlaplugin implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Data::class, 'Joomlaplugin.Data') + ->share('Joomlaplugin.Data', [$this, 'getData'], true); + + $container->alias(Structure::class, 'Joomlaplugin.Structure') + ->share('Joomlaplugin.Structure', [$this, 'getStructure'], true); + } + + /** + * Get the Joomla Plugin Data + * + * @param Container $container The DI container. + * + * @return Data + * @since 3.2.0 + */ + public function getData(Container $container): Data + { + return new Data( + $container->get('Config'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Field'), + $container->get('Field.Name'), + $container->get('Model.Filesfolders') + ); + } + + /** + * Get the Joomla Plugin Structure Builder + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Joomlaplugin.Data'), + $container->get('Component'), + $container->get('Config'), + $container->get('Registry'), + $container->get('Customcode.Dispenser'), + $container->get('Event'), + $container->get('Utilities.Counter'), + $container->get('Utilities.Folder'), + $container->get('Utilities.File'), + $container->get('Utilities.Files') + ); + } + +} + diff --git a/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json b/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json new file mode 100644 index 0000000..77bedaf --- /dev/null +++ b/src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "9eba241c-af90-42dd-ae05-92ff4d8391d3", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Joomlaplugin", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Joomlaplugin", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "766a9524-37df-4604-91a7-b98a6150ee26", + "as": "default" + }, + "use_selection1": { + "use": "a900b836-f2eb-4f13-8f28-b7cac839c7ff", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Joomlaplugin", + "description": "Joomla Plugin Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/README.md b/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/README.md new file mode 100644 index 0000000..ca382ff --- /dev/null +++ b/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Language (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Language #Gold { + + register(Container $container) : void + + getLanguage(Container $container) : CompilerLanguage + + getLanguageExtractor(Container $container) : Extractor +} + +note right of Language::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Language::getLanguage + Get the Compiler Language + + since: 3.2.0 + return: CompilerLanguage +end note + +note right of Language::getLanguageExtractor + Get the Compiler Language Extractor + + since: 3.2.0 + return: Extractor +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php b/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php new file mode 100644 index 0000000..de702b8 --- /dev/null +++ b/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Language as CompilerLanguage; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; + + +/** + * Compiler Language Service Provider + * + * @since 3.2.0 + */ +class Language implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerLanguage::class, 'Language') + ->share('Language', [$this, 'getLanguage'], true); + + $container->alias(Extractor::class, 'Language.Extractor') + ->share('Language.Extractor', [$this, 'getLanguageExtractor'], true); + } + + /** + * Get the Compiler Language + * + * @param Container $container The DI container. + * + * @return CompilerLanguage + * @since 3.2.0 + */ + public function getLanguage(Container $container): CompilerLanguage + { + return new CompilerLanguage( + $container->get('Config') + ); + } + + /** + * Get the Compiler Language Extractor + * + * @param Container $container The DI container. + * + * @return Extractor + * @since 3.2.0 + */ + public function getLanguageExtractor(Container $container): Extractor + { + return new Extractor( + $container->get('Config'), + $container->get('Language'), + $container->get('Placeholder') + ); + } + +} + diff --git a/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json b/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json new file mode 100644 index 0000000..4d6ec48 --- /dev/null +++ b/src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "9f00e793-86f8-4ef9-b775-a3eb129f83c0", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Language", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Language", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "CompilerLanguage" + }, + "use_selection1": { + "use": "d33b9278-c409-4aec-a047-b72f56712391", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Language", + "description": "Compiler Language Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/a356d103-74f3-49ca-8e4f-3bd37746f089/README.md b/src/a356d103-74f3-49ca-8e4f-3bd37746f089/README.md new file mode 100644 index 0000000..c2cdf45 --- /dev/null +++ b/src/a356d103-74f3-49ca-8e4f-3bd37746f089/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customcode (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class Customcode #Gold { + # array $views + # Dispenser $dispenser + + __construct(?Dispenser $dispenser = null) + + update(int $id, object $field, ...) : void +} + +note right of Customcode::__construct + Constructor + + since: 3.2.0 +end note + +note right of Customcode::update + Update field customcode + + since: 3.2.0 + return: void + + arguments: + int $id + object $field + string|null $singleViewName = null + string|null $listViewName = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a356d103-74f3-49ca-8e4f-3bd37746f089/code.php b/src/a356d103-74f3-49ca-8e4f-3bd37746f089/code.php new file mode 100644 index 0000000..b5dc015 --- /dev/null +++ b/src/a356d103-74f3-49ca-8e4f-3bd37746f089/code.php @@ -0,0 +1,232 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; + + +/** + * Compiler Field Customcode + * + * @since 3.2.0 + */ +class Customcode +{ + /** + * Tracking the update of fields per/view + * + * @var array + * @since 3.2.0 + */ + protected array $views; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser object. + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Update field customcode + * + * @param int $id The field id + * @param object $field The field object + * @param string|null $singleViewName The view edit or single name + * @param string|null $listViewName The view list name + * + * @return void + * @since 3.2.0 + */ + public function update(int $id, object &$field, $singleViewName = null, $listViewName = null) + { + // check if we should load scripts for single view + if ($singleViewName && StringHelper::check($singleViewName) + && !isset($this->views[$singleViewName][$id])) + { + // add_javascript_view_footer + if ($field->add_javascript_view_footer == 1 + && StringHelper::check( + $field->javascript_view_footer + )) + { + $convert__ = true; + if (isset($field->javascript_view_footer_decoded) + && $field->javascript_view_footer_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->javascript_view_footer, + 'view_footer', + $singleViewName, + null, + array( + 'table' => 'field', + 'id' => (int) $id, + 'field' => 'javascript_view_footer', + 'type' => 'js', + 'prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->javascript_view_footer_decoded)) + { + $field->javascript_view_footer_decoded + = true; + } + + if (strpos((string) $field->javascript_view_footer, "token") !== false + || strpos((string) $field->javascript_view_footer, "task=ajax") !== false) + { + if (!isset($this->dispenser->hub['token'])) + { + $this->dispenser->hub['token'] = []; + } + if (!isset($this->dispenser->hub['token'][$singleViewName]) + || !$this->dispenser->hub['token'][$singleViewName]) + { + $this->dispenser->hub['token'][$singleViewName] + = true; + } + } + } + + // add_css_view + if ($field->add_css_view == 1) + { + $convert__ = true; + if (isset($field->css_view_decoded) + && $field->css_view_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->css_view, + 'css_view', + $singleViewName, + null, + array('prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->css_view_decoded)) + { + $field->css_view_decoded = true; + } + } + + // add this only once to single view. + $this->views[$singleViewName][$id] = true; + } + + // check if we should load scripts for list views + if ($listViewName && StringHelper::check($listViewName) + && !isset($this->views[$listViewName][$id])) + { + // add_javascript_views_footer + if ($field->add_javascript_views_footer == 1 + && StringHelper::check( + $field->javascript_views_footer + )) + { + $convert__ = true; + if (isset($field->javascript_views_footer_decoded) + && $field->javascript_views_footer_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->javascript_views_footer, + 'views_footer', + $singleViewName, + null, + array( + 'table' => 'field', + 'id' => (int) $id, + 'field' => 'javascript_views_footer', + 'type' => 'js', + 'prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->javascript_views_footer_decoded)) + { + $field->javascript_views_footer_decoded = true; + } + if (strpos((string) $field->javascript_views_footer, "token") !== false + || strpos((string) $field->javascript_views_footer, "task=ajax") !== false) + { + if (!isset($this->dispenser->hub['token'])) + { + $this->dispenser->hub['token'] = []; + } + if (!isset($this->dispenser->hub['token'][$listViewName]) + || !$this->dispenser->hub['token'][$listViewName]) + { + $this->dispenser->hub['token'][$listViewName] + = true; + } + } + } + + // add_css_views + if ($field->add_css_views == 1) + { + $convert__ = true; + if (isset($field->css_views_decoded) + && $field->css_views_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->css_views, + 'css_views', + $singleViewName, + null, + array('prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->css_views_decoded)) + { + $field->css_views_decoded = true; + } + } + + // add this only once to list view. + $this->views[$listViewName][$id] = true; + } + } + +} + diff --git a/src/a356d103-74f3-49ca-8e4f-3bd37746f089/settings.json b/src/a356d103-74f3-49ca-8e4f-3bd37746f089/settings.json new file mode 100644 index 0000000..67065b0 --- /dev/null +++ b/src/a356d103-74f3-49ca-8e4f-3bd37746f089/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "a356d103-74f3-49ca-8e4f-3bd37746f089", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Customcode", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.Customcode", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Customcode", + "description": "Compiler Field Customcode\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/README.md b/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/README.md new file mode 100644 index 0000000..90412bb --- /dev/null +++ b/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface LockBaseInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode** +```uml +@startuml +interface LockBaseInterface #Lavender { + + set(string $script) : string +} + +note right of LockBaseInterface::set + Set a string as bsae64 (basic) + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/code.php b/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/code.php new file mode 100644 index 0000000..f892db1 --- /dev/null +++ b/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/code.php @@ -0,0 +1,32 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; + + +/** + * Customcode LockBase Interface + * + * @since 3.2.0 + */ +interface LockBaseInterface +{ + /** + * Set a string as bsae64 (basic) + * + * @param string $script The code string + * + * @return string + * @since 3.2.0 + */ + public function set(string $script): string; +} + diff --git a/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/settings.json b/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/settings.json new file mode 100644 index 0000000..344f8e2 --- /dev/null +++ b/src/a3c515f5-4adf-4eb3-b637-0a1add550da6/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "a3c515f5-4adf-4eb3-b637-0a1add550da6", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "LockBaseInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Customcode.LockBaseInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Customcode.LockBaseInterface", + "description": "Customcode LockBase Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/README.md b/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/README.md new file mode 100644 index 0000000..517b776 --- /dev/null +++ b/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Indent (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +abstract Indent #Orange { + + {static} _(int $nr) : string + - {static} indent() : string + - {static} init() : void +} + +note right of Indent::_ + Set the space + + since: 3.2.0 + return: string +end note + +note right of Indent::indent + Get the indentation string + + since: 3.2.0 + return: string +end note + +note right of Indent::init + The constructor for indent + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/code.php b/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/code.php new file mode 100644 index 0000000..6f6af75 --- /dev/null +++ b/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/code.php @@ -0,0 +1,90 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; + + +/** + * The Indentation Factory + * + * @since 3.2.0 + */ +abstract class Indent +{ + /** + * Spacer bucket (to speed-up the build) + * + * @var array + * @since 3.2.0 + */ + private static array $bucket = []; + + /** + * The indentation string + * + * @var string + * @since 3.2.0 + */ + private static string $indent; + + /** + * Set the space + * + * @param int $nr The number of spaces + * + * @return string + * @since 3.2.0 + */ + public static function _(int $nr): string + { + // check if we already have the string + if (!isset(self::$bucket[$nr])) + { + // get the string + self::$bucket[$nr] = str_repeat(self::indent(), (int) $nr); + } + // return stored indentation + return self::$bucket[$nr]; + } + + /** + * Get the indentation string + * + * @return string + * @since 3.2.0 + */ + private static function indent(): string + { + if (empty(self::$indent)) + { + self::init(); + } + + return self::$indent; + } + + /** + * The constructor for indent + * + * @return void + * @since 3.2.0 + */ + private static function init() + { + // the default is TAB + self::$indent = Compiler::_('Config')->indentation_value; + } + +} + diff --git a/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/settings.json b/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/settings.json new file mode 100644 index 0000000..47dde62 --- /dev/null +++ b/src/a68c010b-e92e-47d5-8a44-d23cfddeb6c6/settings.json @@ -0,0 +1,21 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Indent", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Indent", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Indent", + "description": "The Indentation Factory\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/a6cdd935-c038-4a54-8446-54bed87f003c/README.md b/src/a6cdd935-c038-4a54-8446-54bed87f003c/README.md new file mode 100644 index 0000000..3928d0e --- /dev/null +++ b/src/a6cdd935-c038-4a54-8446-54bed87f003c/README.md @@ -0,0 +1,208 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface PlaceholderInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface PlaceholderInterface #Lavender { + + set(string $key, mixed $value, ...) : void + + get(string $key) : mixed + + exist(string $key) : bool + + add(string $key, mixed $value, ...) : void + + remove(string $key) : void + + set_(string $key, mixed $value) : void + + get_(string $key) : mixed + + exist_(string $key) : bool + + add_(string $key, mixed $value) : void + + remove_(string $key) : void + + set_h(string $key, mixed $value) : void + + get_h(string $key) : mixed + + exist_h(string $key) : bool + + add_h(string $key, mixed $value) : void + + remove_h(string $key) : void + + setType(string $key, array $values) : void + + clearType(string $key) : void + + update(string $data, array $placeholder, ...) : string + + update_(string $data) : string + + keys(int $type, ?int $id = null) : array +} + +note right of PlaceholderInterface::set + Set content + + since: 3.2.0 + return: void + + arguments: + string $key + mixed $value + bool $hash = true +end note + +note left of PlaceholderInterface::get + Get content by key + + since: 3.2.0 + return: mixed +end note + +note right of PlaceholderInterface::exist + Does key exist at all in any variation + + since: 3.2.0 + return: bool +end note + +note left of PlaceholderInterface::add + Add content + + since: 3.2.0 + return: void + + arguments: + string $key + mixed $value + bool $hash = true +end note + +note right of PlaceholderInterface::remove + Remove content + + since: 3.2.0 + return: void +end note + +note left of PlaceholderInterface::set_ + Set content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: void +end note + +note right of PlaceholderInterface::get_ + Get content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: mixed +end note + +note left of PlaceholderInterface::exist_ + Does key exist with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: bool +end note + +note right of PlaceholderInterface::add_ + Add content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: void +end note + +note left of PlaceholderInterface::remove_ + Remove content with [ [ [ ... ] ] ] hash + + since: 3.2.0 + return: void +end note + +note right of PlaceholderInterface::set_h + Set content with # # # hash + + since: 3.2.0 + return: void +end note + +note left of PlaceholderInterface::get_h + Get content with # # # hash + + since: 3.2.0 + return: mixed +end note + +note right of PlaceholderInterface::exist_h + Does key exist with # # # hash + + since: 3.2.0 + return: bool +end note + +note left of PlaceholderInterface::add_h + Add content with # # # hash + + since: 3.2.0 + return: void +end note + +note right of PlaceholderInterface::remove_h + Remove content with # # # hash + + since: 3.2.0 + return: void +end note + +note left of PlaceholderInterface::setType + Set a type of placeholder with set of values + + since: 3.2.0 + return: void +end note + +note right of PlaceholderInterface::clearType + Remove a type of placeholder by main key + + since: 3.2.0 + return: void +end note + +note left of PlaceholderInterface::update + Update the data with the placeholders +THE ACTION OPTIONS ARE +1 -> Just replace (default) +2 -> Check if data string has placeholders +3 -> Remove placeholders not in data string + + since: 3.2.0 + return: string + + arguments: + string $data + array $placeholder + int $action = 1 +end note + +note right of PlaceholderInterface::update_ + Update the data with the active placeholders + + since: 3.2.0 + return: string +end note + +note left of PlaceholderInterface::keys + return the placeholders for inserted and replaced code + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a6cdd935-c038-4a54-8446-54bed87f003c/code.php b/src/a6cdd935-c038-4a54-8446-54bed87f003c/code.php new file mode 100644 index 0000000..d0ba2d2 --- /dev/null +++ b/src/a6cdd935-c038-4a54-8446-54bed87f003c/code.php @@ -0,0 +1,240 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler Placeholder Interface + * + * @since 3.2.0 + */ +interface PlaceholderInterface +{ + /** + * Set content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, $value, bool $hash = true); + + /** + * Get content by key + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $key); + + /** + * Does key exist at all in any variation + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $key): bool; + + /** + * Add content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function add(string $key, $value, bool $hash = true); + + /** + * Remove content + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove(string $key); + + /** + * Set content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_(string $key, $value); + + /** + * Get content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_(string $key); + + /** + * Does key exist with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_(string $key): bool; + + /** + * Add content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_(string $key, $value); + + /** + * Remove content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_(string $key); + + /** + * Set content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_h(string $key, $value); + + /** + * Get content with # # # hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_h(string $key); + + /** + * Does key exist with # # # hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_h(string $key): bool; + + /** + * Add content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_h(string $key, $value); + + /** + * Remove content with # # # hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_h(string $key); + + /** + * Set a type of placeholder with set of values + * + * @param string $key The main string for placeholder key + * @param array $values The values to add + * + * @return void + * @since 3.2.0 + */ + public function setType(string $key, array $values); + + /** + * Remove a type of placeholder by main key + * + * @param string $key The main string for placeholder key + * + * @return void + * @since 3.2.0 + */ + public function clearType(string $key); + + /** + * Update the data with the placeholders + * + * @param string $data The actual data + * @param array $placeholder The placeholders + * @param int $action The action to use + * + * THE ACTION OPTIONS ARE + * 1 -> Just replace (default) + * 2 -> Check if data string has placeholders + * 3 -> Remove placeholders not in data string + * + * @return string + * @since 3.2.0 + */ + public function update(string $data, array $placeholder, int $action = 1): string; + + /** + * Update the data with the active placeholders + * + * @param string $data The actual data + * + * @return string + * @since 3.2.0 + */ + public function update_(string $data): string; + + /** + * return the placeholders for inserted and replaced code + * + * @param int $type The type of placement + * @param int|null $id The code id in the system + * + * @return array with start and end keys + * @since 3.2.0 + */ + public function keys(int $type, ?int $id = null): array; + +} + diff --git a/src/a6cdd935-c038-4a54-8446-54bed87f003c/settings.json b/src/a6cdd935-c038-4a54-8446-54bed87f003c/settings.json new file mode 100644 index 0000000..724226e --- /dev/null +++ b/src/a6cdd935-c038-4a54-8446-54bed87f003c/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "Registry", + "guid": "a6cdd935-c038-4a54-8446-54bed87f003c", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "PlaceholderInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.PlaceholderInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.PlaceholderInterface", + "description": "Compiler Placeholder Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md new file mode 100644 index 0000000..614e877 --- /dev/null +++ b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/README.md @@ -0,0 +1,59 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Sqldump (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Sqldump #Gold { + # Registry $registry + # \JDatabaseDriver $db + + __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + + get(array $tables, string $view, ...) : ?string + # escape(string|array $value) : string|array +} + +note right of Sqldump::__construct + Constructor + + since: 3.2.0 +end note + +note right of Sqldump::get + Get SQL Dump + + since: 3.2.0 + return: ?string + + arguments: + array $tables + string $view + int $view_id +end note + +note right of Sqldump::escape + Escape the values for a SQL dump + + since: 3.2.0 + return: string|array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php new file mode 100644 index 0000000..e6ed675 --- /dev/null +++ b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/code.php @@ -0,0 +1,321 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * SQL Dump Class + * + * @since 3.2.0 + */ +class Sqldump +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * @param \JDatabaseDriver|null $db The database object. + + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get SQL Dump + * + * @param array $tables The tables to use in build + * @param string $view The target view/table to dump in + * @param int $view_id The id of the target view + * + * @return string|null The data found with the alias + * @since 3.2.0 + */ + public function get(array $tables, string $view, int $view_id): ?string + { + // first build a query statement to get all the data (insure it must be added - check the tweaking) + if (ArrayHelper::check($tables) + && $this->registry-> // default is to add + get('builder.sql_tweak.' . (int) $view_id . '.add', true)) + { + $counter = 'a'; + + // Create a new query object. + $query = $this->db->getQuery(true); + + // switch to only trigger the run of the query if we have tables to query + $run_query = false; + foreach ($tables as $table) + { + if (isset($table['table'])) + { + if ($counter === 'a') + { + // the main table fields + if (strpos((string) $table['sourcemap'], PHP_EOL) !== false) + { + $fields = explode(PHP_EOL, (string) $table['sourcemap']); + if (ArrayHelper::check($fields)) + { + // reset array buckets + $sourceArray = []; + $targetArray = []; + foreach ($fields as $field) + { + if (strpos($field, "=>") !== false) + { + list($source, $target) = explode( + "=>", $field + ); + $sourceArray[] = $counter . '.' . trim( + $source + ); + $targetArray[] = trim($target); + } + } + if (ArrayHelper::check( + $sourceArray + ) + && ArrayHelper::check( + $targetArray + )) + { + // add to query + $query->select( + $this->db->quoteName( + $sourceArray, $targetArray + ) + ); + $query->from( + '#__' . $table['table'] . ' AS a' + ); + $run_query = true; + } + // we may need to filter the selection + if (($ids_ = $this->registry-> + get('builder.sql_tweak.' . (int) $view_id . '.where', null)) !== null) + { + // add to query the where filter + $query->where( + 'a.id IN (' . $ids_ . ')' + ); + } + } + } + } + else + { + // the other tables + if (strpos((string) $table['sourcemap'], PHP_EOL) !== false) + { + $fields = explode(PHP_EOL, (string) $table['sourcemap']); + if (ArrayHelper::check($fields)) + { + // reset array buckets + $sourceArray = []; + $targetArray = []; + foreach ($fields as $field) + { + if (strpos($field, "=>") !== false) + { + list($source, $target) = explode( + "=>", $field + ); + $sourceArray[] = $counter . '.' . trim( + $source + ); + $targetArray[] = trim($target); + } + if (strpos($field, "==") !== false) + { + list($aKey, $bKey) = explode( + "==", $field + ); + // add to query + $query->join( + 'LEFT', $this->db->quoteName( + '#__' . $table['table'], + $counter + ) . ' ON (' . $this->db->quoteName( + 'a.' . trim($aKey) + ) . ' = ' . $this->db->quoteName( + $counter . '.' . trim($bKey) + ) . ')' + ); + } + } + if (ArrayHelper::check( + $sourceArray + ) + && ArrayHelper::check( + $targetArray + )) + { + // add to query + $query->select( + $this->db->quoteName( + $sourceArray, $targetArray + ) + ); + } + } + } + } + $counter++; + } + else + { + // see where + // var_dump($view); + // jexit(); + } + } + + // check if we should run query + if ($run_query) + { + // now get the data + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // get the data + $data = $this->db->loadObjectList(); + + // start building the MySql dump + $dump = "--"; + $dump .= PHP_EOL . "-- Dumping data for table `#__" + . Placefix::_("component") . "_" . $view + . "`"; + $dump .= PHP_EOL . "--"; + $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . Placefix::_("component") . "_" . $view . "` ("; + foreach ($data as $line) + { + $comaSet = 0; + foreach ($line as $fieldName => $fieldValue) + { + if ($comaSet == 0) + { + $dump .= $this->db->quoteName($fieldName); + } + else + { + $dump .= ", " . $this->db->quoteName( + $fieldName + ); + } + $comaSet++; + } + break; + } + $dump .= ") VALUES"; + $coma = 0; + foreach ($data as $line) + { + if ($coma == 0) + { + $dump .= PHP_EOL . "("; + } + else + { + $dump .= "," . PHP_EOL . "("; + } + $comaSet = 0; + foreach ($line as $fieldName => $fieldValue) + { + if ($comaSet == 0) + { + $dump .= $this->escape($fieldValue); + } + else + { + $dump .= ", " . $this->escape( + $fieldValue + ); + } + $comaSet++; + } + $dump .= ")"; + $coma++; + } + $dump .= ";"; + + // return build dump query + return $dump; + } + } + } + + return null; + } + + /** + * Escape the values for a SQL dump + * + * @param string|array $value the value to escape + * + * @return string|array on success with escaped string + * @since 3.2.0 + */ + protected function escape($value) + { + // if array then return mapped + if (ArrayHelper::check($value)) + { + return array_map(__METHOD__, $value); + } + + // if string make sure it is correctly escaped + if (StringHelper::check($value) && !is_numeric($value)) + { + return $this->db->quote($value); + } + + // if empty value return place holder + if (empty($value)) + { + return "''"; + } + + // if not array or string then return number + return $value; + } + +} + diff --git a/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/settings.json b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/settings.json new file mode 100644 index 0000000..2821b85 --- /dev/null +++ b/src/a6e1227c-1efe-407d-84ef-03c6989a6a88/settings.json @@ -0,0 +1,38 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "a6e1227c-1efe-407d-84ef-03c6989a6a88", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Sqldump", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Sqldump", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection4": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Sqldump", + "description": "SQL Dump Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/README.md b/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/README.md new file mode 100644 index 0000000..46ae1b5 --- /dev/null +++ b/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/README.md @@ -0,0 +1,101 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customcode (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Customcode #Gold { + + register(Container $container) : void + + getCustomcode(Container $container) : CustomcodeInterface + + getExternal(Container $container) : External + + getGui(Container $container) : Gui + + getHash(Container $container) : Hash + + getLockBase(Container $container) : LockBase + + getDispenser(Container $container) : Dispenser + + getPaths(Container $container) : Paths + + getExtractor(Container $container) : Extractor +} + +note right of Customcode::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Customcode::getCustomcode + Get the Compiler Customcode + + since: 3.2.0 + return: CustomcodeInterface +end note + +note right of Customcode::getExternal + Get the Compiler Customcode External + + since: 3.2.0 + return: External +end note + +note left of Customcode::getGui + Get the Compiler Customcode Gui + + since: 3.2.0 + return: Gui +end note + +note right of Customcode::getHash + Get the Customcode Hash + + since: 3.2.0 + return: Hash +end note + +note left of Customcode::getLockBase + Get the Customcode LockBase64 + + since: 3.2.0 + return: LockBase +end note + +note right of Customcode::getDispenser + Get the Customcode Dispenser + + since: 3.2.0 + return: Dispenser +end note + +note left of Customcode::getPaths + Get the Customcode Extractor Paths + + since: 3.2.0 + return: Paths +end note + +note right of Customcode::getExtractor + Get the Customcode Extractor + + since: 3.2.0 + return: Extractor +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/code.php b/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/code.php new file mode 100644 index 0000000..1f9cd21 --- /dev/null +++ b/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/code.php @@ -0,0 +1,208 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customcode as CompilerCustomcode; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\CustomcodeInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\External; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\LockBase; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor\Paths; + + +/** + * Compiler Custom Code Service Provider + * + * @since 3.2.0 + */ +class Customcode implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerCustomcode::class, 'Customcode') + ->share('Customcode', [$this, 'getCustomcode'], true); + + $container->alias(External::class, 'Customcode.External') + ->share('Customcode.External', [$this, 'getExternal'], true); + + $container->alias(Gui::class, 'Customcode.Gui') + ->share('Customcode.Gui', [$this, 'getGui'], true); + + $container->alias(Hash::class, 'Customcode.Hash') + ->share('Customcode.Hash', [$this, 'getHash'], true); + + $container->alias(LockBase::class, 'Customcode.LockBase') + ->share('Customcode.LockBase', [$this, 'getLockBase'], true); + + $container->alias(Dispenser::class, 'Customcode.Dispenser') + ->share('Customcode.Dispenser', [$this, 'getDispenser'], true); + + $container->alias(Paths::class, 'Customcode.Extractor.Paths') + ->share('Customcode.Extractor.Paths', [$this, 'getPaths'], true); + + $container->alias(Extractor::class, 'Customcode.Extractor') + ->share('Customcode.Extractor', [$this, 'getExtractor'], true); + } + + /** + * Get the Compiler Customcode + * + * @param Container $container The DI container. + * + * @return CustomcodeInterface + * @since 3.2.0 + */ + public function getCustomcode(Container $container): CustomcodeInterface + { + return new CompilerCustomcode( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Language.Extractor'), + $container->get('Customcode.External') + ); + } + + /** + * Get the Compiler Customcode External + * + * @param Container $container The DI container. + * + * @return External + * @since 3.2.0 + */ + public function getExternal(Container $container): External + { + return new External( + $container->get('Placeholder') + ); + } + + /** + * Get the Compiler Customcode Gui + * + * @param Container $container The DI container. + * + * @return Gui + * @since 3.2.0 + */ + public function getGui(Container $container): Gui + { + return new Gui( + $container->get('Config'), + $container->get('Placeholder.Reverse') + ); + } + + /** + * Get the Customcode Hash + * + * @param Container $container The DI container. + * + * @return Hash + * @since 3.2.0 + */ + public function getHash(Container $container): Hash + { + return new Hash( + $container->get('Placeholder') + ); + } + + /** + * Get the Customcode LockBase64 + * + * @param Container $container The DI container. + * + * @return LockBase + * @since 3.2.0 + */ + public function getLockBase(Container $container): LockBase + { + return new LockBase( + $container->get('Placeholder') + ); + } + + /** + * Get the Customcode Dispenser + * + * @param Container $container The DI container. + * + * @return Dispenser + * @since 3.2.0 + */ + public function getDispenser(Container $container): Dispenser + { + return new Dispenser( + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Customcode.Hash'), + $container->get('Customcode.LockBase') + ); + } + + /** + * Get the Customcode Extractor Paths + * + * @param Container $container The DI container. + * + * @return Paths + * @since 3.2.0 + */ + public function getPaths(Container $container): Paths + { + return new Paths( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Component.Placeholder'), + $container->get('Customcode'), + $container->get('Language.Extractor') + ); + } + + /** + * Get the Customcode Extractor + * + * @param Container $container The DI container. + * + * @return Extractor + * @since 3.2.0 + */ + public function getExtractor(Container $container): Extractor + { + return new Extractor( + $container->get('Config'), + $container->get('Customcode.Gui'), + $container->get('Customcode.Extractor.Paths'), + $container->get('Placeholder.Reverse'), + $container->get('Component.Placeholder'), + $container->get('Utilities.Pathfix') + ); + } + +} + diff --git a/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/settings.json b/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/settings.json new file mode 100644 index 0000000..dbc8651 --- /dev/null +++ b/src/a74ac3b7-bb79-4639-8f14-54a8021be68b/settings.json @@ -0,0 +1,55 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "a74ac3b7-bb79-4639-8f14-54a8021be68b", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Customcode", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Customcode", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "CompilerCustomcode" + }, + "use_selection1": { + "use": "33bdc535-0ff1-40c8-bb22-b5d44f1731c4", + "as": "default" + }, + "use_selection2": { + "use": "1cef0266-99e2-40d8-919f-c2ce32226b0a", + "as": "default" + }, + "use_selection3": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection4": { + "use": "797579e8-b272-41ed-91de-428cb0b3e089", + "as": "default" + }, + "use_selection5": { + "use": "7c07c9d6-34cd-4491-934a-ef0a83f414c0", + "as": "default" + }, + "use_selection6": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection7": { + "use": "01411bb1-fdd6-4cca-84d7-1b62d93c70c1", + "as": "default" + }, + "use_selection8": { + "use": "053803e6-1251-4aed-aefe-46a8e84198d2", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Customcode", + "description": "Compiler Custom Code Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/README.md b/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/README.md new file mode 100644 index 0000000..d2c79d1 --- /dev/null +++ b/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Relations (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Relations #Gold { + # Config $config + # Registry $registry + # Language $language + # Customcode $customcode + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(object $item) : void +} + +note right of Relations::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Language $language = null + ?Customcode $customcode = null +end note + +note right of Relations::set + Set the relations + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/code.php b/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/code.php new file mode 100644 index 0000000..7fe2a89 --- /dev/null +++ b/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/code.php @@ -0,0 +1,177 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Relations Class + * + * @since 3.2.0 + */ +class Relations +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Language|null $language The compiler Language object. + * @param Customcode|null $customcode The compiler customcode object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Language $language = null, ?Customcode $customcode = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->language = $language ?: Compiler::_('Language'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + } + + /** + * Set the relations + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addrelations = (isset($item->addrelations) + && JsonHelper::check($item->addrelations)) + ? json_decode((string) $item->addrelations, true) : null; + + if (ArrayHelper::check($item->addrelations)) + { + foreach ($item->addrelations as $nr => $relationsValue) + { + // only add if list view field is selected and joined fields are set + if (isset($relationsValue['listfield']) + && is_numeric( + $relationsValue['listfield'] + ) + && $relationsValue['listfield'] > 0 + && isset($relationsValue['area']) + && is_numeric($relationsValue['area']) + && $relationsValue['area'] > 0) + { + // do a dynamic update on the set values + if (isset($relationsValue['set']) + && StringHelper::check( + $relationsValue['set'] + )) + { + $relationsValue['set'] = $this->customcode->update( + $relationsValue['set'] + ); + } + + // load the field relations + $this->registry->set('builder.field_relations.' + . $item->name_list_code . '.' . (int) $relationsValue['listfield'] + . '.' . (int) $relationsValue['area'], $relationsValue); + + // load the list joints + if (isset($relationsValue['joinfields']) + && ArrayHelper::check( + $relationsValue['joinfields'] + )) + { + foreach ($relationsValue['joinfields'] as $join) + { + $this->registry->set('builder.list_join.' . $item->name_list_code . '.' . (int) $join, (int) $join); + } + } + + // set header over-ride + if (isset($relationsValue['column_name']) + && StringHelper::check( + $relationsValue['column_name'] + )) + { + $check_column_name = trim( + strtolower((string) $relationsValue['column_name']) + ); + + // confirm it should really make the over ride + if ('default' !== $check_column_name) + { + $column_name_lang = $this->config->lang_prefix . '_' + . StringHelper::safe( + $item->name_list_code, 'U' + ) . '_' . StringHelper::safe( + $relationsValue['column_name'], 'U' + ); + $this->language->set( + 'admin', $column_name_lang, + $relationsValue['column_name'] + ); + $this->registry->set('builder.list_head_override.' . + $item->name_list_code . '.' . (int) $relationsValue['listfield'], + $column_name_lang + ); + + } + } + } + } + } + + unset($item->addrelations); + } + +} + diff --git a/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/settings.json b/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/settings.json new file mode 100644 index 0000000..0bc8c4d --- /dev/null +++ b/src/a8eb2fb1-88ed-4af8-842d-898eb915b588/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "a8eb2fb1-88ed-4af8-842d-898eb915b588", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Relations", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Relations", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection4": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection5": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection6": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection7": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Relations", + "description": "Model Relations Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md new file mode 100644 index 0000000..68e7e5b --- /dev/null +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/README.md @@ -0,0 +1,74 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structure (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin** +```uml +@startuml +class Structure #Gold { + # Plugin $plugin + # Component $component + # Config $config + # Registry $registry + # Dispenser $dispenser + # EventInterface $event + # Counter $counter + # Folder $folder + # File $file + # Files $files + + __construct(?Plugin $plugin = null, ?Component $component = null, ...) + + build() : void + # getXML($plugin) : string +} + +note right of Structure::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Plugin $plugin = null + ?Component $component = null + ?Config $config = null + ?Registry $registry = null + ?Dispenser $dispenser = null + ?EventInterface $event = null + ?Counter $counter = null + ?Folder $folder = null + ?File $file = null + ?Files $files = null +end note + +note right of Structure::build + Build the Plugins files, folders, url's and config + + since: 3.2.0 + return: void +end note + +note right of Structure::getXML + get the plugin xml template + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php new file mode 100644 index 0000000..f8f2cbc --- /dev/null +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/code.php @@ -0,0 +1,625 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Data as Plugin; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\FileHelper; + + +/** + * Joomla Plugin Builder Class + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Joomla Plugin Data Class + * + * @var Plugin + * @since 3.2.0 + */ + protected Plugin $plugin; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities Folder + * + * @var Folder + * @since 3.2.0 + */ + protected Folder $folder; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Constructor + * + * @param Plugin|null $plugin The compiler Joomla plugin data object. + * @param Component|null $component The component class. + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Dispenser|null $dispenser The compiler customcode dispenser object. + * @param EventInterface|null $event The compiler event api object. + * @param Counter|null $counter The compiler counter object. + * @param Folder|null $folder The compiler folder object. + * @param File|null $file The compiler file object. + * @param Files|null $files The compiler files object. + * + * @since 3.2.0 + */ + public function __construct(?Plugin $plugin = null, ?Component $component = null, + ?Config $config = null, ?Registry $registry = null, + ?Dispenser $dispenser = null, ?EventInterface $event = null, + ?Counter $counter = null, ?Folder $folder = null, + ?File $file = null, ?Files $files = null) + { + $this->plugin = $plugin ?: Compiler::_('Joomlaplugin.Data'); + $this->component = $component ?: Compiler::_('Component'); + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->event = $event ?: Compiler::_('Event'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->folder = $folder ?: Compiler::_('Utilities.Folder'); + $this->file = $file ?: Compiler::_('Utilities.File'); + $this->files = $files ?: Compiler::_('Utilities.Files'); + } + + /** + * Build the Plugins files, folders, url's and config + * + * @return void + * @since 3.2.0 + */ + public function build() + { + if ($this->plugin->exists()) + { + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + $plugins = $this->plugin->get(); + // Trigger Event: jcb_ce_onBeforeSetPlugins + $this->event->trigger( + 'jcb_ce_onBeforeBuildPlugins', + array(&$component_context, &$plugins) + ); + foreach ($plugins as $plugin) + { + if (ObjectHelper::check($plugin) + && isset($plugin->folder_name) + && StringHelper::check( + $plugin->folder_name + )) + { + // plugin path + $plugin->folder_path = $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + . $plugin->folder_name; + + // set the plugin paths + $this->registry->set('dynamic_paths.' . $plugin->key, $plugin->folder_path); + + // make sure there is no old build + $this->folder->remove($plugin->folder_path); + + // creat the main component folder + $this->folder->create($plugin->folder_path); + + // set main class file + $fileDetails = array('path' => $plugin->folder_path . '/' + . $plugin->file_name . '.php', + 'name' => $plugin->file_name . '.php', + 'zip' => $plugin->file_name . '.php'); + $this->file->write( + $fileDetails['path'], + 'files->appendArray($plugin->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // set main xml file + $fileDetails = array('path' => $plugin->folder_path . '/' + . $plugin->file_name . '.xml', + 'name' => $plugin->file_name . '.xml', + 'zip' => $plugin->file_name . '.xml'); + $this->file->write( + $fileDetails['path'], + $this->getXML($plugin) + ); + $this->files->appendArray($plugin->key, $fileDetails); + + // count the file created + $this->counter->file++; + + // set install script if needed + if ($plugin->add_install_script) + { + $fileDetails = [ + 'path' => $plugin->folder_path . '/script.php', + 'name' => 'script.php', + 'zip' => 'script.php' + ]; + $this->file->write( + $fileDetails['path'], + 'files->appendArray($plugin->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + + // set readme if found + if ($plugin->addreadme) + { + $fileDetails = [ + 'path' => $plugin->folder_path . '/README.md', + 'name' => 'README.md', + 'zip' => 'README.md' + ]; + $this->file->write($fileDetails['path'], $plugin->readme); + $this->files->appendArray($plugin->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + + // set fields & rules folders if needed + if (isset($plugin->fields_rules_paths) + && $plugin->fields_rules_paths == 2) + { + // create fields folder + $this->folder->create($plugin->folder_path . '/fields'); + + // create rules folder + $this->folder->create($plugin->folder_path . '/rules'); + } + + // set forms folder if needed + if (isset($plugin->form_files) + && ArrayHelper::check( + $plugin->form_files + )) + { + // create forms folder + $this->folder->create($plugin->folder_path . '/forms'); + + // set the template files + foreach ($plugin->form_files as $file => $fields) + { + // set file details + $fileDetails = [ + 'path' => $plugin->folder_path . '/forms/' . $file . '.xml', + 'name' => $file . '.xml', + 'zip' => 'forms/' . $file . '.xml' + ]; + + // build basic XML + $xml = ''; + $xml .= PHP_EOL . ''; + + // search if we must add the component path + $add_component_path = false; + foreach ($fields as $field_name => $fieldsets) + { + if (!$add_component_path) + { + foreach ($fieldsets as $fieldset => $field) + { + if (!$add_component_path + && isset( + $plugin->fieldsets_paths[$file + . $field_name . $fieldset] + ) + && $plugin->fieldsets_paths[$file + . $field_name . $fieldset] == 1) + { + $add_component_path = true; + } + } + } + } + + // only add if part of the component field types path is required + if ($add_component_path) + { + $xml .= PHP_EOL . ''; + } + else + { + $xml .= PHP_EOL . '
'; + } + + // add the fields + foreach ($fields as $field_name => $fieldsets) + { + // check if we have an double fields naming set + $field_name_inner = ''; + $field_name_outer = $field_name; + if (strpos((string) $field_name, '.') !== false) + { + $field_names = explode('.', (string) $field_name); + if (count((array) $field_names) == 2) + { + $field_name_outer = $field_names[0]; + $field_name_inner = $field_names[1]; + } + } + $xml .= PHP_EOL . Indent::_(1) + . ''; + foreach ($fieldsets as $fieldset => $field) + { + // default to the field set name + $label = $fieldset; + if (isset($plugin->fieldsets_label[$file . $field_name . $fieldset])) + { + $label = $plugin->fieldsets_label[$file . $field_name . $fieldset]; + } + + // add path to plugin rules and custom fields + if (isset($plugin->fieldsets_paths[$file . $field_name . $fieldset]) + && ($plugin->fieldsets_paths[$file . $field_name . $fieldset] == 2 + || $plugin->fieldsets_paths[$file . $field_name . $fieldset] == 3)) + { + if (!isset($plugin->add_rule_path[$file . $field_name . $fieldset])) + { + $plugin->add_rule_path[$file . $field_name . $fieldset] = + '/plugins/' . strtolower((string) $plugin->group + ) . '/' . strtolower((string) $plugin->code_name) + . '/rules'; + } + + if (!isset($plugin->add_field_path[$file . $field_name . $fieldset])) + { + $plugin->add_field_path[$file . $field_name . $fieldset] = + '/plugins/' . strtolower((string) $plugin->group + ) . '/' . strtolower((string) $plugin->code_name) + . '/fields'; + } + } + + // add path to plugin rules and custom fields + if (isset($plugin->add_rule_path[$file . $field_name . $fieldset]) + || isset($plugin->add_field_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . Indent::_(1) . ''; + + $xml .= PHP_EOL . Indent::_(1) . '
add_rule_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . Indent::_(2) + . 'addrulepath="' . $plugin->add_rule_path[$file . $field_name . $fieldset] . '"'; + } + + if (isset($plugin->add_field_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . Indent::_(2) + . 'addfieldpath="' . $plugin->add_field_path[$file . $field_name . $fieldset] . '"'; + } + + $xml .= PHP_EOL . Indent::_(1) . '>'; + } + else + { + $xml .= PHP_EOL . Indent::_(1) . '
'; + } + + // check if we have an inner field set + if (StringHelper::check( + $field_name_inner + )) + { + $xml .= PHP_EOL . Indent::_(1) + . ''; + } + + // add the placeholder of the fields + $xml .= Placefix::_h('FIELDSET_' . $file + . $field_name . $fieldset ); + + // check if we have an inner field set + if (StringHelper::check( + $field_name_inner + )) + { + $xml .= PHP_EOL . Indent::_(1) + . ''; + } + $xml .= PHP_EOL . Indent::_(1) + . '
'; + } + $xml .= PHP_EOL . Indent::_(1) . ''; + } + $xml .= PHP_EOL . ''; + + // add xml to file + $this->file->write($fileDetails['path'], $xml); + $this->files->appendArray($plugin->key, $fileDetails); + + // count the file created + $this->counter->file++; + } + } + + // set SQL stuff if needed + if ($plugin->add_sql || $plugin->add_sql_uninstall) + { + // create SQL folder + $this->folder->create($plugin->folder_path . '/sql'); + + // create mysql folder + $this->folder->create( + $plugin->folder_path . '/sql/mysql' + ); + + // now set the install file + if ($plugin->add_sql) + { + $this->file->write( + $plugin->folder_path . '/sql/mysql/install.sql', + $plugin->sql + ); + + // count the file created + $this->counter->file++; + } + + // now set the uninstall file + if ($plugin->add_sql_uninstall) + { + $this->file->write( + $plugin->folder_path + . '/sql/mysql/uninstall.sql', + $plugin->sql_uninstall + ); + + // count the file created + $this->counter->file++; + } + } + + // creat the language folder path + $this->folder->create($plugin->folder_path . '/language'); + + // also creat the lang tag folder path + $this->folder->create( + $plugin->folder_path . '/language/' . $this->config->get('lang_tag', 'en-GB') + ); + + // check if this lib has files + if (isset($plugin->files) + && ArrayHelper::check($plugin->files)) + { + // add to component files + foreach ($plugin->files as $file) + { + // set the path finder + $file['target_type'] = $plugin->target_type; + $file['target_id'] = $plugin->id; + $this->component->appendArray('files', $file); + } + } + + // check if this lib has folders + if (isset($plugin->folders) + && ArrayHelper::check($plugin->folders)) + { + // add to component folders + foreach ($plugin->folders as $folder) + { + // set the path finder + $folder['target_type'] = $plugin->target_type; + $folder['target_id'] = $plugin->id; + $this->component->appendArray('folders', $folder); + } + } + + // check if this plugin has urls + if (isset($plugin->urls) + && ArrayHelper::check($plugin->urls)) + { + // add to component urls + foreach ($plugin->urls as $n => &$url) + { + // should we add the local folder + if (isset($url['type']) && $url['type'] > 1 + && isset($url['url']) + && StringHelper::check( + $url['url'] + )) + { + // set file name + $fileName = basename((string) $url['url']); + + // get the file contents + $data = FileHelper::getContent( + $url['url'] + ); + + // build sub path + if (strpos($fileName, '.js') !== false) + { + $path = '/js'; + } + elseif (strpos($fileName, '.css') !== false) + { + $path = '/css'; + } + else + { + $path = ''; + } + + // create sub media media folder path if not set + $this->folder->create( + $plugin->folder_path . $path + ); + + // set the path to plugin file + $url['path'] = $plugin->folder_path . $path + . '/' . $fileName; // we need this for later + + // write data to path + $this->file->write($url['path'], $data); + + // count the file created + $this->counter->file++; + } + } + } + } + } + } + } + + /** + * get the plugin xml template + * + * @param object $module The plugin object + * + * @return string + * @since 3.2.0 + */ + protected function getXML(object &$plugin): string + { + $xml = ''; + $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix + . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOR') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOREMAIL') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHORWEBSITE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('COPYRIGHT') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('LICENSE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->plugin_version + . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix + . '_XML_DESCRIPTION'; + $xml .= Placefix::_h('MAINXML'); + $xml .= PHP_EOL . ''; + + return $xml; + } + +} + diff --git a/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/settings.json b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/settings.json new file mode 100644 index 0000000..2a0bebe --- /dev/null +++ b/src/a900b836-f2eb-4f13-8f28-b7cac839c7ff/settings.json @@ -0,0 +1,89 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "a900b836-f2eb-4f13-8f28-b7cac839c7ff", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structure", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Joomlaplugin.Structure", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "766a9524-37df-4604-91a7-b98a6150ee26", + "as": "Plugin" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection4": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection5": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection6": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection7": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection8": { + "use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "as": "default" + }, + "use_selection9": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection10": { + "use": "1d967151-7c20-4ca7-9400-65233cdcd4db", + "as": "default" + }, + "use_selection11": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection12": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + }, + "use_selection13": { + "use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "as": "default" + }, + "use_selection14": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection15": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection16": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection17": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Joomlaplugin.Structure", + "description": "Joomla Plugin Builder Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/README.md b/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/README.md new file mode 100644 index 0000000..077ff53 --- /dev/null +++ b/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface InsertInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface InsertInterface #Lavender { + + rows(array $data, string $table) : bool + + items(array $data, array $columns, ...) : bool + + row(array $data, string $table) : bool +} + +note right of InsertInterface::rows + Set rows to the database + + since: 3.2.0 + return: bool +end note + +note right of InsertInterface::items + Set items to the database + + since: 3.2.0 + return: bool + + arguments: + array $data + array $columns + string $table +end note + +note right of InsertInterface::row + Set row to the database + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/code.php b/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/code.php new file mode 100644 index 0000000..59481ae --- /dev/null +++ b/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/code.php @@ -0,0 +1,57 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * Database Insert Interface + * + * @since 3.2.0 + */ +interface InsertInterface +{ + /** + * Set rows to the database + * + * @param array $data Dataset to store in database [array of arrays (key => value)] + * @param string $table The table where the data is being added + * + * @return bool + * @since 3.2.0 + **/ + public function rows(array $data, string $table): bool; + + /** + * Set items to the database + * + * @param array $data Data to store in database (array of objects) + * @param array $columns Data columns + * @param string $table The table where the data is being added + * + * @return bool + * @since 3.2.0 + **/ + public function items(array $data, array $columns, string $table): bool; + + /** + * Set row to the database + * + * @param array $data Dataset to store in database (key => value) + * @param string $table The table where the data is being added + * + * @return bool + * @since 3.2.0 + **/ + public function row(array $data, string $table): bool; + +} + diff --git a/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/settings.json b/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/settings.json new file mode 100644 index 0000000..149aa4f --- /dev/null +++ b/src/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "InsertInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.InsertInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.InsertInterface", + "description": "Database Insert Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/README.md b/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/README.md new file mode 100644 index 0000000..8e0ebb3 --- /dev/null +++ b/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Content (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Content #Gold { + # key(string $key) : string + # firstKey(string $key) : string + # secondKey(string $key) : string +} + +note right of Content::key + Model the key + + since: 3.2.0 + return: string +end note + +note right of Content::firstKey + Model the first key + + since: 3.2.0 + return: string +end note + +note right of Content::secondKey + Model the second key + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/code.php b/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/code.php new file mode 100644 index 0000000..bbde8a2 --- /dev/null +++ b/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/code.php @@ -0,0 +1,67 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Interfaces\Mapperdoubleinterface; +use VDM\Joomla\Componentbuilder\Interfaces\Mappersingleinterface; +use VDM\Joomla\Componentbuilder\Abstraction\Mapper; + + +/** + * Compiler Content + * + * @since 3.2.0 + */ +class Content extends Mapper implements Mapperdoubleinterface, Mappersingleinterface +{ + /** + * Model the key + * + * @param string $key The key to model + * + * @return string + * @since 3.2.0 + */ + protected function key(string $key): string + { + return Placefix::_h($key); + } + + /** + * Model the first key + * + * @param string $key The first key to model + * + * @return string + * @since 3.2.0 + */ + protected function firstKey(string $key): string + { + return $key; + } + + /** + * Model the second key + * + * @param string $key The second key to model + * + * @return string + * @since 3.2.0 + */ + protected function secondKey(string $key): string + { + return Placefix::_h($key); + } +} + diff --git a/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/settings.json b/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/settings.json new file mode 100644 index 0000000..5752bd1 --- /dev/null +++ b/src/adfbe68a-6d22-43e5-aee8-2787e8c47e75/settings.json @@ -0,0 +1,24 @@ +{ + "add_head": "0", + "extends": "44a3367c-f9e4-406b-b396-0f452bde0f03", + "extends_custom": "", + "guid": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "implements": [ + "fbc58009-fa16-4d49-a0dd-419c3b62d42f", + "78527c29-24ad-4735-ad4c-ec33a4952d9b" + ], + "implements_custom": "", + "load_selection": null, + "name": "Content", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Content", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Content", + "description": "Compiler Content\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/README.md b/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/README.md new file mode 100644 index 0000000..c07ff18 --- /dev/null +++ b/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Linkedviews (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Linkedviews #Gold { + # Registry $registry + + __construct(?Registry $registry = null) + + set(object $item) : void +} + +note right of Linkedviews::__construct + Constructor + + since: 3.2.0 +end note + +note right of Linkedviews::set + Set the linked views + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/code.php b/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/code.php new file mode 100644 index 0000000..37854bb --- /dev/null +++ b/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/code.php @@ -0,0 +1,76 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Linked Views Class + * + * @since 3.2.0 + */ +class Linkedviews +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Set the linked views + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addlinked_views = (isset($item->addlinked_views) + && JsonHelper::check($item->addlinked_views)) + ? json_decode((string) $item->addlinked_views, true) : null; + + if (ArrayHelper::check($item->addlinked_views)) + { + // setup linked views to global data sets + $this->registry->set('builder.linked_admin_views.' . $item->name_single_code, + array_values( + $item->addlinked_views + ) + ); + } + + unset($item->addlinked_views); + } + +} + diff --git a/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/settings.json b/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/settings.json new file mode 100644 index 0000000..b40153e --- /dev/null +++ b/src/ae1fa148-91be-4f80-89a9-69d91ba9d575/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ae1fa148-91be-4f80-89a9-69d91ba9d575", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Linkedviews", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Linkedviews", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection3": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Linkedviews", + "description": "Model Linked Views Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md new file mode 100644 index 0000000..270c08d --- /dev/null +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/README.md @@ -0,0 +1,47 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Placeholder (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Placeholder #Gold { + # $placeholders + # $config + # $db + + __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + + get() : array +} + +note right of Placeholder::__construct + Constructor. + + since: 3.2.0 +end note + +note right of Placeholder::get + get all System Placeholders + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php new file mode 100644 index 0000000..59040d1 --- /dev/null +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/code.php @@ -0,0 +1,145 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\PlaceholderInterface; + + +/** + * Get a Components Global Placeholders + * + * @since 3.2.0 + */ +class Placeholder implements PlaceholderInterface +{ + /** + * Placeholders + * + * @var array + * @since 3.2.0 + **/ + protected $placeholders = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected $config; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected $db; + + /** + * Constructor. + * + * @param Config $config The compiler config object. + * @param \JDatabaseDriver $db The Database Driver object. + * + * @since 3.2.0 + **/ + public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * get all System Placeholders + * + * @return array The global placeholders + * + * @since 3.2.0 + */ + public function get(): array + { + // set only once + if (is_array($this->placeholders)) + { + return $this->placeholders; + } + + // load the config + $config = $this->config; + // load the db + $db = $this->db; + // reset bucket + $bucket = []; + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.target', 'a.value'))); + // from these tables + $query->from('#__componentbuilder_placeholder AS a'); + // Reset the query using our newly populated query object. + $db->setQuery($query); + + // Load the items + $db->execute(); + if ($db->getNumRows()) + { + $bucket = $db->loadAssocList('target', 'value'); + // open all the code + foreach ($bucket as $key => &$code) + { + $code = base64_decode((string) $code); + } + } + + // set component place holders + $bucket[Placefix::_h('component')] = $config->component_code_name; + $bucket[Placefix::_h('Component')] = StringHelper::safe($config->component_code_name, 'F'); + $bucket[Placefix::_h('COMPONENT')] = StringHelper::safe($config->component_code_name, 'U'); + $bucket[Placefix::_('component')] = $bucket[Placefix::_h('component')]; + $bucket[Placefix::_('Component')] = $bucket[Placefix::_h('Component')]; + $bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')]; + $bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix; + $bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')]; + + // get the current components overrides + if (($_placeholders = GetHelper::var( + 'component_placeholders', $config->component_id, + 'joomla_component', 'addplaceholders' + )) !== false + && JsonHelper::check($_placeholders)) + { + $_placeholders = json_decode((string) $_placeholders, true); + if (ArrayHelper::check($_placeholders)) + { + foreach ($_placeholders as $row) + { + $bucket[$row['target']] = $row['value']; + } + } + } + + $this->placeholders = $bucket; + + return $bucket; + } + +} + diff --git a/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json new file mode 100644 index 0000000..12ba43a --- /dev/null +++ b/src/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb/settings.json @@ -0,0 +1,48 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", + "implements": [ + "97698747-c2ce-4e09-a470-acf6d8e86281" + ], + "implements_custom": "", + "load_selection": null, + "name": "Placeholder", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Placeholder", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection1": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection2": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection3": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection4": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection5": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection6": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Placeholder", + "description": "Get a Components Global Placeholders\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/af5beb21-214a-44f6-9090-7ea24c22e649/README.md b/src/af5beb21-214a-44f6-9090-7ea24c22e649/README.md new file mode 100644 index 0000000..2e21393 --- /dev/null +++ b/src/af5beb21-214a-44f6-9090-7ea24c22e649/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Whmcs (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Whmcs #Gold { + + set(object $item) : void +} + +note right of Whmcs::set + Set whmcs links if needed + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/af5beb21-214a-44f6-9090-7ea24c22e649/code.php b/src/af5beb21-214a-44f6-9090-7ea24c22e649/code.php new file mode 100644 index 0000000..378ca87 --- /dev/null +++ b/src/af5beb21-214a-44f6-9090-7ea24c22e649/code.php @@ -0,0 +1,72 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Whmcs Class + * + * @since 3.2.0 + */ +class Whmcs +{ + /** + * Set whmcs links if needed + * + * @param object $item The extension data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + if (1 == $item->add_license + && (!isset($item->whmcs_buy_link) + || !StringHelper::check( + $item->whmcs_buy_link + ))) + { + // update with the whmcs url + if (isset($item->whmcs_url) + && StringHelper::check($item->whmcs_url)) + { + $item->whmcs_buy_link = $item->whmcs_url; + } + // use the company website + elseif (isset($item->website) + && StringHelper::check($item->website)) + { + $item->whmcs_buy_link = $item->website; + $item->whmcs_url = rtrim((string) $item->website, '/') + . '/whmcs'; + } + // none set + else + { + $item->whmcs_buy_link = '#'; + $item->whmcs_url = '#'; + } + } + // since the license details are not set clear + elseif (0 == $item->add_license) + { + $item->whmcs_key = ''; + $item->whmcs_buy_link = ''; + $item->whmcs_url = ''; + } + } + +} + diff --git a/src/af5beb21-214a-44f6-9090-7ea24c22e649/settings.json b/src/af5beb21-214a-44f6-9090-7ea24c22e649/settings.json new file mode 100644 index 0000000..461ad15 --- /dev/null +++ b/src/af5beb21-214a-44f6-9090-7ea24c22e649/settings.json @@ -0,0 +1,21 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "af5beb21-214a-44f6-9090-7ea24c22e649", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Whmcs", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Whmcs", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Whmcs", + "description": "Model Whmcs Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/b591855d-d106-4fe5-90ad-8e706f6267cf/README.md b/src/b591855d-d106-4fe5-90ad-8e706f6267cf/README.md new file mode 100644 index 0000000..d343a1d --- /dev/null +++ b/src/b591855d-d106-4fe5-90ad-8e706f6267cf/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Minify (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +abstract Minify #Orange { + + {static} js(string $data) : string + + {static} css(string $data) : string +} + +note right of Minify::js + Minify JavaScript + + since: 3.2.0 + return: string +end note + +note right of Minify::css + Minify Css + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b591855d-d106-4fe5-90ad-8e706f6267cf/code.php b/src/b591855d-d106-4fe5-90ad-8e706f6267cf/code.php new file mode 100644 index 0000000..b6b4daa --- /dev/null +++ b/src/b591855d-d106-4fe5-90ad-8e706f6267cf/code.php @@ -0,0 +1,91 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Minify\Css; +use VDM\Minify\JavaScript; + + +/** + * Compiler Minifier + * + * @since 3.2.0 + */ +abstract class Minify +{ + /** + * Minify JavaScript Class + * + * @var JavaScript + * @since 3.2.0 + */ + public static JavaScript $js; + + /** + * Minify Css Class + * + * @var Css + * @since 3.2.0 + */ + public static Css $css; + + /** + * Minify JavaScript + * + * @param string $data + * + * @return string + * @since 3.2.0 + */ + public static function js(string $data): string + { + // check if instance already set + if (empty(self::$js)) + { + // set instanceof on JavaScript + self::$js = new JavaScript; + } + + // add the data + self::$js->add($data); + + // return minified + return self::$js->minify(); + } + + /** + * Minify Css + * + * @param string $data + * + * @return string + * @since 3.2.0 + */ + public static function css(string $data): string + { + // check if instance already set + if (empty(self::$css)) + { + // set instanceof on Css + self::$css = new Css; + } + + // add the data + self::$css->add($data); + + // return minified + return self::$css->minify(); + } + +} + diff --git a/src/b591855d-d106-4fe5-90ad-8e706f6267cf/settings.json b/src/b591855d-d106-4fe5-90ad-8e706f6267cf/settings.json new file mode 100644 index 0000000..e5c80c6 --- /dev/null +++ b/src/b591855d-d106-4fe5-90ad-8e706f6267cf/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "b591855d-d106-4fe5-90ad-8e706f6267cf", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Minify", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Minify", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "70530246-2903-4c02-af9a-61182e4d97b8", + "as": "default" + }, + "use_selection1": { + "use": "ef6438c4-76db-4aa1-bb15-bc97583bcd2e", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Minify", + "description": "Compiler Minifier\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/README.md b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/README.md new file mode 100644 index 0000000..a000c3c --- /dev/null +++ b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/README.md @@ -0,0 +1,121 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structuremultiple (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Structuremultiple #Gold { + # Config $config + # Registry $registry + # Settings $settings + # Component $component + # Createdate $createdate + # Modifieddate $modifieddate + # Structure $structure + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + build() : bool + # admin() : bool + # site() : bool + # custom() : bool + - isValidAdminView(array $view, array $config) : bool + - isValidView(array $view, array $config) : bool + - buildAdminView(array $view, array $config) : void + - buildView(array $view, array $config, ...) : void +} + +note right of Structuremultiple::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Settings $settings = null + ?Component $component = null + ?Createdate $createdate = null + ?Modifieddate $modifieddate = null + ?Structure $structure = null +end note + +note left of Structuremultiple::build + Build the Multiple Files & Folders + + since: 3.2.0 + return: bool +end note + +note right of Structuremultiple::admin + Build the Dynamic Admin Files & Folders + + since: 3.2.0 + return: bool +end note + +note left of Structuremultiple::site + Build the Dynamic Site Files & Folders + + since: 3.2.0 + return: bool +end note + +note right of Structuremultiple::custom + Build the Dynamic Custom Admin Files & Folders + + since: 3.2.0 + return: bool +end note + +note left of Structuremultiple::isValidAdminView + Check if the view is a valid view + + since: 3.2.0 + return: bool +end note + +note right of Structuremultiple::isValidView + Check if the view is a valid view + + since: 3.2.0 + return: bool +end note + +note left of Structuremultiple::buildAdminView + Build the admin view + + since: 3.2.0 + return: void +end note + +note right of Structuremultiple::buildView + Build the custom view + + since: 3.2.0 + return: void + + arguments: + array $view + array $config + string $type +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php new file mode 100644 index 0000000..7042d97 --- /dev/null +++ b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/code.php @@ -0,0 +1,355 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Structure; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; + + +/** + * Multiple Files and Folders Builder Class + * + * @since 3.2.0 + */ +class Structuremultiple +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Model Createdate + * + * @var Createdate + * @since 3.2.0 + **/ + protected Createdate $createdate; + + /** + * Compiler Model Modifieddate + * + * @var Modifieddate + * @since 3.2.0 + **/ + protected Modifieddate $modifieddate; + + /** + * Compiler Utility to Build Structure + * + * @var Structure + * @since 3.2.0 + **/ + protected Structure $structure; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Settings|null $settings The compiler component Joomla version settings object. + * @param Component|null $component The component class. + * @param Createdate|null $createdate The compiler model to get create date class. + * @param Modifieddate|null $modifieddate The compiler model to get modified date class. + * @param Structure|null $structure The compiler structure to build dynamic folder and files class. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Settings $settings = null, ?Component $component = null, + ?Createdate $createdate = null, ?Modifieddate $modifieddate = null, + ?Structure $structure = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->component = $component ?: Compiler::_('Component'); + $this->createdate = $createdate ?: Compiler::_('Model.Createdate'); + $this->modifieddate = $modifieddate ?: Compiler::_('Model.Modifieddate'); + $this->structure = $structure ?: Compiler::_('Utilities.Structure'); + } + + /** + * Build the Multiple Files & Folders + * + * @return bool + * @since 3.2.0 + */ + public function build(): bool + { + $success = false; + + if ($this->settings->exists()) + { + $success = $this->admin(); + $success = $this->site() || $success; + $success = $this->custom() || $success; + } + + return $success; + } + + /** + * Build the Dynamic Admin Files & Folders + * + * @return bool + * @since 3.2.0 + */ + protected function admin(): bool + { + if (!$this->component->isArray('admin_views')) + { + return false; + } + + // check if we have a dynamic dashboard + if (!$this->registry->get('build.dashboard')) + { + // setup the default dashboard + $target = ['admin' => $this->component->get('name_code')]; + $this->structure->build($target, 'dashboard'); + } + + $config = []; + $checkin = false; + + foreach ($this->component->get('admin_views') as $view) + { + if (!$this->isValidAdminView($view, $config)) + { + continue; + } + + $this->buildAdminView($view, $config); + + // quick set of checkin once + if (!$checkin && isset($view['checkin']) && $view['checkin'] == 1) + { + // switch to add checking to config + $checkin = true; + $this->config->set('add_checkin', $checkin); + } + } + + return true; + } + + /** + * Build the Dynamic Site Files & Folders + * + * @return bool + * @since 3.2.0 + */ + protected function site(): bool + { + if (!$this->component->isArray('site_views')) + { + return false; + } + + $config = []; + + foreach ($this->component->get('site_views') as $view) + { + if (!$this->isValidView($view, $config)) + { + continue; + } + + $this->buildView($view, $config, 'site'); + } + + return true; + } + + /** + * Build the Dynamic Custom Admin Files & Folders + * + * @return bool + * @since 3.2.0 + */ + protected function custom(): bool + { + if (!$this->component->isArray('custom_admin_views')) + { + return false; + } + + $config = []; + + foreach ($this->component->get('custom_admin_views') as $view) + { + if (!$this->isValidView($view, $config)) + { + continue; + } + + $this->buildView($view, $config, 'custom_admin'); + } + + return true; + } + + /** + * Check if the view is a valid view + * + * @param array $view + * @param array $config + * + * @return bool + * @since 3.2.0 + */ + private function isValidAdminView(array $view, array &$config): bool + { + if (!isset($view['settings']) || !ObjectHelper::check($view['settings']) + || ((!isset($view['settings']->name_list) || $view['settings']->name_list == 'null') + && (!isset($view['settings']->name_single) || $view['settings']->name_single == 'null'))) + { + return false; + } + + $created = $this->createdate->get($view); + $modified = $this->modifieddate->get($view); + + $config = [ + Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version + ]; + + return true; + } + + /** + * Check if the view is a valid view + * + * @param array $view + * @param array $config + * + * @return bool + * @since 3.2.0 + */ + private function isValidView(array $view, array &$config): bool + { + if (!isset($view['settings']) || !ObjectHelper::check($view['settings']) + || !isset($view['settings']->main_get) + || !ObjectHelper::check($view['settings']->main_get) + || !isset($view['settings']->main_get->gettype) + || ($view['settings']->main_get->gettype != 1 && $view['settings']->main_get->gettype != 2)) + { + return false; + } + + $created = $this->createdate->get($view); + $modified = $this->modifieddate->get($view); + + $config = [ + Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version + ]; + + return true; + } + + /** + * Build the admin view + * + * @param array $view + * @param array $config + * + * @return void + * @since 3.2.0 + */ + private function buildAdminView(array $view, array $config) + { + // build the admin edit view + if ($view['settings']->name_single != 'null') + { + $target = ['admin' => $view['settings']->name_single]; + $this->structure->build($target, 'single', false, $config); + + // build the site edit view (of this admin view) + if (isset($view['edit_create_site_view']) + && is_numeric($view['edit_create_site_view']) + && $view['edit_create_site_view'] > 0) + { + // setup the front site edit-view files + $target = ['site' => $view['settings']->name_single]; + $this->structure->build($target, 'edit', false, $config); + } + } + + // build the list view + if ($view['settings']->name_list != 'null') + { + $target = ['admin' => $view['settings']->name_list]; + $this->structure->build($target, 'list', false, $config); + } + } + + /** + * Build the custom view + * + * @param array $view + * @param array $config + * @param string $type + * + * @return void + * @since 3.2.0 + */ + private function buildView(array $view, array $config, string $type) + { + $target = [$type => $view['settings']->code]; + $view_type = ($view['settings']->main_get->gettype == 1) ? 'single' : 'list'; + + $this->structure->build($target, $view_type, false, $config); + } + +} + diff --git a/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json new file mode 100644 index 0000000..76cd216 --- /dev/null +++ b/src/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c/settings.json @@ -0,0 +1,57 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "b69a23db-0a62-4840-a9c5-b2d8d63ecc6c", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structuremultiple", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Structuremultiple", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "63dabe82-0f4a-4ade-9851-8518ade23de2", + "as": "default" + }, + "use_selection4": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection5": { + "use": "53cf9828-7ad4-4856-aac1-7c4c67bd3121", + "as": "default" + }, + "use_selection6": { + "use": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3", + "as": "default" + }, + "use_selection7": { + "use": "1efdded5-d6c8-452c-8f37-0374483a7b3f", + "as": "default" + }, + "use_selection8": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection9": { + "use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Structuremultiple", + "description": "Multiple Files and Folders Builder Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/b80296eb-4718-4ed3-894d-69f3ac293733/README.md b/src/b80296eb-4718-4ed3-894d-69f3ac293733/README.md new file mode 100644 index 0000000..d6013ab --- /dev/null +++ b/src/b80296eb-4718-4ed3-894d-69f3ac293733/README.md @@ -0,0 +1,74 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Updatesql (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Updatesql #Gold { + # array $name + # Registry $registry + + __construct(?Registry $registry = null) + + set(mixed $old, mixed $new, ...) : void + # add(string $type, int $item, ...) : void + # name(int $id) : string +} + +note right of Updatesql::__construct + Constructor + + since: 3.2.0 +end note + +note right of Updatesql::set + check if an update SQL is needed + + since: 3.2.0 + return: void + + arguments: + mixed $old + mixed $new + string $type + mixed $key = null + ?array $ignore = null +end note + +note right of Updatesql::add + Set the add sql + + since: 3.2.0 + return: void + + arguments: + string $type + int $item + mixed $key = null +end note + +note right of Updatesql::name + Get the Admin view table name + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b80296eb-4718-4ed3-894d-69f3ac293733/code.php b/src/b80296eb-4718-4ed3-894d-69f3ac293733/code.php new file mode 100644 index 0000000..c2242e1 --- /dev/null +++ b/src/b80296eb-4718-4ed3-894d-69f3ac293733/code.php @@ -0,0 +1,259 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; + + +/** + * Model Update sql Class + * + * @since 3.2.0 + */ +class Updatesql +{ + /** + * The admin view names + * + * @var array + * @since 3.2.0 + */ + protected array $name = []; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * check if an update SQL is needed + * + * @param mixed $old The old values + * @param mixed $new The new values + * @param string $type The type of values + * @param mixed $key The id/key where values changed + * @param array|null $ignore The ids to ignore + * + * @return void + * @since 3.2.0 + */ + public function set($old, $new, string $type, $key = null, ?array $ignore = null) + { + // check if there were new items added + if (ArrayHelper::check($new) && ArrayHelper::check($old)) + { + // check if this is old repeatable field + if (isset($new[$type])) + { + foreach ($new[$type] as $item) + { + $newItem = true; + + // check if this is an id to ignore + if (ArrayHelper::check($ignore) + && in_array( + $item, $ignore + )) + { + // don't add ignored ids + $newItem = false; + } + // check if this is old repeatable field + elseif (isset($old[$type]) + && ArrayHelper::check($old[$type])) + { + if (!in_array($item, $old[$type])) + { + // we have a new item, lets add to SQL + $this->add($type, $item, $key); + } + + // add only once + $newItem = false; + } + elseif (!isset($old[$type])) + { + // we have new values + foreach ($old as $oldItem) + { + if (isset($oldItem[$type])) + { + if ($oldItem[$type] == $item[$type]) + { + $newItem = false; + break; + } + } + else + { + $newItem = false; + break; + } + } + } + else + { + $newItem = false; + } + + // add if new + if ($newItem) + { + // we have a new item, lets add to SQL + $this->add($type, $item[$type], $key); + } + } + } + else + { + foreach ($new as $item) + { + if (isset($item[$type])) + { + // search to see if this is a new value + $newItem = true; + + // check if this is an id to ignore + if (ArrayHelper::check($ignore) + && in_array($item[$type], $ignore)) + { + // don't add ignored ids + $newItem = false; + } + // check if this is old repeatable field + elseif (isset($old[$type]) + && ArrayHelper::check($old[$type])) + { + if (in_array($item[$type], $old[$type])) + { + $newItem = false; + } + } + elseif (!isset($old[$type])) + { + // we have new values + foreach ($old as $oldItem) + { + if (isset($oldItem[$type])) + { + if ($oldItem[$type] == $item[$type]) + { + $newItem = false; + break; + } + } + else + { + $newItem = false; + break; + } + } + } + else + { + $newItem = false; + } + + // add if new + if ($newItem) + { + // we have a new item, lets add to SQL + $this->add($type, $item[$type], $key); + } + } + } + } + } + elseif ($key && ((StringHelper::check($new) && StringHelper::check($old)) + || (is_numeric($new) && is_numeric($old))) && $new !== $old) + { + // set at key + $this->registry->set('builder.update_sql.' . $type . '.' . $key, ['old' => $old, 'new' => $new]); + } + } + + /** + * Set the add sql + * + * @param string $type The type of values + * @param int $item The item id to add + * @param mixed $key The id/key where values changed + * + * @return void + * @since 3.2.0 + */ + protected function add(string $type, int $item, $key = null) + { + // add key if found + if ($key) + { + $this->registry->set('builder.add_sql.' . $type . '.' . $key . '.' . $item, $item); + } + else + { + // convert admin view id to name + if ('adminview' === $type) + { + $this->registry->set('builder.add_sql.' . $type . '.' . $this->name($item), + $item + ); + } + else + { + $this->registry->set('builder.add_sql.' . $type, $item); + } + } + } + + /** + * Get the Admin view table name + * + * @param int $id The item id to add + * + * @return string the admin view code name + * @since 3.2.0 + */ + protected function name(int $id): string + { + // get name if not set + if (!isset($this->name[$id])) + { + $this->name[$id] = StringHelper::safe( + GetHelper::var('admin_view', $id, 'id', 'name_single') + ); + } + + return $this->name[$id] ?? 'error'; + } + +} + diff --git a/src/b80296eb-4718-4ed3-894d-69f3ac293733/settings.json b/src/b80296eb-4718-4ed3-894d-69f3ac293733/settings.json new file mode 100644 index 0000000..c1c254b --- /dev/null +++ b/src/b80296eb-4718-4ed3-894d-69f3ac293733/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "b80296eb-4718-4ed3-894d-69f3ac293733", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Updatesql", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Updatesql", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection4": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Updatesql", + "description": "Model Update sql Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md new file mode 100644 index 0000000..27a2879 --- /dev/null +++ b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/README.md @@ -0,0 +1,226 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Power (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Power #Gold { + + array $active + + array $namespace + + array $composer + + array $superpowers + # string $fixUrl + # array $state + # Config $config + # Placeholder $placeholder + # Customcode $customcode + # Gui $gui + # \JDatabaseDriver $db + # CMSApplication $app + + __construct(?Config $config = null, ?Placeholder $placeholder = null, ...) + + load(array $guids) : void + + get(string $guid, int $build) : ?object + - set(string $guid) : bool + - isPowerSet(string $guid) : bool + - isGuidValid(string $guid) : bool + - getPowerData(string $guid) : ?object + - setNamespace(string $guid) : bool + - setUseSelection(string $guid, array $use, ...) : void + - setLoadSelection(string $guid) : void + - setComposer(string $guid) : void + - setImplements(string $guid, array $use) : void + - setExtend(string $guid, array $use) : void + - setUseAs(string $guid, array $use, ...) : void + - getCleanNamespace(string $namespace, bool $removeNumbers = true) : string + - getUseNamespace(string $namespace, string $as = 'default') : string + - addToHeader(string $guid, string $string) : void + - setLicensingTemplate(string $guid, array $guiMapper) : void + - setHeader(string $guid, array $guiMapper) : void + - setMainClassCode(string $guid, array $guiMapper) : void + - setSuperPowers(string $guid) : void +} + +note right of Power::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Placeholder $placeholder = null + ?Customcode $customcode = null + ?Gui $gui = null + ?\JDatabaseDriver $db = null + ?CMSApplication $app = null +end note + +note left of Power::load + load all the powers linked to this component + + since: 3.2.0 + return: void +end note + +note right of Power::get + Get a power + + since: 3.2.0 + return: ?object +end note + +note left of Power::set + Set a power + + since: 3.2.0 + return: bool +end note + +note right of Power::isPowerSet + Check if the power is already set + + since: 3.2.0 + return: bool +end note + +note left of Power::isGuidValid + Validate the GUID + + since: 3.2.0 + return: bool +end note + +note right of Power::getPowerData + Get the power data from the database + + since: 3.2.0 + return: ?object +end note + +note left of Power::setNamespace + Set the namespace for this power + + since: 3.2.0 + return: bool +end note + +note right of Power::setUseSelection + Set Use Classess + + since: 3.2.0 + return: void + + arguments: + string $guid + array $use + array $as +end note + +note left of Power::setLoadSelection + Load Extra Classes + + since: 3.2.0 + return: void +end note + +note right of Power::setComposer + Set Composer Linked Use and Access Point + + since: 3.2.0 + return: void +end note + +note left of Power::setImplements + Set Implements Interface classes + + since: 3.2.0 + return: void +end note + +note right of Power::setExtend + Set Extend Class + + since: 3.2.0 + return: void +end note + +note left of Power::setUseAs + Set Extra Use Classes + + since: 3.2.0 + return: void + + arguments: + string $guid + array $use + array $as +end note + +note right of Power::getCleanNamespace + Get Clean Namespace without use or ; as part of the name space + + since: 3.2.0 + return: string +end note + +note left of Power::getUseNamespace + Get [use Namespace\Class;] + + since: 3.2.0 + return: string +end note + +note right of Power::addToHeader + Add to class header + + since: 3.2.0 + return: void +end note + +note left of Power::setLicensingTemplate + Set the power licensing template + + since: 3.2.0 + return: void +end note + +note right of Power::setHeader + Set the power header script + + since: 3.2.0 + return: void +end note + +note left of Power::setMainClassCode + Set the power main class code + + since: 3.2.0 + return: void +end note + +note right of Power::setSuperPowers + Set the super powers of this power + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php new file mode 100644 index 0000000..e03fbed --- /dev/null +++ b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/code.php @@ -0,0 +1,997 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\PowerInterface; + + +/** + * Compiler Power + * + * @since 3.2.0 + */ +class Power implements PowerInterface +{ + /** + * All loaded powers + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * All power namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $namespace = []; + + /** + * All composer namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $composer = []; + + /** + * All super powers of this build + * + * @var array + * @since 3.2.0 + **/ + public array $superpowers = []; + + /** + * The url to the power, if there is an error. + * + * @var string + * @since 3.2.0 + **/ + protected string $fixUrl; + + /** + * The state of all loaded powers + * + * @var array + * @since 3.2.0 + **/ + protected array $state = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui 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, ?Placeholder $placeholder = null, + ?Customcode $customcode = null, ?Gui $gui = null, + ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->db = $db ?: Factory::getDbo(); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * load all the powers linked to this component + * + * @param array $guids The global unique ids of the linked powers + * + * @return void + * @since 3.2.0 + */ + public function load(array $guids) + { + if (ArrayHelper::check($guids)) + { + foreach ($guids as $guid => $build) + { + $this->get($guid, $build); + } + } + } + + /** + * Get a power + * + * @param string $guid The global unique id of the power + * @param int $build Force build switch (to override global switch) + * + * @return object|null + * @since 3.2.0 + */ + public function get(string $guid, int $build = 0): ?object + { + if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid)) + { + return $this->active[$guid]; + } + + return null; + } + + /** + * Set a power + * + * @param string $guid The global unique id of the power + * + * @return bool true on successful setting of a power + * @since 3.2.0 + */ + private function set(string $guid): bool + { + // check if we have been here before + if ($this->isPowerSet($guid)) + { + return $this->state[$guid]; + } + elseif ($this->isGuidValid($guid)) + { + // get the power data + $this->active[$guid] = $this->getPowerData($guid); + + if (is_object($this->active[$guid])) + { + // make sure that in recursion we + // don't try to load this power again + // since during the load of a power we also load + // all powers linked to it + $this->state[$guid] = true; + + // make sure to add any language strings found to all language files + // since we can't know where this is used at this point + $tmp_lang_target = $this->config->lang_target; + $this->config->lang_target = 'both'; + + // we set the fix url if needed + $this->fixUrl + = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' + . $this->active[$guid]->id . '" target="_blank"'; + + // set some keys + $this->active[$guid]->target_type = 'P0m3R!'; + $this->active[$guid]->key = $this->active[$guid]->id . '_' . $this->active[$guid]->target_type; + + // reserve some values for the linker + $this->active[$guid]->unchanged_namespace = $this->active[$guid]->namespace; + $this->active[$guid]->unchanged_description = $this->active[$guid]->description; + + // now set the name + $this->active[$guid]->name = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->name) + ); + + // now set the code_name and class name + $this->active[$guid]->code_name = $this->active[$guid]->class_name = ClassfunctionHelper::safe( + $this->active[$guid]->name + ); + + // set official name + $this->active[$guid]->official_name = StringHelper::safe( + $this->active[$guid]->name, 'W' + ); + + // set name space + if (!$this->setNamespace($guid)) + { + $this->state[$guid] = false; + unset($this->active[$guid]); + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + return false; + } + + // load use ids + $use = []; + $as = []; + + // set extra classes + $this->setLoadSelection($guid); + + // set use classes + $this->setUseSelection($guid, $use, $as); + + // set implement interfaces + $this->setImplements($guid, $use); + + // set extend class + $this->setExtend($guid, $use); + + // set GUI mapper + $guiMapper = [ + 'table' => 'power', + 'id' => (int) $this->active[$guid]->id, + 'type' => 'php' + ]; + + // add the licensing template + $this->setLicensingTemplate($guid, $guiMapper); + + // add the header script + $this->setHeader($guid, $guiMapper); + + // set composer + $this->setComposer($guid); + + // now set the description + $this->active[$guid]->description = (StringHelper::check($this->active[$guid]->description)) ? $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->description), + ) : ''; + + // add the main code if set + $this->setMainClassCode($guid, $guiMapper); + + // load the use classes + $this->setUseAs($guid, $use, $as); + + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + // set the approved super power values + $this->setSuperPowers($guid); + + return true; + } + } + + // we failed to get the power, + // so we raise an error message + // only if guid is valid + if ($this->isGuidValid($guid)) + { + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP', $guid), + 'Error' + ); + } + + // let's not try again + $this->state[$guid] = false; + + return false; + } + + /** + * Check if the power is already set + * + * @param string $guid The global unique id of the power + * + * @return bool true if the power is already set + * @since 3.2.0 + */ + private function isPowerSet(string $guid): bool + { + return isset($this->state[$guid]); + } + + /** + * Validate the GUID + * + * @param string $guid The global unique id of the power + * + * @return bool true if the GUID is valid + * @since 3.2.0 + */ + private function isGuidValid(string $guid): bool + { + return GuidHelper::valid($guid); + } + + /** + * Get the power data from the database + * + * @param string $guid The global unique id of the power + * + * @return object|null The power data + * @since 3.2.0 + */ + private function getPowerData(string $guid): ?object + { + $query = $this->db->getQuery(true); + $query->select('a.*'); + $query->from('#__componentbuilder_power AS a'); + $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); + + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + return $this->db->loadObject(); + } + + return null; + } + + /** + * Set the namespace for this power + * + * @param string $guid The global unique id of the power + * + * @return bool + * @since 3.2.0 + */ + private function setNamespace(string $guid): bool + { + // set namespace + $this->active[$guid]->namespace = $this->placeholder->update_( + $this->active[$guid]->namespace + ); + + // validate namespace + if (strpos($this->active[$guid]->namespace, '\\') === false) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // setup the path array + $path_array = (array) explode('\\', $this->active[$guid]->namespace); + + // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming + $this->active[$guid]->namespace = $this->getCleanNamespace(str_replace('.', '\\', $this->active[$guid]->namespace)); + + // make sure it has two or more + if (ArrayHelper::check($path_array) <= 1) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // get the file and class name (the last value in array) + $file_name = array_pop($path_array); + + // src array bucket + $src_array = []; + + // do we have src folders + if (strpos($file_name, '.') !== false) + { + // we have src folders in the namespace + $src_array = (array) explode('.', $file_name); + + // get the file and class name (the last value in array) + $this->active[$guid]->file_name = array_pop($src_array); + + // namespace array + $namespace_array = [...$path_array, ...$src_array]; + } + else + { + // set the file name + $this->active[$guid]->file_name = $file_name; + + // namespace array + $namespace_array = $path_array; + } + + // the last value is the same as the class name + if ($this->active[$guid]->file_name !== $this->active[$guid]->class_name) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->type, $this->active[$guid]->class_name, $this->active[$guid]->file_name, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // make sure the arrays are namespace safe + $path_array = + array_map( + fn($val) => $this->getCleanNamespace($val), + $path_array + ); + $namespace_array = + array_map( + fn($val) => $this->getCleanNamespace($val), + $namespace_array + ); + + // set the actual class namespace + $this->active[$guid]->_namespace = implode('\\', $namespace_array); + + // set global namespaces for autoloader + $this->namespace[implode('.', $path_array)] = $path_array; + + // get the parent folder (the first value in array) + $prefix_folder = implode('.', $path_array); + + // make sub folders if still found + $sub_folder = ''; + if (ArrayHelper::check($src_array)) + { + // make sure the arrays are namespace safe + $sub_folder = '/' . implode('/', + array_map( + fn($val) => $this->getCleanNamespace($val), + $src_array + ) + ); + } + + // now we set the paths + $this->active[$guid]->path_jcb = $this->config->get('jcb_powers_path', 'libraries/jcb_powers'); + $this->active[$guid]->path_parent = $this->active[$guid]->path_jcb . '/' . $prefix_folder; + $this->active[$guid]->path = $this->active[$guid]->path_parent . '/src' . $sub_folder; + + return true; + } + + /** + * Set Use Classess + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * @param array $as The use as array + * + * @return void + * @since 3.2.0 + */ + private function setUseSelection(string $guid, array &$use, array &$as) + { + // check if we have use selection + $this->active[$guid]->use_selection = (isset($this->active[$guid]->use_selection) + && JsonHelper::check( + $this->active[$guid]->use_selection + )) ? json_decode((string) $this->active[$guid]->use_selection, true) : null; + + if (ArrayHelper::check($this->active[$guid]->use_selection)) + { + $use = array_values(array_map(function ($u) use(&$as) { + // track the AS options + $as[$u['use']] = empty($u['as']) ? 'default' : (string) $u['as']; + // return the guid + return $u['use']; + }, $this->active[$guid]->use_selection)); + } + else + { + $this->active[$guid]->use_selection = null; + } + } + + /** + * Load Extra Classes + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setLoadSelection(string $guid) + { + // check if we have load selection + $this->active[$guid]->load_selection = (isset($this->active[$guid]->load_selection) + && JsonHelper::check( + $this->active[$guid]->load_selection + )) ? json_decode((string) $this->active[$guid]->load_selection, true) : null; + + if (ArrayHelper::check($this->active[$guid]->load_selection)) + { + // load use ids + array_map( + // just load it directly and be done with it + fn($power) => $this->set($power['load']), + $this->active[$guid]->load_selection + ); + } + else + { + $this->active[$guid]->load_selection = null; + } + } + + /** + * Set Composer Linked Use and Access Point + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setComposer(string $guid) + { + // does this have composer powers + $_composer = (isset($this->active[$guid]->composer) + && JsonHelper::check( + $this->active[$guid]->composer + )) ? json_decode((string) $this->active[$guid]->composer, true) : null; + + unset($this->active[$guid]->composer); + + if (ArrayHelper::check($_composer)) + { + // reserve composer values for the linker + $this->active[$guid]->unchanged_composer = $_composer; + + foreach ($_composer as $composer) + { + if (isset($composer['access_point']) && StringHelper::check($composer['access_point']) && + isset($composer['namespace']) && ArrayHelper::check($composer['namespace'])) + { + foreach ($composer['namespace'] as $_namespace) + { + // make sure we have a valid namespace + if (isset($_namespace['use']) && StringHelper::check($_namespace['use']) && + strpos((string) $_namespace['use'], '\\') !== false) + { + // add the namespace to this access point + $as = 'default'; + if (strpos((string) $_namespace['use'], ' as ') !== false) + { + $namespace_as = explode(' as ', (string) $_namespace['use']); + // make sure the AS value is set + if (count($namespace_as) == 2) + { + $as = trim(trim($namespace_as[1], ';')); + } + $namespace = $this->getCleanNamespace($namespace_as[0], false); + } + else + { + // trim possible use or ; added to the namespace + $namespace = $this->getCleanNamespace($_namespace['use'], false); + } + + // check if still valid + if (!StringHelper::check($namespace)) + { + continue; + } + + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace, $as)); + + // add composer namespaces for autoloader + $this->composer[$namespace] = $composer['access_point']; + } + } + } + } + } + } + + /** + * Set Implements Interface classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * + * @return void + * @since 3.2.0 + */ + private function setImplements(string $guid, array &$use) + { + // see if we have implements + $this->active[$guid]->implement_names = []; + + // does this implement + $this->active[$guid]->implements = (isset($this->active[$guid]->implements) + && JsonHelper::check( + $this->active[$guid]->implements + )) ? json_decode((string) $this->active[$guid]->implements, true) : null; + + if ($this->active[$guid]->implements) + { + foreach ($this->active[$guid]->implements as $implement) + { + if ($implement == -1 + && StringHelper::check($this->active[$guid]->implements_custom)) + { + $this->active[$guid]->implement_names[] = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->implements_custom) + ); + // just add this once + unset($this->active[$guid]->implements_custom); + } + // does this extend existing + elseif (GuidHelper::valid($implement)) + { + // check if it was set + if ($this->set($implement)) + { + // get the name + $this->active[$guid]->implement_names[] = $this->get($implement, 1)->class_name; + // add to use + $use[] = $implement; + } + } + } + } + } + + /** + * Set Extend Class + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * + * @return void + * @since 3.2.0 + */ + private function setExtend(string $guid, array &$use) + { + // does this extend something + $this->active[$guid]->extends_name = null; + + // we first check for custom extending options + if ($this->active[$guid]->extends == -1 + && StringHelper::check($this->active[$guid]->extends_custom)) + { + $this->active[$guid]->extends_name = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->extends_custom) + ); + // just add once + unset($this->active[$guid]->extends_custom); + } + // does this extend existing + elseif (GuidHelper::valid($this->active[$guid]->extends)) + { + // check if it was set + if ($this->set($this->active[$guid]->extends)) + { + // get the name + $this->active[$guid]->extends_name = $this->get($this->active[$guid]->extends, 1)->class_name; + // add to use + $use[] = $this->active[$guid]->extends; + } + } + } + + /** + * Set Extra Use Classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * @param array $as The use as array + * + * @return void + * @since 3.2.0 + */ + private function setUseAs(string $guid, array $use, array $as) + { + // now add all the extra use statements + if (ArrayHelper::check($use)) + { + foreach (array_unique($use) as $u) + { + if ($this->set($u)) + { + // get the namespace + $namespace = $this->get($u, 1)->namespace; + + // check if it has an AS option + if (isset($as[$u]) && StringHelper::check($as[$u])) + { + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace, $as[$u])); + } + else + { + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace)); + } + } + } + } + } + + /** + * Get Clean Namespace without use or ; as part of the name space + * + * @param string $namespace The actual name space + * @param bool $removeNumbers The switch to remove numbers + * + * @return string + * @since 3.2.0 + */ + private function getCleanNamespace(string $namespace, bool $removeNumbers = true): string + { + // trim possible (use) or (;) or (starting or ending \) added to the namespace + return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace), $removeNumbers); + } + + /** + * Get [use Namespace\Class;] + * + * @param string $namespace The actual name space + * @param string $as The use as name (default is none) + * + * @return string + * @since 3.2.0 + */ + private function getUseNamespace(string $namespace, string $as = 'default'): string + { + // check if it has an AS option + if ($as !== 'default') + { + return 'use ' . $namespace . ' as ' . $as . ';'; + } + return 'use ' . $namespace . ';'; + } + + /** + * Add to class header + * + * @param string $guid The global unique id of the power + * @param string $string The string to add to header + * + * @return void + * @since 3.2.0 + */ + private function addToHeader(string $guid, string $string) + { + // check if it is already added manually + if (isset($this->active[$guid]->head) && + strpos((string) $this->active[$guid]->head, $string) === false) + { + $this->active[$guid]->head .= $string . PHP_EOL; + } + } + + /** + * Set the power licensing template + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setLicensingTemplate(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_licensing_template == 2 && + StringHelper::check($this->active[$guid]->licensing_template)) + { + // set GUI mapper field + $guiMapper['field'] = 'licensing_template'; + + // base64 Decode code + $this->active[$guid]->licensing_template = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $this->active[$guid]->licensing_template + ) + ) + ), + $guiMapper + ); + } + else + { + $this->active[$guid]->add_licensing_template = 1; + $this->active[$guid]->licensing_template = ''; + } + } + + /** + * Set the power header script + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setHeader(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_head == 1) + { + // set GUI mapper field + $guiMapper['field'] = 'head'; + + $head = base64_decode( + (string) $this->active[$guid]->head + ); + + // reserve header for the linker + $this->active[$guid]->unchanged_head = $head; + + // base64 Decode code + $this->active[$guid]->head = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update($head) + ), + $guiMapper + ) . PHP_EOL; + } + else + { + $this->active[$guid]->head = ''; + } + } + + /** + * Set the power main class code + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setMainClassCode(string $guid, array $guiMapper): void + { + if (StringHelper::check($this->active[$guid]->main_class_code)) + { + // set GUI mapper field + $guiMapper['field'] = 'main_class_code'; + + // base64 Decode code + $this->active[$guid]->main_class_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $this->active[$guid]->main_class_code + ) + ) + ), + $guiMapper + ); + } + } + + /** + * Set the super powers of this power + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setSuperPowers(string $guid): void + { + // set the approved super power values + if ($this->config->add_super_powers && $this->active[$guid]->approved == 1) + { + $this->active[$guid]->approved_paths = (isset($this->active[$guid]->approved_paths) + && JsonHelper::check( + $this->active[$guid]->approved_paths + )) ? json_decode((string) $this->active[$guid]->approved_paths, true) : null; + + if (ArrayHelper::check($this->active[$guid]->approved_paths)) + { + $global_path = $this->config->local_powers_repository_path; + + // update all paths + $this->active[$guid]->super_power_paths = array_map(function($path) use($global_path, $guid) { + // set the repo path + $repo = $global_path . '/' . $path; + + // set the global super power + $this->superpowers[$repo][$guid] = [ + 'name' => $this->active[$guid]->code_name, + 'type' => $this->active[$guid]->type, + 'namespace' => $this->active[$guid]->_namespace, + 'code' => 'src/' . $guid . '/code.php', + 'settings' => 'src/' . $guid . '/settings.json', + 'path' => 'src/' . $guid, + 'guid' => $guid + ]; + + return $repo . '/src/' . $guid; + }, array_values($this->active[$guid]->approved_paths)); + + return; + } + } + + // reset all to avoid any misunderstanding down steam + $this->active[$guid]->super_power_paths = null; + $this->active[$guid]->approved_paths = null; + $this->active[$guid]->approved = null; + } + +} + diff --git a/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/settings.json b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/settings.json new file mode 100644 index 0000000..6c7c4c0 --- /dev/null +++ b/src/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1/settings.json @@ -0,0 +1,64 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "implements": [ + "1133c2d7-ba7e-4c95-8cde-01f084d04682" + ], + "implements_custom": "", + "load_selection": null, + "name": "Power", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection3": { + "use": "9c513baf-b279-43fd-ae29-a585c8cbc4f0", + "as": "default" + }, + "use_selection4": { + "use": "30c5b4c2-f75f-4d15-869a-f8bfedd87358", + "as": "default" + }, + "use_selection5": { + "use": "ce8cf834-6bac-44fb-941c-861f7e046cc0", + "as": "default" + }, + "use_selection6": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection7": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection8": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection9": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection10": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power", + "description": "Compiler Power\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;" +} \ No newline at end of file diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md b/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md new file mode 100644 index 0000000..4e7645c --- /dev/null +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Event (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Event #Gold { + # $currentVersion + + register(Container $container) : void + + getEvent(Container $container) : EventInterface + + getJ3Event(Container $container) : J3Event +} + +note right of Event::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Event::getEvent + Get the Event + + since: 3.2.0 + return: EventInterface +end note + +note right of Event::getJ3Event + Get the Joomla 3 Event + + since: 3.2.0 + return: J3Event +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php new file mode 100644 index 0000000..091f7c2 --- /dev/null +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/code.php @@ -0,0 +1,86 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; + + +/** + * Event Service Provider + * + * @since 3.2.0 + */ +class Event implements ServiceProviderInterface +{ + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3Event::class, 'J3.Event') + ->share('J3.Event', [$this, 'getJ3Event'], true); + + $container->alias(EventInterface::class, 'Event') + ->share('Event', [$this, 'getEvent'], true); + } + + /** + * Get the Event + * + * @param Container $container The DI container. + * + * @return EventInterface + * @since 3.2.0 + */ + public function getEvent(Container $container): EventInterface + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Event'); + } + + /** + * Get the Joomla 3 Event + * + * @param Container $container The DI container. + * + * @return J3Event + * @since 3.2.0 + */ + public function getJ3Event(Container $container): J3Event + { + return new J3Event(); + } + +} + diff --git a/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json b/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json new file mode 100644 index 0000000..16723cc --- /dev/null +++ b/src/b94aaedb-6774-4739-a63f-8f87141a85db/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "b94aaedb-6774-4739-a63f-8f87141a85db", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Event", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Event", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection1": { + "use": "4b86f62e-ce41-4325-a11a-08148807d0df", + "as": "J3Event" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Event", + "description": "Event Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;\r\nuse Joomla\\CMS\\Version;" +} \ No newline at end of file diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md new file mode 100644 index 0000000..1f10dc1 --- /dev/null +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface CoreValidationInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field** +```uml +@startuml +interface CoreValidationInterface #Lavender { + + get(bool $lowercase = false) : array +} + +note right of CoreValidationInterface::get + Get the Array of Existing Validation Rule Names + + since: 3.2.0 + return: array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php new file mode 100644 index 0000000..8bf9641 --- /dev/null +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/code.php @@ -0,0 +1,32 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field; + + +/** + * Field Joomla Core Validation Interface + * + * @since 3.2.0 + */ +interface CoreValidationInterface +{ + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array; +} + diff --git a/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json new file mode 100644 index 0000000..f87491b --- /dev/null +++ b/src/b9f05dc4-d23a-499a-a826-9749b81818ed/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "b9f05dc4-d23a-499a-a826-9749b81818ed", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "CoreValidationInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Field.CoreValidationInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Field.CoreValidationInterface", + "description": "Field Joomla Core Validation Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/README.md b/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/README.md new file mode 100644 index 0000000..85e469d --- /dev/null +++ b/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Joomlamodules (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Joomlamodules #Gold { + # Module $module + + __construct(?Module $module = null) + + set(object $item) : void +} + +note right of Joomlamodules::__construct + Constructor + + since: 3.2.0 +end note + +note right of Joomlamodules::set + Set Joomla Module + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/code.php b/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/code.php new file mode 100644 index 0000000..959e805 --- /dev/null +++ b/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/code.php @@ -0,0 +1,84 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Data as Module; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\JsonHelper; + + +/** + * Model Joomla Modules Class + * + * @since 3.2.0 + */ +class Joomlamodules +{ + /** + * Compiler Joomla Module Data Class + * + * @var Module + * @since 3.2.0 + */ + protected Module $module; + + /** + * Constructor + * + * @param Module|null $module The compiler Joomla module data object. + * + * @since 3.2.0 + */ + public function __construct(?Module $module = null) + { + $this->module = $module ?: Compiler::_('Joomlamodule.Data'); + } + + /** + * Set Joomla Module + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + // get all modules + $item->addjoomla_modules = (isset($item->addjoomla_modules) + && JsonHelper::check($item->addjoomla_modules)) + ? json_decode((string) $item->addjoomla_modules, true) : null; + + if (ArrayHelper::check($item->addjoomla_modules)) + { + $joomla_modules = array_map( + function ($array) use (&$item) { + // only load the modules whose target association calls for it + if (!isset($array['target']) || $array['target'] != 2) + { + return $this->module->set( + $array['module'], $item + ); + } + + return null; + }, array_values($item->addjoomla_modules) + ); + } + + unset($item->addjoomla_modules); + } + +} + diff --git a/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/settings.json b/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/settings.json new file mode 100644 index 0000000..1f886f9 --- /dev/null +++ b/src/bfdc4ce5-cb12-4fc6-9023-51cede25edd0/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "bfdc4ce5-cb12-4fc6-9023-51cede25edd0", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Joomlamodules", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Joomlamodules", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "cb11e8d9-69c2-4095-831c-59908ea402e7", + "as": "Module" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Joomlamodules", + "description": "Model Joomla Modules Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/README.md b/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/README.md new file mode 100644 index 0000000..efa5b7b --- /dev/null +++ b/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/README.md @@ -0,0 +1,48 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Phpadminview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Phpadminview #Gold { + # array $areas + # array $guiMapper + # Dispenser $dispenser + # Templatelayout $templateLayout + + __construct(?Dispenser $dispenser = null, ?Templatelayout $templateLayout = null) + + set(object $item, string $table = 'admin_view') : void +} + +note right of Phpadminview::__construct + Constructor + + since: 3.2.0 +end note + +note right of Phpadminview::set + Set PHP code + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/code.php b/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/code.php new file mode 100644 index 0000000..d8c3134 --- /dev/null +++ b/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/code.php @@ -0,0 +1,139 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as Templatelayout; + + +/** + * Model PHP Admin View Class + * + * @since 3.2.0 + */ +class Phpadminview +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = [ + 'php_getitem', + 'php_before_save', + 'php_save', + 'php_getform', + 'php_postsavehook', + 'php_getitems', + 'php_getitems_after_all', + 'php_getlistquery', + 'php_allowadd', + 'php_allowedit', + 'php_before_cancel', + 'php_after_cancel', + 'php_before_delete', + 'php_after_delete', + 'php_before_publish', + 'php_after_publish', + 'php_batchcopy', + 'php_batchmove', + 'php_document' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'admin_view', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Compiler Template Layout Data + * + * @var Templatelayout + * @since 3.2.0 + */ + protected Templatelayout $templateLayout; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser + * @param Templatelayout|null $templateLayout The template layout data + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null, ?Templatelayout $templateLayout = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->templateLayout = $templateLayout ?: Compiler::_('Templatelayout.Data'); + } + + /** + * Set PHP code + * + * @param object $item The item data + * @param string $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'admin_view') + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + foreach ($this->areas as $area) + { + if (isset($item->{'add_' . $area}) + && $item->{'add_' . $area} == 1) + { + // update GUI mapper field + $this->guiMapper['field'] = $area; + $this->dispenser->set( + $item->{$area}, + $area, + $item->name_single_code, + null, + $this->guiMapper + ); + + // check if we have template or layouts to load + $this->templateLayout->set( + $item->{$area}, $item->name_single_code + ); + + unset($item->{$area}); + } + } + } + +} + diff --git a/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/settings.json b/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/settings.json new file mode 100644 index 0000000..064226a --- /dev/null +++ b/src/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Phpadminview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Phpadminview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection2": { + "use": "39ea8150-f124-4e47-909d-641bf1c96d5e", + "as": "Templatelayout" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Phpadminview", + "description": "Model PHP Admin View Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md new file mode 100644 index 0000000..1530b2c --- /dev/null +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/README.md @@ -0,0 +1,118 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Field (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Field #Gold { + # $targetVersion + + register(Container $container) : void + + getField(Container $container) : CompilerField + + getData(Container $container) : Data + + getValidation(Container $container) : Validation + + getJ3CoreValidation(Container $container) : J3CoreValidation + + getCoreValidation(Container $container) : CoreValidationInterface + + getCustomcode(Container $container) : Customcode + + getFieldName(Container $container) : Name + + getFieldTypeName(Container $container) : TypeName + + getFieldUniqueName(Container $container) : UniqueName + + getFieldDatabaseName(Container $container) : DatabaseName +} + +note right of Field::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Field::getField + Get the Compiler Field + + since: 3.2.0 + return: CompilerField +end note + +note right of Field::getData + Get the Compiler Field Data + + since: 3.2.0 + return: Data +end note + +note left of Field::getValidation + Get the Compiler Field Validation + + since: 3.2.0 + return: Validation +end note + +note right of Field::getJ3CoreValidation + Get the Compiler Field Joomla 3 Validation + + since: 3.2.0 + return: J3CoreValidation +end note + +note left of Field::getCoreValidation + Get the Compiler Field Core Validation + + since: 3.2.0 + return: CoreValidationInterface +end note + +note right of Field::getCustomcode + Get the Compiler Field Customcode + + since: 3.2.0 + return: Customcode +end note + +note left of Field::getFieldName + Get the Compiler Field Name + + since: 3.2.0 + return: Name +end note + +note right of Field::getFieldTypeName + Get the Compiler Field Type Name + + since: 3.2.0 + return: TypeName +end note + +note left of Field::getFieldUniqueName + Get the Compiler Field Unique Name + + since: 3.2.0 + return: UniqueName +end note + +note right of Field::getFieldDatabaseName + Get the Compiler Field Database Name + + since: 3.2.0 + return: DatabaseName +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php new file mode 100644 index 0000000..5bbd6ac --- /dev/null +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php @@ -0,0 +1,250 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Field as CompilerField; +use VDM\Joomla\Componentbuilder\Compiler\Field\Data; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name; +use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; +use VDM\Joomla\Componentbuilder\Compiler\Field\Validation; +use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreValidation as J3CoreValidation; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; + + +/** + * Compiler Field + * + * @since 3.2.0 + */ +class Field implements ServiceProviderInterface +{ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerField::class, 'Field') + ->share('Field', [$this, 'getField'], true); + + $container->alias(Data::class, 'Field.Data') + ->share('Field.Data', [$this, 'getData'], true); + + $container->alias(Validation::class, 'Field.Validation') + ->share('Field.Validation', [$this, 'getValidation'], true); + + $container->alias(J3CoreValidation::class, 'J3.Field.Core.Validation') + ->share('J3.Field.Core.Validation', [$this, 'getJ3CoreValidation'], true); + + $container->alias(CoreValidationInterface::class, 'Field.Core.Validation') + ->share('Field.Core.Validation', [$this, 'getCoreValidation'], true); + + $container->alias(Customcode::class, 'Field.Customcode') + ->share('Field.Customcode', [$this, 'getCustomcode'], true); + + $container->alias(Name::class, 'Field.Name') + ->share('Field.Name', [$this, 'getFieldName'], true); + + $container->alias(TypeName::class, 'Field.Type.Name') + ->share('Field.Type.Name', [$this, 'getFieldTypeName'], true); + + $container->alias(UniqueName::class, 'Field.Unique.Name') + ->share('Field.Unique.Name', [$this, 'getFieldUniqueName'], true); + + $container->alias(DatabaseName::class, 'Field.Database.Name') + ->share('Field.Database.Name', [$this, 'getFieldDatabaseName'], true); + } + + /** + * Get the Compiler Field + * + * @param Container $container The DI container. + * + * @return CompilerField + * @since 3.2.0 + */ + public function getField(Container $container): CompilerField + { + return new CompilerField( + $container->get('Field.Data'), + $container->get('Field.Name'), + $container->get('Field.Type.Name'), + $container->get('Field.Unique.Name') + ); + } + + /** + * Get the Compiler Field Data + * + * @param Container $container The DI container. + * + * @return Data + * @since 3.2.0 + */ + public function getData(Container $container): Data + { + return new Data( + $container->get('Config'), + $container->get('Event'), + $container->get('History'), + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Field.Customcode'), + $container->get('Field.Validation') + ); + } + + /** + * Get the Compiler Field Validation + * + * @param Container $container The DI container. + * + * @return Validation + * @since 3.2.0 + */ + public function getValidation(Container $container): Validation + { + return new Validation( + $container->get('Registry'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Field.Core.Validation') + ); + } + + /** + * Get the Compiler Field Joomla 3 Validation + * + * @param Container $container The DI container. + * + * @return J3CoreValidation + * @since 3.2.0 + */ + public function getJ3CoreValidation(Container $container): J3CoreValidation + { + return new J3CoreValidation(); + } + + /** + * Get the Compiler Field Core Validation + * + * @param Container $container The DI container. + * + * @return CoreValidationInterface + * @since 3.2.0 + */ + public function getCoreValidation(Container $container): CoreValidationInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Field.Core.Validation'); + } + + /** + * Get the Compiler Field Customcode + * + * @param Container $container The DI container. + * + * @return Customcode + * @since 3.2.0 + */ + public function getCustomcode(Container $container): Customcode + { + return new Customcode( + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the Compiler Field Name + * + * @param Container $container The DI container. + * + * @return Name + * @since 3.2.0 + */ + public function getFieldName(Container $container): Name + { + return new Name( + $container->get('Placeholder'), + $container->get('Field.Unique.Name'), + $container->get('Registry') + ); + } + + /** + * Get the Compiler Field Type Name + * + * @param Container $container The DI container. + * + * @return TypeName + * @since 3.2.0 + */ + public function getFieldTypeName(Container $container): TypeName + { + return new TypeName(); + } + + /** + * Get the Compiler Field Unique Name + * + * @param Container $container The DI container. + * + * @return UniqueName + * @since 3.2.0 + */ + public function getFieldUniqueName(Container $container): UniqueName + { + return new UniqueName( + $container->get('Registry') + ); + } + + /** + * Get the Compiler Field Database Name + * + * @param Container $container The DI container. + * + * @return DatabaseName + * @since 3.2.0 + */ + public function getFieldDatabaseName(Container $container): DatabaseName + { + return new DatabaseName( + $container->get('Registry') + ); + } + +} + diff --git a/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json new file mode 100644 index 0000000..c218e7c --- /dev/null +++ b/src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json @@ -0,0 +1,59 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "c6c30d66-3106-44eb-9272-b2cf7ec74613", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Field", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Field", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "as": "CompilerField" + }, + "use_selection1": { + "use": "ce826b66-0f2d-43da-8005-41b8e4cb21ee", + "as": "default" + }, + "use_selection2": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "default" + }, + "use_selection3": { + "use": "eb33420d-359d-44a5-852e-613aef1feaae", + "as": "default" + }, + "use_selection4": { + "use": "8c018533-e967-4bf2-9bd9-9e92966fcb5e", + "as": "default" + }, + "use_selection5": { + "use": "c871fb4a-4c33-4302-bb79-a9cd7ef4a557", + "as": "default" + }, + "use_selection6": { + "use": "a356d103-74f3-49ca-8e4f-3bd37746f089", + "as": "default" + }, + "use_selection7": { + "use": "99368a6f-2f64-4d4e-ad3a-544d4020ecc6", + "as": "default" + }, + "use_selection8": { + "use": "24da9672-e47f-4bb1-b6c0-0ebfc17f0957", + "as": "J3CoreValidation" + }, + "use_selection9": { + "use": "b9f05dc4-d23a-499a-a826-9749b81818ed", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Field", + "description": "Compiler Field\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/README.md b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/README.md new file mode 100644 index 0000000..4d2fc0a --- /dev/null +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Validation (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class Validation #Gold { + # Registry $registry + # Gui $gui + # Placeholder $placeholder + # Customcode $customcode + # CoreValidationInterface $validation + + __construct(?Registry $registry = null, ?Gui $gui = null, ...) + + set(int $id, string $field) : void +} + +note right of Validation::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Registry $registry = null + ?Gui $gui = null + ?Placeholder $placeholder = null + ?Customcode $customcode = null + ?CoreValidationInterface $validation = null +end note + +note right of Validation::set + Set the validation rule + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php new file mode 100644 index 0000000..afe05dc --- /dev/null +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/code.php @@ -0,0 +1,168 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; + + +/** + * Compiler Field Validation Rules + * + * @since 3.2.0 + */ +class Validation +{ + /** + * Compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Gui + * + * @var Gui + * @since 3.2.0 + */ + protected Gui $gui; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Field Core Validation + * + * @var CoreValidationInterface + * @since 3.2.0 + */ + protected CoreValidationInterface $validation; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * @param Gui|null $gui The compiler customcode gui object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param CoreValidationInterface|null $validation The core validation rule object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null, ?Gui $gui = null, ?Placeholder $placeholder = null, + ?Customcode $customcode = null, ?CoreValidationInterface $validation = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->validation = $validation ?: Compiler::_('Field.Core.Validation'); + } + + /** + * Set the validation rule + * + * @param int $id The field id + * @param string $field The field string + * + * @return void + * @since 3.2.0 + */ + public function set(int $id, string $field) + { + // check if we have validate (validation rule set) + $validation_rule = GetHelper::between( + $field, 'validate="', '"' + ); + + if (StringHelper::check($validation_rule)) + { + // make sure it is lowercase + $validation_rule = StringHelper::safe( + $validation_rule + ); + + // link this field to this validation (don't move this down) + $this->registry->set("validation.linked.${id}", $validation_rule); + + // make sure it is not already set + if ($this->registry->get("validation.rules.${validation_rule}") === null) + { + // get joomla core validation names and make sure this rule is not a core validation rule + if (!in_array($validation_rule, (array) $this->validation->get(true))) + { + // get the class methods for this rule if it exists + if (($php_code = GetHelper::var( + 'validation_rule', $validation_rule, 'name', 'php' + )) !== false) + { + // open and set the validation rule + $this->registry->set("validation.rules.${validation_rule}", + $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $php_code + ) + ) + ), + array( + 'table' => 'validation_rule', + 'field' => 'php', + 'id' => GetHelper::var( + 'validation_rule', + $validation_rule, 'name', 'id' + ), + 'type' => 'php' + ) + ) + ); + } + else + { + // TODO set the notice that this validation rule is custom and was not found + $this->registry->remove("validation.linked.${id}"); + } + } + else + { + // remove link (we only want custom validations linked) + $this->registry->remove("validation.linked.${id}"); + } + } + } + } + +} + diff --git a/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json new file mode 100644 index 0000000..7f0770a --- /dev/null +++ b/src/c871fb4a-4c33-4302-bb79-a9cd7ef4a557/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "c871fb4a-4c33-4302-bb79-a9cd7ef4a557", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Validation", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.Validation", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection4": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection5": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection6": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection7": { + "use": "b9f05dc4-d23a-499a-a826-9749b81818ed", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Validation", + "description": "Compiler Field Validation Rules\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ca111518-e47c-4049-b1b2-cb010f23866f/README.md b/src/ca111518-e47c-4049-b1b2-cb010f23866f/README.md new file mode 100644 index 0000000..6eaf2c6 --- /dev/null +++ b/src/ca111518-e47c-4049-b1b2-cb010f23866f/README.md @@ -0,0 +1,75 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Reverse (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Placeholder** +```uml +@startuml +class Reverse #Gold { + # Config $config + # Placeholder $placeholder + # Language $language + # Extractor $extractor + + __construct(?Config $config = null, ?Placeholder $placeholder = null, ...) + + engine(string $string, array $placeholders, ...) : string + # setReverse(string $updateString, string $string, ...) : string +} + +note right of Reverse::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Placeholder $placeholder = null + ?Language $language = null + ?Extractor $extractor = null +end note + +note right of Reverse::engine + Reverse Engineer the dynamic placeholders (TODO hmmmm this is not ideal) + + since: 3.2.0 + return: string + + arguments: + string $string + array $placeholders + string $target + ?int $id = null + string $field = 'code' + string $table = 'custom_code' +end note + +note right of Reverse::setReverse + Set the language strings for the reveres process + + since: 3.2.0 + return: string + + arguments: + string $updateString + string $string + string $target +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php b/src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php new file mode 100644 index 0000000..9c866ab --- /dev/null +++ b/src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php @@ -0,0 +1,237 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Placeholder; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; + + +/** + * Compiler Placeholder Reverse + * + * @since 3.2.0 + */ +class Reverse +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Compiler Language Extractor + * + * @var Extractor + * @since 3.2.0 + **/ + protected Extractor $extractor; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Language|null $language The compiler language object. + * @param Extract|null $extractor The compiler language extractor object. + * + * @since 3.2.0 + */ + public function __construct( + ?Config $config = null, ?Placeholder $placeholder = null, + ?Language $language = null, ?Extractor $extractor = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->language = $language ?: Compiler::_('Language'); + $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); + } + + /** + * Reverse Engineer the dynamic placeholders (TODO hmmmm this is not ideal) + * + * @param string $string The string to revers + * @param array $placeholders The values to search for + * @param string $target The target path type + * @param int|null $id The custom code id + * @param string $field The field name + * @param string $table The table name + * + * @return string + * @since 3.2.0 + */ + public function engine(string $string, array &$placeholders, + string $target, ?int $id = null, string $field = 'code', string $table = 'custom_code'): string + { + // get local code if set + if ($id > 0 && $code = base64_decode( + (string) GetHelper::var($table, $id, 'id', $field) + )) + { + $string = $this->setReverse( + $string, $code, $target + ); + } + + return $this->placeholder->update($string, $placeholders, 2); + } + + /** + * Set the language strings for the reveres process + * + * @param string $updateString The string to update + * @param string $string The string to use language update + * @param string $target The target path type + * + * @return string + * @since 3.2.0 + */ + protected function setReverse(string $updateString, string $string, string $target): string + { + // get targets to search for + $lang_string_targets = array_filter( + $this->config->lang_string_targets, + fn($get): bool => strpos($string, (string) $get) !== false + ); + // check if we should continue + if (ArrayHelper::check($lang_string_targets)) + { + // start lang holder + $lang_holders = []; + // set the lang for both since we don't know what area is being targeted + $_tmp = $this->config->lang_target; + // set the lang based on target + if (strpos($target, 'module') !== false) + { + // backup lang prefix + $_tmp_lang_prefix = $this->config->lang_prefix; + // set the new lang prefix + $lang_prefix = strtoupper( + str_replace('module', 'mod', $target) + ); + $this->config->set('lang_prefix', $lang_prefix); + // now set the lang + if (isset($this->extractor->langKeys[$this->config->lang_prefix])) + { + $this->config->lang_target = $this->extractor->langKeys[$this->config->lang_prefix]; + } + else + { + $this->config->lang_target = 'module'; + } + } + elseif (strpos($target, 'plugin') !== false) + { + // backup lang prefix + $_tmp_lang_prefix = $this->config->lang_prefix; + // set the new lang prefix + $lang_prefix = strtoupper( + str_replace('plugin', 'plg', $target) + ); + $this->config->set('lang_prefix', $lang_prefix); + // now set the lang + if (isset($this->extractor->langKeys[$this->config->lang_prefix])) + { + $this->config->lang_target = $this->extractor->langKeys[$this->config->lang_prefix]; + } + else + { + $this->config->lang_target = 'plugin'; + } + } + else + { + $this->config->lang_target = 'both'; + } + // set language data + foreach ($lang_string_targets as $lang_string_target) + { + $lang_check[] = GetHelper::allBetween( + $string, $lang_string_target . "'", "'" + ); + $lang_check[] = GetHelper::allBetween( + $string, $lang_string_target . "'", "'" + ); + } + // merge arrays + $lang_array = ArrayHelper::merge($lang_check); + // continue only if strings were found + if (ArrayHelper::check( + $lang_array + )) //<-- not really needed hmmm + { + foreach ($lang_array as $lang) + { + $_key_lang = StringHelper::safe($lang, 'U'); + // this is there to insure we dont break already added Language strings + if ($_key_lang === $lang) + { + continue; + } + // build lang key + $key_lang = $this->config->lang_prefix . '_' . $_key_lang; + // set lang content string + $this->language->set($this->config->lang_target, $key_lang, $lang); + // reverse the placeholders + foreach ($lang_string_targets as $lang_string_target) + { + $lang_holders[$lang_string_target . "'" . $key_lang . "'"] + = $lang_string_target . "'" . $lang . "'"; + $lang_holders[$lang_string_target . '"' . $key_lang . '"'] + = $lang_string_target . '"' . $lang . '"'; + } + } + // return the found placeholders + $updateString = $this->placeholder->update( + $updateString, $lang_holders + ); + } + // reset the lang + $this->config->lang_target = $_tmp; + // also rest the lang prefix if set + if (isset($_tmp_lang_prefix)) + { + $lang_prefix = $_tmp_lang_prefix; + $this->config->set('lang_prefix', $_tmp_lang_prefix); + } + } + + return $updateString; + } + +} + diff --git a/src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json b/src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json new file mode 100644 index 0000000..9b5c229 --- /dev/null +++ b/src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json @@ -0,0 +1,49 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ca111518-e47c-4049-b1b2-cb010f23866f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Reverse", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Placeholder.Reverse", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection4": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection5": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection6": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection7": { + "use": "d33b9278-c409-4aec-a047-b72f56712391", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Placeholder.Reverse", + "description": "Compiler Placeholder Reverse\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md new file mode 100644 index 0000000..eeb3a5f --- /dev/null +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface FactoryInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface FactoryInterface #Lavender { + + {static} _(string $key) : Mixed + + {static} getContainer() : Container +} + +note right of FactoryInterface::_ + Get any class from the container + + since: 3.2.0 + return: Mixed +end note + +note right of FactoryInterface::getContainer + Get the global container + + since: 3.2.0 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php new file mode 100644 index 0000000..aff5406 --- /dev/null +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php @@ -0,0 +1,42 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +use Joomla\DI\Container; + + +/** + * The Container Factory Interface + */ +interface FactoryInterface +{ + /** + * Get any class from the container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _(string $key); + + /** + * Get the global container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container; + +} + diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json new file mode 100644 index 0000000..5d0f7a4 --- /dev/null +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json @@ -0,0 +1,17 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "caf33c5d-858c-4f9a-894f-ab302ec5445a", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "FactoryInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.FactoryInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.FactoryInterface", + "description": "The Container Factory Interface", + "head": "use Joomla\\DI\\Container;" +} \ No newline at end of file diff --git a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md new file mode 100644 index 0000000..b8bc711 --- /dev/null +++ b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/README.md @@ -0,0 +1,85 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Joomlamodule** +```uml +@startuml +class Data #Gold { + # array $data + # Config $config + # Customcode $customcode + # Gui $gui + # Placeholder $placeholder + # Language $language + # Field $field + # FieldName $fieldName + # Filesfolders $filesFolders + # Libraries $libraries + # Dynamicget $dynamic + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Customcode $customcode = null, ...) + + get(int $id = null) : object|array|null + + exists(int $id = null) : bool + + set(int $id) : bool +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Placeholder $placeholder = null + ?Language $language = null + ?Field $field = null + ?FieldName $fieldName = null + ?Filesfolders $filesFolders = null + ?Libraries $libraries = null + ?Dynamicget $dynamic = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get the Joomla Module/s + + since: 3.2.0 + return: object|array|null +end note + +note right of Data::exists + Check if the Joomla Module/s exists + + since: 3.2.0 + return: bool +end note + +note right of Data::set + Set the Joomla Module + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php new file mode 100644 index 0000000..4fb42f2 --- /dev/null +++ b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/code.php @@ -0,0 +1,957 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Joomlamodule; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Filter\OutputFilter; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Field; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; +use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries; +use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Data as Dynamicget; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; + + +/** + * Joomla Module Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Joomla Plugins Data + * + * @var array + * @since 3.2.0 + */ + protected array $data = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Compiler Field + * + * @var Field + * @since 3.2.0 + */ + protected Field $field; + + /** + * Compiler field name + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldName; + + /** + * Compiler Files Folders + * + * @var Filesfolders + * @since 3.2.0 + */ + protected Filesfolders $filesFolders; + + /** + * Compiler Libraries Model + * + * @var Libraries + * @since 3.2.0 + */ + protected Libraries $libraries; + + /** + * Compiler Dynamic Get Data + * + * @var Dynamicget + * @since 3.2.0 + */ + protected Dynamicget $dynamic; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Language|null $language The compiler Language object. + * @param Field|null $field The compiler field data object. + * @param FieldName|null $fieldName The compiler field name object. + * @param Filesfolders|null $filesFolders The compiler files folders object. + * @param Libraries|null $libraries The compiler libraries model object. + * @param Dynamicget|null $dynamic The compiler dynamic get data object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Customcode $customcode = null, + ?Gui $gui = null, ?Placeholder $placeholder = null, + ?Language $language = null, ?Field $field = null, ?FieldName $fieldName = null, + ?Filesfolders $filesFolders = null, ?Libraries $libraries = null, + ?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->language = $language ?: Compiler::_('Language'); + $this->field = $field ?: Compiler::_('Field'); + $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); + $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); + $this->libraries = $libraries ?: Compiler::_('Model.Libraries'); + $this->dynamic = $dynamic ?: Compiler::_('Dynamicget.Data'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get the Joomla Module/s + * + * @param int|null $id the module id + * + * @return object|array|null if ID found it returns object, if no ID given it returns all set + * @since 3.2.0 + */ + public function get(int $id = null) + { + if (is_null($id) && $this->exists()) + { + return $this->data; + } + elseif ($this->exists($id)) + { + return $this->data[$id]; + } + + return null; + } + + /** + * Check if the Joomla Module/s exists + * + * @param int|null $id the module id + * + * @return bool if ID found it returns true, if no ID given it returns true if any are set + * @since 3.2.0 + */ + public function exists(int $id = null): bool + { + if (is_null($id)) + { + return ArrayHelper::check($this->data); + } + elseif (isset($this->data[$id])) + { + return true; + } + + return $this->set($id); + } + + /** + * Set the Joomla Module + * + * @param int $id the module id + * + * @return bool true on success + * @since 3.2.0 + */ + public function set(int $id): bool + { + if (isset($this->data[$id])) + { + return true; + } + else + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'f.addfiles', + 'f.addfolders', + 'f.addfilesfullpath', + 'f.addfoldersfullpath', + 'f.addurls', + 'u.version_update', + 'u.id' + ), array( + 'addfiles', + 'addfolders', + 'addfilesfullpath', + 'addfoldersfullpath', + 'addurls', + 'version_update', + 'version_update_id' + ) + ) + ); + // from these tables + $query->from('#__componentbuilder_joomla_module AS a'); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_module_updates', 'u' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('u.joomla_module') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_module_files_folders_urls', 'f' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('f.joomla_module') . ')' + ); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $query->where($this->db->quoteName('a.published') . ' >= 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // get the module data + $module = $this->db->loadObject(); + + // tweak system to set stuff to the module domain + $_backup_target = $this->config->build_target; + $_backup_lang = $this->config->lang_target; + $_backup_langPrefix = $this->config->lang_prefix; + + // set some keys + $module->target_type = 'M0dU|3'; + $module->key = $module->id . '_' . $module->target_type; + + // update to point to module + $this->config->build_target = $module->key; + $this->config->lang_target = $module->key; + + // set version if not set + if (empty($module->module_version)) + { + $module->module_version = '1.0.0'; + } + + // set target client + if ($module->target == 2) + { + $module->target_client = 'administrator'; + } + else + { + // default is site area + $module->target_client = 'site'; + } + + // set GUI mapper + $guiMapper = array('table' => 'joomla_module', + 'id' => (int) $id, 'type' => 'php'); + // update the name if it has dynamic values + $module->name = $this->placeholder->update_( + $this->customcode->update($module->name) + ); + + // set safe class function name + $module->code_name + = ClassfunctionHelper::safe( + $module->name + ); + + // alias of code name + $module->class_name = $module->code_name; + // set official name + $module->official_name = StringHelper::safe( + $module->name, 'W' + ); + $this->config->set('lang_prefix', 'MOD_' . strtoupper((string) $module->code_name)); + + // set lang prefix + $module->lang_prefix = $this->config->lang_prefix; + + // set module class name + $module->class_helper_name = 'Mod' . ucfirst((string) $module->code_name) + . 'Helper'; + $module->class_data_name = 'Mod' . ucfirst((string) $module->code_name) + . 'Data'; + + // set module install class name + $module->installer_class_name = 'mod_' . ucfirst( + (string) $module->code_name + ) . 'InstallerScript'; + + // set module folder name + $module->folder_name = 'mod_' . strtolower((string) $module->code_name); + + // set the zip name + $module->zip_name = $module->folder_name . '_v' . str_replace( + '.', '_', (string) $module->module_version + ) . '__J' . $this->config->joomla_version; + + // set module file name + $module->file_name = $module->folder_name; + + // set module context + $module->context = $module->file_name . '.' . $module->id; + + // set official_name lang strings + $this->language->set( + $module->key, $this->config->lang_prefix, $module->official_name + ); + + // set some placeholder for this module + $this->placeholder->set('Module_name', $module->official_name); + $this->placeholder->set('Module', ucfirst( + (string) $module->code_name + )); + $this->placeholder->set('module', strtolower( + (string) $module->code_name + )); + $this->placeholder->set('module.version', $module->module_version); + $this->placeholder->set('module_version', str_replace( + '.', '_', (string) $module->module_version + )); + // set description (TODO) add description field to module + if (!isset($module->description) + || !StringHelper::check( + $module->description + )) + { + $module->description = ''; + } + else + { + $module->description = $this->placeholder->update_( + $this->customcode->update($module->description) + ); + $this->language->set( + $module->key, $module->lang_prefix . '_DESCRIPTION', + $module->description + ); + $module->description = '

' . $module->description + . '

'; + } + + // get author name + $project_author = $this->config->project_author; + + // set the description + $module->xml_description = "

" . $module->official_name + . " (v." . $module->module_version + . ")

" + . $module->description . "

Created by " . trim( + (string) OutputFilter::cleanText($project_author) + ) . "
Development started " + . Factory::getDate($module->created)->format("jS F, Y") + . "

"; + + // set xml description + $this->language->set( + $module->key, $module->lang_prefix . '_XML_DESCRIPTION', + $module->xml_description + ); + + // update the readme if set + if ($module->addreadme == 1 && !empty($module->readme)) + { + $module->readme = $this->placeholder->update_( + $this->customcode->update(base64_decode((string) $module->readme)) + ); + } + else + { + $module->addreadme = 0; + unset($module->readme); + } + + // get the custom_get + $module->custom_get = (isset($module->custom_get) + && JsonHelper::check($module->custom_get)) + ? json_decode((string) $module->custom_get, true) : null; + + if (ArrayHelper::check($module->custom_get)) + { + $module->custom_get = $this->dynamic->get( + $module->custom_get, $module->key, $module->key + ); + } + else + { + $module->custom_get = null; + } + + // set helper class details + if ($module->add_class_helper >= 1 + && StringHelper::check( + $module->class_helper_code + )) + { + if ($module->add_class_helper_header == 1 + && StringHelper::check( + $module->class_helper_header + )) + { + // set GUI mapper field + $guiMapper['field'] = 'class_helper_header'; + // base64 Decode code + $module->class_helper_header = PHP_EOL + . $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $module->class_helper_header + ) + ) + ), + $guiMapper + ) . PHP_EOL; + } + else + { + $module->add_class_helper_header = 0; + $module->class_helper_header = ''; + } + // set GUI mapper field + $guiMapper['field'] = 'class_helper_code'; + // base64 Decode code + $module->class_helper_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $module->class_helper_code) + ) + ), + $guiMapper + ); + // set class type + if ($module->add_class_helper == 2) + { + $module->class_helper_type = 'abstract class '; + } + else + { + $module->class_helper_type = 'class '; + } + } + else + { + $module->add_class_helper = 0; + $module->class_helper_code = ''; + $module->class_helper_header = ''; + } + + // base64 Decode mod_code + if (isset($module->mod_code) + && StringHelper::check($module->mod_code)) + { + // set GUI mapper field + $guiMapper['field'] = 'mod_code'; + $module->mod_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $module->mod_code) + ) + ), + $guiMapper + ); + } + else + { + $module->mod_code = "// get the module class sfx"; + $module->mod_code .= PHP_EOL + . "\$moduleclass_sfx = htmlspecialchars(\$params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');"; + $module->mod_code .= PHP_EOL . "// load the default Tmpl"; + $module->mod_code .= PHP_EOL + . "require JModuleHelper::getLayoutPath('mod_" + . strtolower((string) $module->code_name) + . "', \$params->get('layout', 'default'));"; + } + + // base64 Decode default header + if (isset($module->default_header) + && StringHelper::check( + $module->default_header + )) + { + // set GUI mapper field + $guiMapper['field'] = 'default_header'; + $module->default_header = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $module->default_header) + ) + ), + $guiMapper + ); + } + else + { + $module->default_header = ''; + } + + // base64 Decode default + if (isset($module->default) + && StringHelper::check($module->default)) + { + // set GUI mapper field + $guiMapper['field'] = 'default'; + $guiMapper['type'] = 'html'; + $module->default = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $module->default) + ) + ), + $guiMapper + ); + } + else + { + $module->default = '

No Tmpl set

'; + } + + // start the config array + $module->config_fields = []; + // create the form arrays + $module->form_files = []; + $module->fieldsets_label = []; + $module->fieldsets_paths = []; + $module->add_rule_path = []; + $module->add_field_path = []; + // set global fields rule to default component path + $module->fields_rules_paths = 1; + // set the fields data + $module->fields = (isset($module->fields) + && JsonHelper::check($module->fields)) + ? json_decode((string) $module->fields, true) : null; + if (ArrayHelper::check($module->fields)) + { + // ket global key + $key = $module->key; + $dynamic_fields = array('fieldset' => 'basic', + 'fields_name' => 'params', + 'file' => 'config'); + foreach ($module->fields as $n => &$form) + { + if (isset($form['fields']) + && ArrayHelper::check( + $form['fields'] + )) + { + // make sure the dynamic_field is set to dynamic_value by default + foreach ( + $dynamic_fields as $dynamic_field => + $dynamic_value + ) + { + if (!isset($form[$dynamic_field]) + || !StringHelper::check( + $form[$dynamic_field] + )) + { + $form[$dynamic_field] = $dynamic_value; + } + else + { + if ('fields_name' === $dynamic_field + && strpos((string) $form[$dynamic_field], '.') + !== false) + { + $form[$dynamic_field] + = $form[$dynamic_field]; + } + else + { + $form[$dynamic_field] + = StringHelper::safe( + $form[$dynamic_field] + ); + } + } + } + // check if field is external form file + if (!isset($form['module']) || $form['module'] != 1) + { + // now build the form key + $unique = $form['file'] . $form['fields_name'] + . $form['fieldset']; + } + else + { + // now build the form key + $unique = $form['fields_name'] + . $form['fieldset']; + } + // set global fields rule path switches + if ($module->fields_rules_paths == 1 + && isset($form['fields_rules_paths']) + && $form['fields_rules_paths'] == 2) + { + $module->fields_rules_paths = 2; + } + // set where to path is pointing + $module->fieldsets_paths[$unique] + = $form['fields_rules_paths']; + // check for extra rule paths + if (isset($form['addrulepath']) + && ArrayHelper::check($form['addrulepath'])) + { + foreach ($form['addrulepath'] as $add_rule_path) + { + if (StringHelper::check($add_rule_path['path'])) + { + $module->add_rule_path[$unique] = $add_rule_path['path']; + } + } + } + // check for extra field paths + if (isset($form['addfieldpath']) + && ArrayHelper::check($form['addfieldpath'])) + { + foreach ($form['addfieldpath'] as $add_field_path) + { + if (StringHelper::check($add_field_path['path'])) + { + $module->add_field_path[$unique] = $add_field_path['path']; + } + } + } + // add the label if set to lang + if (isset($form['label']) + && StringHelper::check( + $form['label'] + )) + { + $module->fieldsets_label[$unique] + = $this->language->key($form['label']); + } + // build the fields + $form['fields'] = array_map( + function ($field) use ($key, $unique) { + // make sure the alias and title is 0 + $field['alias'] = 0; + $field['title'] = 0; + // set the field details + $this->field->set( + $field, $key, $key, $unique + ); + // update the default if set + if (StringHelper::check( + $field['custom_value'] + ) + && isset($field['settings'])) + { + if (($old_default + = GetHelper::between( + $field['settings']->xml, + 'default="', '"', false + )) !== false) + { + // replace old default + $field['settings']->xml + = str_replace( + 'default="' . $old_default + . '"', 'default="' + . $field['custom_value'] . '"', + (string) $field['settings']->xml + ); + } + else + { + // add the default (hmmm not ideal but okay it should work) + $field['settings']->xml + = 'default="' + . $field['custom_value'] . '" ' + . $field['settings']->xml; + } + } + unset($field['custom_value']); + + // return field + return $field; + }, array_values($form['fields']) + ); + // check if field is external form file + if (!isset($form['module']) || $form['module'] != 1) + { + // load the form file + if (!isset($module->form_files[$form['file']])) + { + $module->form_files[$form['file']] + = []; + } + if (!isset($module->form_files[$form['file']][$form['fields_name']])) + { + $module->form_files[$form['file']][$form['fields_name']] + = []; + } + if (!isset($module->form_files[$form['file']][$form['fields_name']][$form['fieldset']])) + { + $module->form_files[$form['file']][$form['fields_name']][$form['fieldset']] + = []; + } + // do some house cleaning (for fields) + foreach ($form['fields'] as $field) + { + // so first we lock the field name in + $this->fieldName->get( + $field, $module->key, $unique + ); + // add the fields to the global form file builder + $module->form_files[$form['file']][$form['fields_name']][$form['fieldset']][] + = $field; + } + // remove form + unset($module->fields[$n]); + } + else + { + // load the config form + if (!isset($module->config_fields[$form['fields_name']])) + { + $module->config_fields[$form['fields_name']] + = []; + } + if (!isset($module->config_fields[$form['fields_name']][$form['fieldset']])) + { + $module->config_fields[$form['fields_name']][$form['fieldset']] + = []; + } + // do some house cleaning (for fields) + foreach ($form['fields'] as $field) + { + // so first we lock the field name in + $this->fieldName->get( + $field, $module->key, $unique + ); + // add the fields to the config builder + $module->config_fields[$form['fields_name']][$form['fieldset']][] + = $field; + } + // remove form + unset($module->fields[$n]); + } + } + else + { + unset($module->fields[$n]); + } + } + } + unset($module->fields); + + // set files and folders + $this->filesFolders->set($module); + + // set libraries + $this->libraries->set($module->code_name, $module); + + // add PHP in module install + $module->add_install_script = true; + $addScriptMethods = [ + 'php_script', + 'php_preflight', + 'php_postflight', + 'php_method' + ]; + $addScriptTypes = [ + 'install', + 'update', + 'uninstall' + ]; + // the next are php placeholders + $guiMapper['type'] = 'php'; + foreach ($addScriptMethods as $scriptMethod) + { + foreach ($addScriptTypes as $scriptType) + { + if (isset($module->{'add_' . $scriptMethod . '_' . $scriptType}) + && $module->{'add_' . $scriptMethod . '_' . $scriptType} == 1 + && StringHelper::check( + $module->{$scriptMethod . '_' . $scriptType} + )) + { + // set GUI mapper field + $guiMapper['field'] = $scriptMethod . '_' . $scriptType; + $module->{$scriptMethod . '_' . $scriptType} = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $module->{$scriptMethod . '_' . $scriptType} + ) + ) + ), + $guiMapper + ); + } + else + { + unset($module->{$scriptMethod . '_' . $scriptType}); + $module->{'add_' . $scriptMethod . '_' . $scriptType} = 0; + } + } + } + + // add_sql + if ($module->add_sql == 1 + && StringHelper::check($module->sql)) + { + $module->sql = $this->placeholder->update_( + $this->customcode->update(base64_decode((string) $module->sql)) + ); + } + else + { + unset($module->sql); + $module->add_sql = 0; + } + + // add_sql_uninstall + if ($module->add_sql_uninstall == 1 + && StringHelper::check( + $module->sql_uninstall + )) + { + $module->sql_uninstall = $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $module->sql_uninstall) + ) + ); + } + else + { + unset($module->sql_uninstall); + $module->add_sql_uninstall = 0; + } + + // update the URL of the update_server if set + if ($module->add_update_server == 1 + && StringHelper::check( + $module->update_server_url + )) + { + $module->update_server_url = $this->placeholder->update_( + $this->customcode->update($module->update_server_url) + ); + } + + // add the update/sales server FTP details if that is the expected protocol + $serverArray = array('update_server', 'sales_server'); + foreach ($serverArray as $server) + { + if ($module->{'add_' . $server} == 1 + && is_numeric( + $module->{$server} + ) + && $module->{$server} > 0) + { + // get the server protocol + $module->{$server . '_protocol'} + = GetHelper::var( + 'server', (int) $module->{$server}, 'id', 'protocol' + ); + } + else + { + $module->{$server} = 0; + // only change this for sales server (update server can be added loacaly to the zip file) + if ('sales_server' === $server) + { + $module->{'add_' . $server} = 0; + } + $module->{$server . '_protocol'} = 0; + } + } + + // set the update server stuff (TODO) + // update_server_xml_path + // update_server_xml_file_name + + // rest globals + $this->config->build_target = $_backup_target; + $this->config->lang_target = $_backup_lang; + $this->config->lang_prefix = $_backup_langPrefix; + + $this->placeholder->remove('Module_name'); + $this->placeholder->remove('Module'); + $this->placeholder->remove('module'); + $this->placeholder->remove('module.version'); + $this->placeholder->remove('module_version'); + + $this->data[$id] = $module; + + return true; + } + } + + return false; + } + +} + diff --git a/src/cb11e8d9-69c2-4095-831c-59908ea402e7/settings.json b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/settings.json new file mode 100644 index 0000000..c7b0f7c --- /dev/null +++ b/src/cb11e8d9-69c2-4095-831c-59908ea402e7/settings.json @@ -0,0 +1,82 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "cb11e8d9-69c2-4095-831c-59908ea402e7", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Joomlamodule.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection3": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection6": { + "use": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "as": "default" + }, + "use_selection7": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection8": { + "use": "f4578c04-a81e-4218-b80d-b0612196eaf0", + "as": "default" + }, + "use_selection9": { + "use": "59895f37-50c8-4af3-9dad-230e18841953", + "as": "default" + }, + "use_selection10": { + "use": "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46", + "as": "Dynamicget" + }, + "use_selection11": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection12": { + "use": "30c5b4c2-f75f-4d15-869a-f8bfedd87358", + "as": "default" + }, + "use_selection13": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection14": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection15": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Joomlamodule.Data", + "description": "Joomla Module Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Filter\\OutputFilter;" +} \ No newline at end of file diff --git a/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/README.md b/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/README.md new file mode 100644 index 0000000..43e9fa3 --- /dev/null +++ b/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/README.md @@ -0,0 +1,41 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Pathfix (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class Pathfix #Gold { + + set(mixed $values, array $targets = []) : void +} + +note right of Pathfix::set + Fix the path to work in the JCB script <-- (main issue here) +Since we need / slash in all paths, for the JCB script even if it is Windows +and since MS works with both forward and back slashes +we just convert all slashes to forward slashes +THIS is just my hack (fix) if you know a better way! speak-up! + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php b/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php new file mode 100644 index 0000000..e2208f7 --- /dev/null +++ b/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php @@ -0,0 +1,61 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Path Fix + * + * @since 3.2.0 + */ +class Pathfix +{ + /** + * Fix the path to work in the JCB script <-- (main issue here) + * Since we need / slash in all paths, for the JCB script even if it is Windows + * and since MS works with both forward and back slashes + * we just convert all slashes to forward slashes + * + * THIS is just my hack (fix) if you know a better way! speak-up! + * + * @param mixed $values the array of paths or the path as a string + * @param array $targets paths to target + * + * @return void + * @since 3.2.0 + */ + public function set(&$values, array $targets = []) + { + // if multiple to gets searched and fixed + if (ArrayHelper::check($values) && ArrayHelper::check($targets)) + { + foreach ($targets as $target) + { + if (isset($values[$target])) + { + $this->set($values[$target], $targets); + } + } + } + // if just a string + elseif (StringHelper::check($values) && strpos((string) $values, '\\') !== false) + { + $values = str_replace('\\', '/', (string) $values); + } + } + +} + diff --git a/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json b/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json new file mode 100644 index 0000000..a710dca --- /dev/null +++ b/src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Pathfix", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Pathfix", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Pathfix", + "description": "Compiler Path Fix\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md new file mode 100644 index 0000000..213314f --- /dev/null +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/README.md @@ -0,0 +1,68 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class Data #Gold { + # array $fields + # Config $config + # EventInterface $event + # HistoryInterface $history + # Placeholder $placeholder + # Customcode $customcode + # FieldCustomcode $fieldCustomcode + # Validation $validation + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?EventInterface $event = null, ...) + + get(int $id, ?string $singleViewName = null, ...) : ?object +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?EventInterface $event = null + ?HistoryInterface $history = null + ?Placeholder $placeholder = null + ?Customcode $customcode = null + ?FieldCustomcode $fieldCustomcode = null + ?Validation $validation = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get all Field Data + + since: 3.2.0 + return: ?object + + arguments: + int $id + ?string $singleViewName = null + ?string $listViewName = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php new file mode 100644 index 0000000..bc52a63 --- /dev/null +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/code.php @@ -0,0 +1,329 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +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\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode as FieldCustomcode; +use VDM\Joomla\Componentbuilder\Compiler\Field\Validation; + + +/** + * Compiler Field Data + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Fields + * + * @var array + * @since 3.2.0 + */ + protected array $fields; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler History + * + * @var HistoryInterface + * @since 3.2.0 + */ + protected HistoryInterface $history; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Field Customcode + * + * @var FieldCustomcode + * @since 3.2.0 + */ + protected FieldCustomcode $fieldCustomcode; + + /** + * Compiler Field Validation + * + * @var Validation + * @since 3.2.0 + */ + protected Validation $validation; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param EventInterface|null $event The compiler event api object. + * @param HistoryInterface|null $history The compiler history object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param FieldCustomcode|null $fieldCustomcode The field customcode object. + * @param Validation|null $validation The field validation rule object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?EventInterface $event = null, ?HistoryInterface $history = null, + ?Placeholder $placeholder = null, ?Customcode $customcode = null, ?FieldCustomcode $fieldCustomcode = null, + ?Validation $validation = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->event = $event ?: Compiler::_('Event'); + $this->history = $history ?: Compiler::_('History'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->fieldCustomcode = $fieldCustomcode ?: Compiler::_('Field.Customcode'); + $this->validation = $validation ?: Compiler::_('Field.Validation'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get all Field Data + * + * @param int $id The field ID + * @param string|null $singleViewName The view edit or single name + * @param string|null $listViewName The view list name + * + * @return object|null The field data + * @since 3.2.0 + */ + public function get(int $id, ?string $singleViewName = null, ?string $listViewName = null): ?object + { + if ($id > 0 && !isset($this->fields[$id])) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select all the values in the field + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array('c.name', 'c.properties'), + array('type_name', 'properties') + ) + ); + $query->from('#__componentbuilder_field AS a'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_fieldtype', 'c') + . ' ON (' . $this->db->quoteName('a.fieldtype') . ' = ' + . $this->db->quoteName('c.id') . ')' + ); + $query->where( + $this->db->quoteName('a.id') . ' = ' . $this->db->quote($id) + ); + + // TODO we need to update the event signatures + $context = $this->config->component_context; + + // Trigger Event: jcb_ce_onBeforeQueryFieldData + $this->event->trigger( + 'jcb_ce_onBeforeQueryFieldData', + array(&$context, &$id, &$query, &$this->db) + ); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // Load the results as a list of stdClass objects (see later for more options on retrieving data). + $field = $this->db->loadObject(); + + // Trigger Event: jcb_ce_onBeforeModelFieldData + $this->event->trigger( + 'jcb_ce_onBeforeModelFieldData', + array(&$context, &$field) + ); + + // adding a fix for the changed name of type to fieldtype + $field->type = $field->fieldtype; + + // load the values form params + $field->xml = $this->customcode->update(json_decode((string) $field->xml)); + + // check if we have validate (validation rule and set it if found) + $this->validation->set($id, $field->xml); + + // load the type values form type params + $field->properties = (isset($field->properties) + && JsonHelper::check($field->properties)) + ? json_decode((string) $field->properties, true) : null; + if (ArrayHelper::check($field->properties)) + { + $field->properties = array_values($field->properties); + } + + // check if we have WHMCS encryption + if (4 == $field->store + && !$this->config->whmcs_encryption) + { + $this->config->whmcs_encryption = true; + } + // check if we have basic encryption + elseif (3 == $field->store + && !$this->config->basic_encryption) + { + $this->config->basic_encryption = true; + } + // check if we have better encryption + elseif (5 == $field->store + && $this->config->medium_encryption) + { + $this->config->medium_encryption = true; + } + // check if we have better encryption + elseif (6 == $field->store + && StringHelper::check( + $field->on_get_model_field + ) + && StringHelper::check( + $field->on_save_model_field + )) + { + // add only if string lenght found + if (StringHelper::check( + $field->initiator_on_save_model + )) + { + $field->initiator_save_key = md5( + (string) $field->initiator_on_save_model + ); + $field->initiator_save = explode( + PHP_EOL, $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $field->initiator_on_save_model + ) + ) + ) + ); + } + if (StringHelper::check( + $field->initiator_on_save_model + )) + { + $field->initiator_get_key = md5( + (string) $field->initiator_on_get_model + ); + $field->initiator_get = explode( + PHP_EOL, $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $field->initiator_on_get_model + ) + ) + ) + ); + } + // set the field modelling + $field->model_field['save'] = explode( + PHP_EOL, $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $field->on_save_model_field) + ) + ) + ); + $field->model_field['get'] = explode( + PHP_EOL, $this->placeholder->update_( + $this->customcode->update( + base64_decode((string) $field->on_get_model_field) + ) + ) + ); + // remove the original values + unset( + $field->on_save_model_field, + $field->on_get_model_field, + $field->initiator_on_save_model, + $field->initiator_on_get_model + ); + } + + // get the last used version + $field->history = $this->history->get('field', $id); + + // Trigger Event: jcb_ce_onAfterModelFieldData + $this->event->trigger( + 'jcb_ce_onAfterModelFieldData', + array(&$context, &$field) + ); + + $this->fields[$id] = $field; + } + else + { + return null; + } + } + + if ($id > 0 && isset($this->fields[$id])) + { + // update the customcode of the field + $this->fieldCustomcode->update($id, $this->fields[$id], $singleViewName, $listViewName); + + // return the field + return $this->fields[$id]; + } + + return null; + } + +} + diff --git a/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json new file mode 100644 index 0000000..619bc17 --- /dev/null +++ b/src/ce826b66-0f2d-43da-8005-41b8e4cb21ee/settings.json @@ -0,0 +1,62 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "ce826b66-0f2d-43da-8005-41b8e4cb21ee", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.Data", + "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": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection4": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection5": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection6": { + "use": "4325745f-da1f-4d4d-a591-3189fe8c06e5", + "as": "default" + }, + "use_selection7": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection8": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection9": { + "use": "a356d103-74f3-49ca-8e4f-3bd37746f089", + "as": "FieldCustomcode" + }, + "use_selection10": { + "use": "c871fb4a-4c33-4302-bb79-a9cd7ef4a557", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.Data", + "description": "Compiler Field Data\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/cebdcccb-24c5-46db-92de-63453852dcb8/README.md b/src/cebdcccb-24c5-46db-92de-63453852dcb8/README.md new file mode 100644 index 0000000..60f7172 --- /dev/null +++ b/src/cebdcccb-24c5-46db-92de-63453852dcb8/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Adminviews (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Adminviews #Gold { + # Adminview $admin + # Registry $registry + # Config $config + + __construct(?Adminview $admin = null, ?Registry $registry = null, ...) + + set(object $item) : void +} + +note right of Adminviews::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Adminview $admin = null + ?Registry $registry = null + ?Config $config = null +end note + +note right of Adminviews::set + Set admin view data + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cebdcccb-24c5-46db-92de-63453852dcb8/code.php b/src/cebdcccb-24c5-46db-92de-63453852dcb8/code.php new file mode 100644 index 0000000..edb322b --- /dev/null +++ b/src/cebdcccb-24c5-46db-92de-63453852dcb8/code.php @@ -0,0 +1,184 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Adminview\Data as Adminview; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model Admin Views Class + * + * @since 3.2.0 + */ +class Adminviews +{ + /** + * Component Admin view Data + * + * @var Adminview + * @since 3.2.0 + **/ + protected Adminview $admin; + + /** + * Compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor + * + * @param Adminview|null $admin The admin view data object. + * @param Registry|null $registry The compiler registry object. + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Adminview $admin = null, ?Registry $registry = null, ?Config $config = null) + { + $this->admin = $admin ?: Compiler::_('Adminview.Data'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Set admin view data + * + * @param object $item The extension data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addadmin_views = (isset($item->addadmin_views) + && JsonHelper::check($item->addadmin_views)) + ? json_decode((string) $item->addadmin_views, true) : null; + + if (ArrayHelper::check($item->addadmin_views)) + { + $this->config->lang_target = 'admin'; + $this->config->build_target = 'admin'; + + // sort the views according to order + usort( + $item->addadmin_views, function ($a, $b) { + if ($a['order'] != 0 && $b['order'] != 0) + { + return $a['order'] - $b['order']; + } + elseif ($b['order'] != 0 && $a['order'] == 0) + { + return 1; + } + elseif ($a['order'] != 0 && $b['order'] == 0) + { + return 0; + } + + return 1; + } + ); + + // build the admin_views settings + $item->admin_views = array_map( + function ($array) { + $array = array_map( + function ($value) { + if (!ArrayHelper::check($value) + && !ObjectHelper::check($value) + && strval($value) === strval(intval($value))) + { + return (int) $value; + } + + return $value; + }, $array + ); + + // check if we must add to site + if (isset($array['edit_create_site_view']) + && is_numeric( + $array['edit_create_site_view'] + ) && $array['edit_create_site_view'] > 0) + { + $this->registry->set('builder.site_edit_view.' . $array['adminview'], true); + $this->config->lang_target = 'both'; + } + + // set the import/export option for this view + if (isset($array['port']) && $array['port']) + { + $this->config->set('add_eximport', true); + } + + // set the history tracking option for this view + if (isset($array['history']) && $array['history']) + { + $this->config->set('set_tag_history', true); + } + + // set the custom field integration for this view + if (isset($array['joomla_fields']) && $array['joomla_fields']) + { + $this->config->set('set_joomla_fields', true); + } + + // has become a legacy issue, can't remove this + $array['view'] = $array['adminview']; + + // get the admin settings/data + $array['settings'] = $this->admin->get( + $array['view'] + ); + + // set the filter option for this view + $this->registry-> // Side (old) [default for now] + set('builder.admin_filter_type.' . $array['settings']->name_list_code, 1); + + if (isset($array['filter']) + && is_numeric( + $array['filter'] + ) && $array['filter'] > 0) + { + $this->registry-> + set('builder.admin_filter_type.' . $array['settings']->name_list_code, + (int) $array['filter']); + } + + return $array; + + }, array_values($item->addadmin_views) + ); + } + } + +} + diff --git a/src/cebdcccb-24c5-46db-92de-63453852dcb8/settings.json b/src/cebdcccb-24c5-46db-92de-63453852dcb8/settings.json new file mode 100644 index 0000000..d8a0a20 --- /dev/null +++ b/src/cebdcccb-24c5-46db-92de-63453852dcb8/settings.json @@ -0,0 +1,45 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "cebdcccb-24c5-46db-92de-63453852dcb8", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Adminviews", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Adminviews", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "cef2815b-f72b-402a-b769-f028f676692d", + "as": "Adminview" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection4": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection5": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection6": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Adminviews", + "description": "Model Admin Views Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/README.md b/src/cef2815b-f72b-402a-b769-f028f676692d/README.md new file mode 100644 index 0000000..72eefcf --- /dev/null +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/README.md @@ -0,0 +1,93 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Adminview** +```uml +@startuml +class Data #Gold { + # array $data + # Config $config + # Registry $registry + # EventInterface $event + # Placeholder $placeholder + # Dispenser $dispenser + # Customtabs $customtabs + # Tabs $tabs + # Fields $fields + # Historyadminview $history + # Permissions $permissions + # Conditions $conditions + # Relations $relations + # Linkedviews $linkedviews + # Javascriptadminview $javascript + # Cssadminview $css + # Phpadminview $php + # Custombuttons $custombuttons + # Customimportscripts $customimportscripts + # Ajaxadmin $ajax + # Customalias $customalias + # Sql $sql + # Mysqlsettings $mysqlsettings + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + get(int $id) : ?object +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Placeholder $placeholder = null + ?Dispenser $dispenser = null + ?Customtabs $customtabs = null + ?Tabs $tabs = null + ?Fields $fields = null + ?Historyadminview $history = null + ?Permissions $permissions = null + ?Conditions $conditions = null + Relations $relations = null + ?Linkedviews $linkedviews = null + ?Javascriptadminview $javascript = null + ?Cssadminview $css = null + ?Phpadminview $php = null + ?Custombuttons $custombuttons = null + ?Customimportscripts $customimportscripts = null + ?Ajaxadmin $ajax = null + ?Customalias $customalias = null + ?Sql $sql = null + ?Mysqlsettings $mysqlsettings = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get Admin View Data + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/code.php b/src/cef2815b-f72b-402a-b769-f028f676692d/code.php new file mode 100644 index 0000000..b71ed54 --- /dev/null +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/code.php @@ -0,0 +1,545 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Adminview; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs; +use VDM\Joomla\Componentbuilder\Compiler\Model\Fields; +use VDM\Joomla\Componentbuilder\Compiler\Model\Historyadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Permissions; +use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions; +use VDM\Joomla\Componentbuilder\Compiler\Model\Relations; +use VDM\Joomla\Componentbuilder\Compiler\Model\Linkedviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Javascriptadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Cssadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Phpadminview; +use VDM\Joomla\Componentbuilder\Compiler\Model\Custombuttons; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customimportscripts; +use VDM\Joomla\Componentbuilder\Compiler\Model\Ajaxadmin; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customalias; +use VDM\Joomla\Componentbuilder\Compiler\Model\Sql; +use VDM\Joomla\Componentbuilder\Compiler\Model\Mysqlsettings; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Admin View Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Admin views + * + * @var array + * @since 3.2.0 + */ + protected array $data; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The modelling customtabs + * + * @var Customtabs + * @since 3.2.0 + */ + protected Customtabs $customtabs; + + /** + * The modelling tabs + * + * @var Tabs + * @since 3.2.0 + */ + protected Tabs $tabs; + + /** + * The modelling fields + * + * @var Fields + * @since 3.2.0 + */ + protected Fields $fields; + + /** + * The modelling admin view history + * + * @var Historyadminview + * @since 3.2.0 + */ + protected Historyadminview $history; + + /** + * The modelling permissions + * + * @var Permissions + * @since 3.2.0 + */ + protected Permissions $permissions; + + /** + * The modelling conditions + * + * @var Conditions + * @since 3.2.0 + */ + protected Conditions $conditions; + + /** + * The modelling relations + * + * @var Relations + * @since 3.2.0 + */ + protected Relations $relations; + + /** + * The modelling linked views + * + * @var Linkedviews + * @since 3.2.0 + */ + protected Linkedviews $linkedviews; + + /** + * The modelling javascript + * + * @var Javascriptadminview + * @since 3.2.0 + */ + protected Javascriptadminview $javascript; + + /** + * The modelling css + * + * @var Cssadminview + * @since 3.2.0 + */ + protected Cssadminview $css; + + /** + * The modelling php admin view + * + * @var Phpadminview + * @since 3.2.0 + */ + protected Phpadminview $php; + + /** + * The modelling custom buttons + * + * @var Custombuttons + * @since 3.2.0 + */ + protected Custombuttons $custombuttons; + + /** + * The modelling custom import scripts + * + * @var Customimportscripts + * @since 3.2.0 + */ + protected Customimportscripts $customimportscripts; + + /** + * The modelling ajax + * + * @var Ajaxadmin + * @since 3.2.0 + */ + protected Ajaxadmin $ajax; + + /** + * The modelling custom alias + * + * @var Customalias + * @since 3.2.0 + */ + protected Customalias $customalias; + + /** + * The modelling sql + * + * @var Sql + * @since 3.2.0 + */ + protected Sql $sql; + + /** + * The modelling mysql settings + * + * @var Mysqlsettings + * @since 3.2.0 + */ + protected Mysqlsettings $mysqlsettings; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Dispenser|null $dispenser The compiler customcode dispenser object. + * @param Customtabs|null $customtabs The modelling customtabs object. + * @param Tabs|null $tabs The modelling tabs object. + * @param Fields|null $fields The modelling fields object. + * @param Historyadminview|null $history The modelling admin view history object. + * @param Permissions|null $permissions The modelling permissions object. + * @param Conditions|null $conditions The modelling conditions object. + * @param Relations|null $relations The modelling relations object. + * @param Linkedviews|null $linkedviews The modelling linked views object. + * @param Javascriptadminview|null $javascript The modelling javascript object. + * @param Cssadminview|null $css The modelling css object. + * @param Phpadminview|null $php The modelling php admin view object. + * @param Custombuttons|null $custombuttons The modelling custom buttons object. + * @param Customimportscripts|null $customimportscripts The modelling custom import scripts object. + * @param Ajaxadmin|null $ajax The modelling ajax object. + * @param Customalias|null $customalias The modelling custom alias object. + * @param Sql|null $sql The modelling sql object. + * @param Mysqlsettings|null $mysqlsettings The modelling mysql settings object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, ?Dispenser $dispenser = null, + ?Customtabs $customtabs = null, ?Tabs $tabs = null, ?Fields $fields = null, + ?Historyadminview $history = null, ?Permissions $permissions = null, + ?Conditions $conditions = null, Relations $relations = null, ?Linkedviews $linkedviews = null, + ?Javascriptadminview $javascript = null, ?Cssadminview $css = null, ?Phpadminview $php = null, + ?Custombuttons $custombuttons = null, ?Customimportscripts $customimportscripts = null, + ?Ajaxadmin $ajax = null, ?Customalias $customalias = null, ?Sql $sql = null, + ?Mysqlsettings $mysqlsettings = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->customtabs = $customtabs ?: Compiler::_('Model.Customtabs'); + $this->tabs = $tabs ?: Compiler::_('Model.Tabs'); + $this->fields = $fields ?: Compiler::_('Model.Fields'); + $this->history = $history ?: Compiler::_('Model.Historyadminview'); + $this->permissions = $permissions ?: Compiler::_('Model.Permissions'); + $this->conditions = $conditions ?: Compiler::_('Model.Conditions'); + $this->relations = $relations ?: Compiler::_('Model.Relations'); + $this->linkedviews = $linkedviews ?: Compiler::_('Model.Linkedviews'); + $this->javascript = $javascript ?: Compiler::_('Model.Javascriptadminview'); + $this->css = $css ?: Compiler::_('Model.Cssadminview'); + $this->php = $php ?: Compiler::_('Model.Phpadminview'); + $this->custombuttons = $custombuttons ?: Compiler::_('Model.Custombuttons'); + $this->customimportscripts = $customimportscripts ?: Compiler::_('Model.Customimportscripts'); + $this->ajax = $ajax ?: Compiler::_('Model.Ajaxadmin'); + $this->customalias = $customalias ?: Compiler::_('Model.Customalias'); + $this->sql = $sql ?: Compiler::_('Model.Sql'); + $this->mysqlsettings = $mysqlsettings ?: Compiler::_('Model.Mysqlsettings'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get Admin View Data + * + * @param int $id The view ID + * + * @return object|null The view data + * @since 3.2.0 + */ + public function get(int $id): ?object + { + if (!isset($this->data[$id])) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'b.addfields', + 'b.id', + 'c.addconditions', + 'c.id', + 'r.addrelations', + 't.tabs' + ), array( + 'addfields', + 'addfields_id', + 'addconditions', + 'addconditions_id', + 'addrelations', + 'customtabs' + ) + ) + ); + + $query->from('#__componentbuilder_admin_view AS a'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_admin_fields', 'b') + . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('b.admin_view') . ')' + ); + + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_admin_fields_conditions', 'c' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('c.admin_view') . ')' + ); + + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_admin_fields_relations', 'r' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('r.admin_view') . ')' + ); + + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_admin_custom_tabs', 't' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('t.admin_view') . ')' + ); + + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + // Trigger Event: jcb_ce_onBeforeQueryViewData + $this->event->trigger( + 'jcb_ce_onBeforeQueryViewData', + array(&$component_context, &$id, &$query, &$this->db) + ); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + + // Load the results as a list of stdClass objects (see later for more options on retrieving data). + $view = $this->db->loadObject(); + + // setup single view code names to use in storing the data + $view->name_single_code = 'oops_hmm_' . $id; + if (isset($view->name_single) && $view->name_single != 'null') + { + $view->name_single_code = StringHelper::safe( + $view->name_single + ); + } + + // setup list view code name to use in storing the data + $view->name_list_code = 'oops_hmmm_' . $id; + if (isset($view->name_list) && $view->name_list != 'null') + { + $view->name_list_code = StringHelper::safe( + $view->name_list + ); + } + + // check the length of the view name (+5 for com_ and _) + $name_length = $this->config->component_code_name_length + strlen( + (string) $view->name_single_code + ) + 5; + // when the name is larger than 49 we need to add the assets' table name fix + if ($name_length > 49) + { + $this->config->set('add_assets_table_name_fix', true); + } + + // setup token check + if (!isset($this->dispenser->hub['token'])) + { + $this->dispenser->hub['token'] = []; + } + $this->dispenser->hub['token'][$view->name_single_code] = false; + $this->dispenser->hub['token'][$view->name_list_code] = false; + + // set some placeholders + $this->placeholder->set('view', $view->name_single_code); + $this->placeholder->set('views', $view->name_list_code); + $this->placeholder->set('View', StringHelper::safe( + $view->name_single, 'F' + )); + $this->placeholder->set('Views', StringHelper::safe( + $view->name_list, 'F' + )); + $this->placeholder->set('VIEW', StringHelper::safe( + $view->name_single, 'U' + )); + $this->placeholder->set('VIEWS', StringHelper::safe( + $view->name_list, 'U' + )); + + // for plugin event TODO change event api signatures + $placeholders = $this->placeholder->active; + $component_context = $this->config->component_context; + + // Trigger Event: jcb_ce_onBeforeModelViewData + $this->event->trigger( + 'jcb_ce_onBeforeModelViewData', + array(&$component_context, &$view, &$placeholders) + ); + unset($placeholders); + + // add the tables + $view->addtables = (isset($view->addtables) + && JsonHelper::check($view->addtables)) + ? json_decode((string) $view->addtables, true) : null; + if (ArrayHelper::check($view->addtables)) + { + $view->tables = array_values($view->addtables); + } + unset($view->addtables); + + // set custom tabs + $this->customtabs->set($view); + + // set the local tabs + $this->tabs->set($view); + + // set permissions + $this->permissions->set($view); + + // set fields + $this->fields->set($view); + + // build update SQL + $this->history->set($view); + + // set the conditions + $this->conditions->set($view); + + // set the relations + $this->relations->set($view); + + // set linked views + $this->linkedviews->set($view); + + // set the lang target + $this->config->lang_target = 'admin'; + if ($this->registry->get('builder.site_edit_view.' . $id, false)) + { + $this->config->lang_target = 'both'; + } + + // set javascript + $this->javascript->set($view); + + // set css + $this->css->set($view); + + // set php + $this->php->set($view); + + // set custom buttons + $this->custombuttons->set($view); + + // set custom import scripts + $this->customimportscripts->set($view); + + // set Ajax for this view + $this->ajax->set($view); + + // activate alias builder + $this->customalias->set($view); + + // set sql + $this->sql->set($view); + + // set mySql Table Settings + $this->mysqlsettings->set($view); + + // for plugin event TODO change event api signatures + $placeholders = $this->placeholder->active; + + // Trigger Event: jcb_ce_onAfterModelViewData + $this->event->trigger( + 'jcb_ce_onAfterModelViewData', + array(&$component_context, &$view, &$placeholders) + ); + + // clear placeholders + $this->placeholder->remove('view'); + $this->placeholder->remove('views'); + $this->placeholder->remove('View'); + $this->placeholder->remove('Views'); + $this->placeholder->remove('VIEW'); + $this->placeholder->remove('VIEWS'); + + // store this view to class object + $this->data[$id] = $view; + } + + // return the found view data + return $this->data[$id]; + } + +} + diff --git a/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json b/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json new file mode 100644 index 0000000..b415210 --- /dev/null +++ b/src/cef2815b-f72b-402a-b769-f028f676692d/settings.json @@ -0,0 +1,122 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "cef2815b-f72b-402a-b769-f028f676692d", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Adminview.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection6": { + "use": "fa8c1125-d370-4cb6-a7ff-eb32193c198c", + "as": "default" + }, + "use_selection7": { + "use": "143ac6ea-b64f-4331-9a97-31e3fce2bb69", + "as": "default" + }, + "use_selection8": { + "use": "e6a64c41-405e-4bbc-9722-27402c22bbea", + "as": "default" + }, + "use_selection9": { + "use": "6dfbf568-f3cd-4ea7-af04-6859447b5462", + "as": "default" + }, + "use_selection10": { + "use": "0dabc67c-abec-4541-82bf-279abd3c9be1", + "as": "default" + }, + "use_selection11": { + "use": "55e61314-ba10-4e2b-92dd-b44adebabce9", + "as": "default" + }, + "use_selection12": { + "use": "a8eb2fb1-88ed-4af8-842d-898eb915b588", + "as": "default" + }, + "use_selection13": { + "use": "ae1fa148-91be-4f80-89a9-69d91ba9d575", + "as": "default" + }, + "use_selection14": { + "use": "dfd3c893-0296-46eb-9ae4-a0348713cd8f", + "as": "default" + }, + "use_selection15": { + "use": "e79842d3-51b7-4282-93c7-3487cd8b61ab", + "as": "default" + }, + "use_selection16": { + "use": "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe", + "as": "default" + }, + "use_selection17": { + "use": "ebe3287d-bfa0-4519-b663-f442f4dea432", + "as": "default" + }, + "use_selection18": { + "use": "037c7274-fb16-455d-989a-bf1da022620b", + "as": "default" + }, + "use_selection19": { + "use": "4f575bd6-de97-41f8-80d6-259c8a6dd9ad", + "as": "default" + }, + "use_selection20": { + "use": "5f8e8fa6-3793-44af-882d-9cfb209434e9", + "as": "default" + }, + "use_selection21": { + "use": "d4b418a7-bf9b-4768-969d-e07c36916fd2", + "as": "default" + }, + "use_selection22": { + "use": "35191b0c-f7f3-44d6-8ec1-c816b997bd4e", + "as": "default" + }, + "use_selection23": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection24": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection25": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Adminview.Data", + "description": "Admin View Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/README.md b/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/README.md new file mode 100644 index 0000000..7d209ba --- /dev/null +++ b/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/README.md @@ -0,0 +1,52 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Dashboard (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Dashboard #Gold { + # Registry $registry + # Component $component + # CMSApplication $app + + __construct(?Registry $registry = null, ?Component $component = null, ...) + + set() : void +} + +note right of Dashboard::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Registry $registry = null + ?Component $component = null + ?CMSApplication $app = null +end note + +note right of Dashboard::set + Set the Dynamic Dashboard + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/code.php b/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/code.php new file mode 100644 index 0000000..80ff344 --- /dev/null +++ b/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/code.php @@ -0,0 +1,213 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Application\CMSApplication; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Compiler Component Dynamic Dashboard + * + * @since 3.2.0 + */ +class Dashboard +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Application object. + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * @param Component|null $component The component class. + * @param CMSApplication|null $app The app object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null, ?Component $component = null, + ?CMSApplication $app = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + $this->component = $component ?: Compiler::_('Component'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set the Dynamic Dashboard + * + * @return void + * @since 3.2.0 + */ + public function set() + { + // only add the dynamic dashboard if all checks out + if ($this->component->get('dashboard_type', 0) == 2 + && ($dashboard_ = $this->component->get('dashboard')) !== null + && StringHelper::check($dashboard_) + && strpos((string) $dashboard_, '_') !== false) + { + // set the default view + $getter = explode('_', (string) $dashboard_); + if (count((array) $getter) == 2 && is_numeric($getter[1])) + { + // the pointers + $t = StringHelper::safe($getter[0], 'U'); + $id = (int) $getter[1]; + + // the dynamic stuff + $targets = array('A' => 'admin_views', + 'C' => 'custom_admin_views'); + $names = array('A' => 'admin view', + 'C' => 'custom admin view'); + $types = array('A' => 'adminview', 'C' => 'customadminview'); + $keys = array('A' => 'name_list', 'C' => 'code'); + + // check the target values + if (isset($targets[$t]) && $id > 0) + { + // set the type name + $type_names = StringHelper::safe( + $targets[$t], 'w' + ); + // set the dynamic dash + if (($target_ = $this->component->get($targets[$t])) !== null + && ArrayHelper::check($target_)) + { + // search the target views + $dashboard = (array) array_filter( + $target_, + function ($view) use ($id, $t, $types) { + if (isset($view[$types[$t]]) + && $id == $view[$types[$t]]) + { + return true; + } + + return false; + } + ); + + // set dashboard + if (ArrayHelper::check($dashboard)) + { + $dashboard = array_values($dashboard)[0]; + } + + // check if view was found (this should be true) + if (isset($dashboard['settings']) + && isset($dashboard['settings']->{$keys[$t]})) + { + $this->registry->set('build.dashboard', + StringHelper::safe( + $dashboard['settings']->{$keys[$t]} + ) + ); + $this->registry->set('build.dashboard.type', + $targets[$t] + ); + } + else + { + // set massage that something is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT', + $names[$t], $dashboard_, + $type_names + ), 'Error' + ); + } + } + else + { + // set massage that something is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT', + $names[$t], $dashboard_, + $type_names + ), 'Error' + ); + } + } + else + { + // the target value is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID', + $dashboard_ + ), 'Error' + ); + } + } + else + { + // the target value is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID', + $dashboard_ + ), 'Error' + ); + } + + // if default was changed to dynamic dashboard the remove default tab and methods + if ($this->registry->get('build.dashboard')) + { + // dynamic dashboard is used + $this->component->remove('dashboard_tab'); + $this->component->remove('php_dashboard_methods'); + } + } + } + +} + diff --git a/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/settings.json b/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/settings.json new file mode 100644 index 0000000..fc35cc0 --- /dev/null +++ b/src/cfe62a32-8818-4bfb-8751-2f1e109b5336/settings.json @@ -0,0 +1,38 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "JoomlaRegistry", + "guid": "cfe62a32-8818-4bfb-8751-2f1e109b5336", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Dashboard", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Dashboard", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection3": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Dashboard", + "description": "Compiler Component Dynamic Dashboard\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Application\\CMSApplication;" +} \ No newline at end of file diff --git a/src/d33b9278-c409-4aec-a047-b72f56712391/README.md b/src/d33b9278-c409-4aec-a047-b72f56712391/README.md new file mode 100644 index 0000000..a32d6dd --- /dev/null +++ b/src/d33b9278-c409-4aec-a047-b72f56712391/README.md @@ -0,0 +1,55 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Extractor (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Language** +```uml +@startuml +class Extractor #Gold { + + array $langKeys + + array $langMismatch + + array $langMatch + # Config $config + # Placeholder $placeholder + # Language $language + + __construct(?Config $config = null, ?Language $language = null, ...) + + engine(string $content) : string +} + +note right of Extractor::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Language $language = null + ?Placeholder $placeholder = null +end note + +note right of Extractor::engine + Extract Language Strings + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d33b9278-c409-4aec-a047-b72f56712391/code.php b/src/d33b9278-c409-4aec-a047-b72f56712391/code.php new file mode 100644 index 0000000..6d47abc --- /dev/null +++ b/src/d33b9278-c409-4aec-a047-b72f56712391/code.php @@ -0,0 +1,247 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Language; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; + + +/** + * Compiler Language Extractor + * + * @since 3.2.0 + */ +class Extractor +{ + /** + * The lang keys for extensions + * + * @var array + * @since 3.2.0 + **/ + public array $langKeys = []; + + /** + * The Language JS matching check + * + * @var array + * @since 3.2.0 + **/ + public array $langMismatch = []; + + /** + * The Language SC matching check + * + * @var array + * @since 3.2.0 + **/ + public array $langMatch = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Language|null $language The compiler Language object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Language $language = null, ?Placeholder $placeholder = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->language = $language ?: Compiler::_('Language'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + } + + /** + * Extract Language Strings + * + * @param string $content The content + * + * @return string The content with the updated Language place holder + * @since 3.2.0 + */ + public function engine(string $content): string + { + // get targets to search for + $lang_string_targets = array_filter( + $this->config->lang_string_targets, fn($get): bool => strpos($content, (string) $get) !== false + ); + // check if we should continue + if (ArrayHelper::check($lang_string_targets)) + { + // insure string is not broken + $content = $this->placeholder->update_($content); + // reset some buckets + $lang_holders = []; + $lang_check = []; + $lang_only = []; + $js_text = []; + $sc_text = []; + // first get the Joomla .JText._() + if (in_array('Joomla' . '.JText._(', $lang_string_targets)) + { + $js_text[] = GetHelper::allBetween( + $content, "Joomla" . ".JText._('", "'" + ); + $js_text[] = GetHelper::allBetween( + $content, 'Joomla' . '.JText._("', '"' + ); + // combine into one array + $js_text = ArrayHelper::merge($js_text); + // we need to add a check to insure these JavaScript lang matchup + if (ArrayHelper::check( + $js_text + )) //<-- not really needed hmmm + { + // load the JS text to mismatch array + $lang_check[] = $js_text; + $this->langMismatch = ArrayHelper::merge( + array($js_text, $this->langMismatch) + ); + } + } + // now get the JText: :script() + if (in_array('JText:' . ':script(', $lang_string_targets)) + { + $sc_text[] = GetHelper::allBetween( + $content, "JText:" . ":script('", "'" + ); + $sc_text[] = GetHelper::allBetween( + $content, 'JText:' . ':script("', '"' + ); + // combine into one array + $sc_text = ArrayHelper::merge($sc_text); + // we need to add a check to insure these JavaScript lang matchup + if (ArrayHelper::check($sc_text)) + { + // load the Script text to match array + $lang_check[] = $sc_text; + $this->langMatch = ArrayHelper::merge( + array($sc_text, $this->langMatch) + ); + } + } + // now do the little trick for JustTEXT: :_('Just uppercase text'); + if (in_array('JustTEXT:' . ':_(', $lang_string_targets)) + { + $lang_only[] = GetHelper::allBetween( + $content, "JustTEXT:" . ":_('", "')" + ); + $lang_only[] = GetHelper::allBetween( + $content, 'JustTEXT:' . ':_("', '")' + ); + // merge lang only + $lang_only = ArrayHelper::merge($lang_only); + } + // set language data + foreach ($lang_string_targets as $lang_string_target) + { + // need some special treatment here + if ($lang_string_target === 'Joomla' . '.JText._(' + || $lang_string_target === 'JText:' . ':script(' + || $lang_string_target === 'JustTEXT:' . ':_(') + { + continue; + } + $lang_check[] = GetHelper::allBetween( + $content, $lang_string_target . "'", "'" + ); + $lang_check[] = GetHelper::allBetween( + $content, $lang_string_target . '"', '"' + ); + } + // the normal loading of the language strings + $lang_check = ArrayHelper::merge($lang_check); + if (ArrayHelper::check( + $lang_check + )) //<-- not really needed hmmm + { + foreach ($lang_check as $string) + { + if ($key_lang = $this->language->key($string)) + { + // load the language targets + foreach ($lang_string_targets as $lang_string_target) + { + // need some special treatment here + if ($lang_string_target === 'JustTEXT:' . ':_(') + { + continue; + } + $lang_holders[$lang_string_target . "'" . $string + . "'"] + = $lang_string_target . "'" . $key_lang . "'"; + $lang_holders[$lang_string_target . '"' . $string + . '"'] + = $lang_string_target . '"' . $key_lang . '"'; + } + } + } + } + // the uppercase loading only (for arrays and other tricks) + if (ArrayHelper::check($lang_only)) + { + foreach ($lang_only as $string) + { + if ($key_lang = $this->language->key($string)) + { + // load the language targets + $lang_holders["JustTEXT:" . ":_('" . $string . "')"] + = "'" . $key_lang . "'"; + $lang_holders['JustTEXT:' . ':_("' . $string . '")'] + = '"' . $key_lang . '"'; + } + } + } + // only continue if we have value to replace + if (ArrayHelper::check($lang_holders)) + { + $content = $this->placeholder->update($content, $lang_holders); + } + } + + return $content; + } + +} + diff --git a/src/d33b9278-c409-4aec-a047-b72f56712391/settings.json b/src/d33b9278-c409-4aec-a047-b72f56712391/settings.json new file mode 100644 index 0000000..b36a02e --- /dev/null +++ b/src/d33b9278-c409-4aec-a047-b72f56712391/settings.json @@ -0,0 +1,45 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "d33b9278-c409-4aec-a047-b72f56712391", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Extractor", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Language.Extractor", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection3": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection4": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection5": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection6": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Language.Extractor", + "description": "Compiler Language Extractor\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/README.md b/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/README.md new file mode 100644 index 0000000..1c38320 --- /dev/null +++ b/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/README.md @@ -0,0 +1,64 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Structure (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Library** +```uml +@startuml +class Structure #Gold { + # Config $config + # Registry $registry + # EventInterface $event + # Component $component + # Content $content + # Counter $counter + # Paths $paths + # Folder $folder + # File $file + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + build() : void +} + +note right of Structure::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?EventInterface $event = null + ?Component $component = null + ?Content $content = null + ?Counter $counter = null + ?Paths $paths = null + ?Folder $folder = null + ?File $file = null +end note + +note right of Structure::build + Build the Libraries files, folders, url's and config + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/code.php b/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/code.php new file mode 100644 index 0000000..fecf505 --- /dev/null +++ b/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/code.php @@ -0,0 +1,318 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Library; + + +use Joomla\CMS\Filesystem\Folder as JoomlaFolder; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Content; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\FileHelper; + + +/** + * Library Structure Builder Class + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Utilities Folder + * + * @var Folder + * @since 3.2.0 + */ + protected Folder $folder; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Component|null $component The component class. + * @param Content|null $content The compiler content object. + * @param Counter|null $counter The compiler counter object. + * @param Paths|null $paths The compiler paths object. + * @param Folder|null $folder The compiler folder object. + * @param File|null $file The compiler file object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Component $component = null, + ?Content $content = null,?Counter $counter = null, + ?Paths $paths = null, ?Folder $folder = null, + ?File $file = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->component = $component ?: Compiler::_('Component'); + $this->content = $content ?: Compiler::_('Content'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->folder = $folder ?: Compiler::_('Utilities.Folder'); + $this->file = $file ?: Compiler::_('Utilities.File'); + } + + /** + * Build the Libraries files, folders, url's and config + * + * @return void + * @since 3.2.0 + */ + public function build() + { + if (($libraries_ = $this->registry->get('builder.libraries')) !== null) + { + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + + // Trigger Event: jcb_ce_onBeforeSetLibraries + $this->event->trigger( + 'jcb_ce_onBeforeSetLibraries', + array(&$component_context, &$libraries_) + ); + + // creat the main component folder + if (!JoomlaFolder::exists($this->paths->component_path)) + { + JoomlaFolder::create($this->paths->component_path); + + // count the folder created + $this->counter->folder++; + $this->file->html(''); + } + + // create media path if not set + $this->folder->create($this->paths->component_path . '/media'); + foreach ($libraries_ as $id => &$library) + { + if (ObjectHelper::check($library)) + { + // check if this lib has files + if (isset($library->files) + && ArrayHelper::check($library->files)) + { + // add to component files + foreach ($library->files as $file) + { + $this->component->appendArray('files', $file); + } + } + + // check if this lib has folders + if (isset($library->folders) + && ArrayHelper::check( + $library->folders + )) + { + // add to component folders + foreach ($library->folders as $folder) + { + $this->component->appendArray('folders', $folder); + } + } + + // check if this lib has urls + if (isset($library->urls) + && ArrayHelper::check($library->urls)) + { + // build media folder path + $libFolder = strtolower( + preg_replace( + '/\s+/', '-', + (string) StringHelper::safe( + $library->name, 'filename', ' ', false + ) + ) + ); + $mediaPath = '/media/' . $libFolder; + + // should we add the local folder + $addLocalFolder = false; + + // add to component urls + foreach ($library->urls as $n => &$url) + { + if (isset($url['type']) && $url['type'] > 1 + && isset($url['url']) + && StringHelper::check( + $url['url'] + )) + { + // create media/lib path if not set + $this->folder->create( + $this->paths->component_path . $mediaPath + ); + + // add local folder + $addLocalFolder = true; + + // set file name + $fileName = basename((string) $url['url']); + + // get the file contents + $data = FileHelper::getContent( + $url['url'] + ); + + // build sub path + if (strpos($fileName, '.js') !== false) + { + $path = '/js'; + } + elseif (strpos($fileName, '.css') !== false) + { + $path = '/css'; + } + else + { + $path = ''; + } + + // create sub media path if not set + $this->folder->create( + $this->paths->component_path . $mediaPath . $path + ); + + // set the path to library file + $url['path'] = $mediaPath . $path . '/' + . $fileName; // we need this for later + + // set full path + $path = $this->paths->component_path . $url['path']; + + // write data to path + $this->file->write($path, $data); + + // count the file created + $this->counter->file++; + } + } + + // only add if local + if ($addLocalFolder) + { + // add folder to xml of media folders + $this->content->add('EXSTRA_MEDIA_FOLDERS', + PHP_EOL . Indent::_(2) . "" + . $libFolder . ""); + } + } + + // if config fields are found load into component config (avoiding duplicates) + if (isset($library->how) && $library->how > 1 + && isset($library->config) + && ArrayHelper::check($library->config)) + { + foreach ($library->config as $cofig) + { + $found = array_filter( + $this->component->get('config'), + fn($item) => $item['field'] == $cofig['field'] + ); + + // set the config data if not found + if (!ArrayHelper::check($found)) + { + $this->component->appendArray('config', $cofig); + } + } + } + + // update the global value just in case for now + $this->registry->set("builder.libraries.$id", $library); + } + } + } + } + +} + diff --git a/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/settings.json b/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/settings.json new file mode 100644 index 0000000..892e6a7 --- /dev/null +++ b/src/d3ce5763-4d00-4245-a175-54fc2e80e9b7/settings.json @@ -0,0 +1,78 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "d3ce5763-4d00-4245-a175-54fc2e80e9b7", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Structure", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Library.Structure", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection4": { + "use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "as": "default" + }, + "use_selection5": { + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + }, + "use_selection6": { + "use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "as": "default" + }, + "use_selection7": { + "use": "6f20369a-8536-4870-a1a3-cda254c939c8", + "as": "default" + }, + "use_selection8": { + "use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "as": "default" + }, + "use_selection9": { + "use": "5c75b455-3d4c-452a-867e-e90424a64c88", + "as": "default" + }, + "use_selection10": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + }, + "use_selection11": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection12": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection13": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection14": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Library.Structure", + "description": "Library Structure Builder Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Filesystem\\Folder as JoomlaFolder;" +} \ No newline at end of file diff --git a/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/README.md b/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/README.md new file mode 100644 index 0000000..5ad816b --- /dev/null +++ b/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Sql (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Sql #Gold { + # Dispenser $dispenser + # Sqldump $dump + + __construct(?Dispenser $dispenser = null, ?Sqldump $dump = null) + + set(object $item) : void +} + +note right of Sql::__construct + Constructor + + since: 3.2.0 +end note + +note right of Sql::set + Set sql + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/code.php b/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/code.php new file mode 100644 index 0000000..ac2df63 --- /dev/null +++ b/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/code.php @@ -0,0 +1,97 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump; + + +/** + * Model Sql Class + * + * @since 3.2.0 + */ +class Sql +{ + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Compiler SQL Dump + * + * @var Sqldump + * @since 3.2.0 + */ + protected Sqldump $dump; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser. + * @param Sqldump|null $dump The compiler SQL dump. + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null, ?Sqldump $dump = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->dump = $dump ?: Compiler::_('Model.Sqldump'); + } + + /** + * Set sql + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + if (isset($item->add_sql) && $item->add_sql == 1 && isset($item->source)) + { + if ($item->source == 1 && isset($item->tables) && + ($string = $this->dump->get( + $item->tables, $item->name_single_code, $item->id + )) !== null) + { + // build and add the SQL dump + // we add this directly to avoid + // dynamic set behaviour + // TODO: create a function in dispenser to manage these + $this->dispenser->hub['sql'][$item->name_single_code] + = $string; + } + elseif ($item->source == 2 && isset($item->sql)) + { + // add the SQL dump string + $this->dispenser->set( + $item->sql, + 'sql', + $item->name_single_code + ); + } + } + + unset($item->tables); + unset($item->sql); + } + +} + diff --git a/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/settings.json b/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/settings.json new file mode 100644 index 0000000..0e3cab9 --- /dev/null +++ b/src/d4b418a7-bf9b-4768-969d-e07c36916fd2/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "d4b418a7-bf9b-4768-969d-e07c36916fd2", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Sql", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Sql", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection2": { + "use": "a6e1227c-1efe-407d-84ef-03c6989a6a88", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Sql", + "description": "Model Sql Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/README.md b/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/README.md new file mode 100644 index 0000000..0a04929 --- /dev/null +++ b/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/README.md @@ -0,0 +1,83 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface LanguageInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces** +```uml +@startuml +interface LanguageInterface #Lavender { + + key(string $string) : string + + exist(string $target, ?string $language = null) : bool + + get(string $target, string $language) : string + + getTarget(string $target) : array + + setTarget(string $target, ?array $content) : void + + set(string $target, string $language, ...) : void +} + +note right of LanguageInterface::key + Get the language string key + + since: 3.2.0 + return: string +end note + +note right of LanguageInterface::exist + check if the language string exist + + since: 3.2.0 + return: bool +end note + +note right of LanguageInterface::get + get the language string + + since: 3.2.0 + return: string +end note + +note right of LanguageInterface::getTarget + get target array + + since: 3.2.0 + return: array +end note + +note right of LanguageInterface::setTarget + set target array + + since: 3.2.0 + return: void +end note + +note right of LanguageInterface::set + set the language content values to language content array + + since: 3.2.0 + return: void + + arguments: + string $target + string $language + string $string + bool $addPrefix = false +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/code.php b/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/code.php new file mode 100644 index 0000000..f7d40d5 --- /dev/null +++ b/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/code.php @@ -0,0 +1,89 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler Language Interface + * + * @since 3.2.0 + */ +interface LanguageInterface +{ + /** + * Get the language string key + * + * @param string $string The plan text string (English) + * + * @return string The key language string (all uppercase) + * @since 3.2.0 + */ + public function key($string): string; + + /** + * check if the language string exist + * + * @param string $target The target area for the language string + * @param string|null $language The language key string + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $target, ?string $language = null): bool; + + /** + * get the language string + * + * @param string $target The target area for the language string + * @param string|null $language The language key string + * + * @return Mixed The language string found or empty string if none is found + * @since 3.2.0 + */ + public function get(string $target, string $language): string; + + /** + * get target array + * + * @param string $target The target area for the language string + * + * @return array The target array or empty array if none is found + * @since 3.2.0 + */ + public function getTarget(string $target): array; + + /** + * set target array + * + * @param string $target The target area for the language string + * @param array|null $content The language content string + * + * @return void + * @since 3.2.0 + */ + public function setTarget(string $target, ?array $content); + + /** + * set the language content values to language content array + * + * @param string $target The target area for the language string + * @param string $language The language key string + * @param string $string The language string + * @param bool $addPrefix The switch to add langPrefix + * + * @return void + * @since 3.2.0 + */ + public function set(string $target, string $language, string $string, bool $addPrefix = false); + +} + diff --git a/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/settings.json b/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/settings.json new file mode 100644 index 0000000..61d3cbc --- /dev/null +++ b/src/d6592c9b-93a6-41b3-83c7-c43a0a80cb83/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "Registry", + "guid": "d6592c9b-93a6-41b3-83c7-c43a0a80cb83", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "LanguageInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.LanguageInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.LanguageInterface", + "description": "Compiler Language Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/README.md b/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/README.md new file mode 100644 index 0000000..ddf1210 --- /dev/null +++ b/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/README.md @@ -0,0 +1,60 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Field (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Field #Gold { + # Data $data + # Name $name + # TypeName $typeName + # UniqueName $uniqueName + + __construct(?Data $data = null, ?Name $name = null, ...) + + set(array $field, ?string $singleViewName = null, ...) : void +} + +note right of Field::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Data $data = null + ?Name $name = null + ?TypeName $typeName = null + ?UniqueName $uniqueName = null +end note + +note right of Field::set + set Field details + + since: 3.2.0 + return: void + + arguments: + array $field + ?string $singleViewName = null + ?string $listViewName = null + string $amicably = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php b/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php new file mode 100644 index 0000000..3133729 --- /dev/null +++ b/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php @@ -0,0 +1,142 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Field\Data; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name; +use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; + + +/** + * Compiler Field + * + * @since 3.2.0 + */ +class Field +{ + /** + * Compiler Field Data + * + * @var Data + * @since 3.2.0 + **/ + protected Data $data; + + /** + * Compiler Field Name + * + * @var Name + * @since 3.2.0 + **/ + protected Name $name; + + /** + * Compiler Field Type Name + * + * @var TypeName + * @since 3.2.0 + **/ + protected TypeName $typeName; + + /** + * Compiler Field Unique Name + * + * @var UniqueName + * @since 3.2.0 + **/ + protected UniqueName $uniqueName; + + /** + * Constructor + * + * @param Data|null $data The compiler field data object. + * @param Name|null $name The compiler field name object. + * @param TypeName|null $typeName The compiler field type name object. + * @param UniqueName|null $uniqueName The compiler field unique name object. + * + * @since 3.2.0 + */ + public function __construct(?Data $data = null, ?Name $name = null, ?TypeName $typeName = null, ?UniqueName $uniqueName = null) + { + $this->data = $data ?: Compiler::_('Field.Data'); + $this->name = $name ?: Compiler::_('Field.Name'); + $this->typeName = $typeName ?: Compiler::_('Field.Type.Name'); + $this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name'); + } + + /** + * set Field details + * + * @param array $field The field array. + * @param string|null $singleViewName The single view name. + * @param string|null $listViewName The list view name. + * @param string $amicably The peaceful resolve. + * + * @return void + * @since 3.2.0 + */ + public function set(array &$field, ?string $singleViewName = null, ?string $listViewName = null, string $amicably = '') + { + // set hash + static $hash = 123467890; + + // load hash if not found + if (!isset($field['hash'])) + { + $field['hash'] = \md5($field['field'] . $hash); + // increment hash + $hash++; + } + + // set the settings + if (!isset($field['settings'])) + { + $field['settings'] = $this->data->get( + $field['field'], $singleViewName, $listViewName + ); + } + + // set real field name + if (!isset($field['base_name'])) + { + $field['base_name'] = $this->name->get($field); + } + + // set code name for field type + if (!isset($field['type_name'])) + { + $field['type_name'] = $this->typeName->get($field); + } + + // check if value is array + if (isset($field['permission']) + && !ArrayHelper::check($field['permission']) + && is_numeric($field['permission']) && $field['permission'] > 0) + { + $field['permission'] = array($field['permission']); + } + + // set unique name keeper + if ($listViewName) + { + $this->uniqueName->set( + $field['base_name'], $listViewName . $amicably + ); + } + } + +} + diff --git a/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json b/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json new file mode 100644 index 0000000..14fcc5a --- /dev/null +++ b/src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Field", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "ce826b66-0f2d-43da-8005-41b8e4cb21ee", + "as": "default" + }, + "use_selection3": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "default" + }, + "use_selection4": { + "use": "eb33420d-359d-44a5-852e-613aef1feaae", + "as": "default" + }, + "use_selection5": { + "use": "8c018533-e967-4bf2-9bd9-9e92966fcb5e", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field", + "description": "Compiler Field\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/README.md b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/README.md new file mode 100644 index 0000000..adab0ee --- /dev/null +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/README.md @@ -0,0 +1,63 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Factory (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +abstract Factory #Orange { + # static $container + # static $JoomlaVersion + + {static} _(string $key) : mixed + + {static} _J(string $key) : mixed + + {static} getContainer() : Container + # {static} createContainer() : Container +} + +note right of Factory::_ + Get any class from the compiler container + + since: 3.2.0 + return: mixed +end note + +note right of Factory::_J + Get version specific class from the compiler container + + since: 3.2.0 + return: mixed +end note + +note right of Factory::getContainer + Get the global compiler container + + since: 3.2.0 + return: Container +end note + +note right of Factory::createContainer + Create a container object + + since: 3.2.0 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php new file mode 100644 index 0000000..7a2ed9e --- /dev/null +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php @@ -0,0 +1,147 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\DI\Container; +use VDM\Joomla\Componentbuilder\Service\Crypt; +use VDM\Joomla\Componentbuilder\Service\Server; +use VDM\Joomla\Componentbuilder\Compiler\Service\Database; +use VDM\Joomla\Componentbuilder\Compiler\Service\Model; +use VDM\Joomla\Componentbuilder\Compiler\Service\Mapper; +use VDM\Joomla\Componentbuilder\Compiler\Service\Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Service\Event; +use VDM\Joomla\Componentbuilder\Compiler\Service\History; +use VDM\Joomla\Componentbuilder\Compiler\Service\Language; +use VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Service\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Service\Power; +use VDM\Joomla\Componentbuilder\Compiler\Service\Component; +use VDM\Joomla\Componentbuilder\Compiler\Service\Adminview; +use VDM\Joomla\Componentbuilder\Compiler\Service\Library; +use VDM\Joomla\Componentbuilder\Compiler\Service\Customview; +use VDM\Joomla\Componentbuilder\Compiler\Service\Templatelayout; +use VDM\Joomla\Componentbuilder\Compiler\Service\Extension; +use VDM\Joomla\Componentbuilder\Compiler\Service\Field; +use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlamodule; +use VDM\Joomla\Componentbuilder\Compiler\Service\Joomlaplugin; +use VDM\Joomla\Componentbuilder\Compiler\Service\Utilities; +use VDM\Joomla\Componentbuilder\Compiler\Service\Builder; +use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface; + + +/** + * Compiler Factory + * + * @since 3.2.0 + */ +abstract class Factory implements FactoryInterface +{ + /** + * Global Compiler Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected static $JoomlaVersion; + + /** + * Get any class from the compiler container + * + * @param string $key The container class key + * + * @return mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get version specific class from the compiler container + * + * @param string $key The container class key + * + * @return mixed + * @since 3.2.0 + */ + public static function _J($key) + { + if (empty(self::$JoomlaVersion)) + { + self::$JoomlaVersion = self::getContainer()->get('Config')->joomla_version; + } + + return self::getContainer()->get('J' . self::$JoomlaVersion . '.' . $key); + } + + /** + * Get the global compiler container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Crypt()) + ->registerServiceProvider(new Server()) + ->registerServiceProvider(new Database()) + ->registerServiceProvider(new Model()) + ->registerServiceProvider(new Mapper()) + ->registerServiceProvider(new Compiler()) + ->registerServiceProvider(new Event()) + ->registerServiceProvider(new History()) + ->registerServiceProvider(new Language()) + ->registerServiceProvider(new Placeholder()) + ->registerServiceProvider(new Customcode()) + ->registerServiceProvider(new Power()) + ->registerServiceProvider(new Component()) + ->registerServiceProvider(new Adminview()) + ->registerServiceProvider(new Library()) + ->registerServiceProvider(new Customview()) + ->registerServiceProvider(new Templatelayout()) + ->registerServiceProvider(new Extension()) + ->registerServiceProvider(new Field()) + ->registerServiceProvider(new Joomlamodule()) + ->registerServiceProvider(new Joomlaplugin()) + ->registerServiceProvider(new Utilities()) + ->registerServiceProvider(new Builder()); + } + +} + diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json new file mode 100644 index 0000000..902f6b9 --- /dev/null +++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json @@ -0,0 +1,112 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "implements": [ + "caf33c5d-858c-4f9a-894f-ab302ec5445a" + ], + "implements_custom": "", + "load_selection": null, + "name": "Factory", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Factory", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "4d8f38ef-8f3a-463d-8678-0bf087ac6815", + "as": "default" + }, + "use_selection1": { + "use": "42ceff0b-226d-42ff-9ffa-3d5935890337", + "as": "default" + }, + "use_selection2": { + "use": "4815e1c7-a433-443d-a112-d1e03d7df84b", + "as": "default" + }, + "use_selection3": { + "use": "0601fee8-d51e-4af0-9ad3-b5f8700c4a45", + "as": "default" + }, + "use_selection4": { + "use": "23f2ca33-440a-4941-8e9a-4bc67522c0cb", + "as": "default" + }, + "use_selection5": { + "use": "ea5ed06e-72ae-4906-9167-1cc0fa32fe69", + "as": "default" + }, + "use_selection6": { + "use": "b94aaedb-6774-4739-a63f-8f87141a85db", + "as": "default" + }, + "use_selection7": { + "use": "63782f74-7b03-4745-aa40-0adf8ed4e704", + "as": "default" + }, + "use_selection8": { + "use": "9f00e793-86f8-4ef9-b775-a3eb129f83c0", + "as": "default" + }, + "use_selection9": { + "use": "2f7b1998-bb93-4055-ae82-aa659ce8a37f", + "as": "default" + }, + "use_selection10": { + "use": "a74ac3b7-bb79-4639-8f14-54a8021be68b", + "as": "default" + }, + "use_selection11": { + "use": "de01527a-6586-46ea-92e7-11ea3de1cedb", + "as": "default" + }, + "use_selection12": { + "use": "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c", + "as": "default" + }, + "use_selection13": { + "use": "2dd1289a-4000-43cc-8c62-77ff32de56bf", + "as": "default" + }, + "use_selection14": { + "use": "253317c7-3c3b-48a0-aec8-8af5e7a86504", + "as": "default" + }, + "use_selection15": { + "use": "87faa133-4cac-4816-ae41-5c3f9a2f76aa", + "as": "default" + }, + "use_selection16": { + "use": "fff3255d-c493-4c21-a48f-73b3ebf8ba05", + "as": "default" + }, + "use_selection17": { + "use": "ed9591cb-0a03-400a-bf47-eaf78ab19b9d", + "as": "default" + }, + "use_selection18": { + "use": "c6c30d66-3106-44eb-9272-b2cf7ec74613", + "as": "default" + }, + "use_selection19": { + "use": "295186de-5954-4a65-a4c1-2f79ef305743", + "as": "default" + }, + "use_selection20": { + "use": "9eba241c-af90-42dd-ae05-92ff4d8391d3", + "as": "default" + }, + "use_selection21": { + "use": "516f93b8-5fff-41c6-aeaf-2d93180a12cc", + "as": "default" + }, + "use_selection22": { + "use": "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Factory", + "description": "Compiler Factory\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;" +} \ No newline at end of file diff --git a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/README.md b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/README.md new file mode 100644 index 0000000..3603002 --- /dev/null +++ b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/README.md @@ -0,0 +1,101 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Power (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Power #Gold { + + register(Container $container) : void + + getPowers(Container $container) : Powers + + getAutoloader(Container $container) : Autoloader + + getInfusion(Container $container) : Infusion + + getStructure(Container $container) : Structure + + getParser(Container $container) : Parser + + getPlantuml(Container $container) : Plantuml + + getRepoReadme(Container $container) : RepoReadme + + getReposReadme(Container $container) : ReposReadme +} + +note right of Power::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of Power::getPowers + Get the Powers + + since: 3.2.0 + return: Powers +end note + +note right of Power::getAutoloader + Get the Compiler Autoloader + + since: 3.2.0 + return: Autoloader +end note + +note left of Power::getInfusion + Get the Compiler Power Infusion + + since: 3.2.0 + return: Infusion +end note + +note right of Power::getStructure + Get the Compiler Power Structure Builder + + since: 3.2.0 + return: Structure +end note + +note left of Power::getParser + Get the Compiler Power Parser + + since: 3.2.0 + return: Parser +end note + +note right of Power::getPlantuml + Get the Compiler Power Plantuml Builder + + since: 3.2.0 + return: Plantuml +end note + +note left of Power::getRepoReadme + Get the Compiler Power Repo Readme Builder + + since: 3.2.0 + return: RepoReadme +end note + +note right of Power::getReposReadme + Get the Compiler Power Repos Readme Builder + + since: 3.2.0 + return: ReposReadme +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php new file mode 100644 index 0000000..2c4a9de --- /dev/null +++ b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/code.php @@ -0,0 +1,209 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Power as Powers; +use VDM\Joomla\Componentbuilder\Compiler\Power\Infusion; +use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader; +use VDM\Joomla\Componentbuilder\Compiler\Power\Structure; +use VDM\Joomla\Componentbuilder\Compiler\Power\Parser; +use VDM\Joomla\Componentbuilder\Compiler\Power\Plantuml; +use VDM\Joomla\Componentbuilder\Compiler\Power\Repo\Readme as RepoReadme; +use VDM\Joomla\Componentbuilder\Compiler\Power\Repos\Readme as ReposReadme; + + +/** + * Compiler Power Service Provider + * + * @since 3.2.0 + */ +class Power implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Powers::class, 'Power') + ->share('Power', [$this, 'getPowers'], true); + + $container->alias(Autoloader::class, 'Power.Autoloader') + ->share('Power.Autoloader', [$this, 'getAutoloader'], true); + + $container->alias(Infusion::class, 'Power.Infusion') + ->share('Power.Infusion', [$this, 'getInfusion'], true); + + $container->alias(Structure::class, 'Power.Structure') + ->share('Power.Structure', [$this, 'getStructure'], true); + + $container->alias(Parser::class, 'Power.Parser') + ->share('Power.Parser', [$this, 'getParser'], true); + + $container->alias(Plantuml::class, 'Power.Plantuml') + ->share('Power.Plantuml', [$this, 'getPlantuml'], true); + + $container->alias(RepoReadme::class, 'Power.Repo.Readme') + ->share('Power.Repo.Readme', [$this, 'getRepoReadme'], true); + + $container->alias(ReposReadme::class, 'Power.Repos.Readme') + ->share('Power.Repos.Readme', [$this, 'getReposReadme'], true); + } + + /** + * Get the Powers + * + * @param Container $container The DI container. + * + * @return Powers + * @since 3.2.0 + */ + public function getPowers(Container $container): Powers + { + return new Powers( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Customcode.Gui') + ); + } + + /** + * Get the Compiler Autoloader + * + * @param Container $container The DI container. + * + * @return Autoloader + * @since 3.2.0 + */ + public function getAutoloader(Container $container): Autoloader + { + return new Autoloader( + $container->get('Power'), + $container->get('Config'), + $container->get('Content') + ); + } + + /** + * Get the Compiler Power Infusion + * + * @param Container $container The DI container. + * + * @return Infusion + * @since 3.2.0 + */ + public function getInfusion(Container $container): Infusion + { + return new Infusion( + $container->get('Config'), + $container->get('Power'), + $container->get('Content'), + $container->get('Power.Autoloader'), + $container->get('Power.Parser'), + $container->get('Power.Repo.Readme'), + $container->get('Power.Repos.Readme'), + $container->get('Placeholder'), + $container->get('Event') + ); + } + + /** + * Get the Compiler Power Structure Builder + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Power'), + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Utilities.Counter'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Folder'), + $container->get('Utilities.File'), + $container->get('Utilities.Files') + ); + } + + /** + * Get the Compiler Power Parser + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getParser(Container $container): Parser + { + return new Parser(); + } + + /** + * Get the Compiler Power Plantuml Builder + * + * @param Container $container The DI container. + * + * @return Plantuml + * @since 3.2.0 + */ + public function getPlantuml(Container $container): Plantuml + { + return new Plantuml(); + } + + /** + * Get the Compiler Power Repo Readme Builder + * + * @param Container $container The DI container. + * + * @return RepoReadme + * @since 3.2.0 + */ + public function getRepoReadme(Container $container): RepoReadme + { + return new RepoReadme( + $container->get('Power'), + $container->get('Power.Plantuml') + ); + } + + /** + * Get the Compiler Power Repos Readme Builder + * + * @param Container $container The DI container. + * + * @return ReposReadme + * @since 3.2.0 + */ + public function getReposReadme(Container $container): ReposReadme + { + return new ReposReadme( + $container->get('Power'), + $container->get('Power.Plantuml') + ); + } + +} + diff --git a/src/de01527a-6586-46ea-92e7-11ea3de1cedb/settings.json b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/settings.json new file mode 100644 index 0000000..1c5560f --- /dev/null +++ b/src/de01527a-6586-46ea-92e7-11ea3de1cedb/settings.json @@ -0,0 +1,51 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "de01527a-6586-46ea-92e7-11ea3de1cedb", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Power", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Power", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "as": "Powers" + }, + "use_selection1": { + "use": "0419081e-4cb3-4c65-8c6a-ffe941fb0f1c", + "as": "default" + }, + "use_selection2": { + "use": "6e64917c-d687-4ef3-a655-811319f5a81e", + "as": "default" + }, + "use_selection3": { + "use": "324566de-0f7d-4b6e-9caf-8424d55013ae", + "as": "default" + }, + "use_selection4": { + "use": "95d0e03f-24fd-4412-bc2e-f0899fcc3205", + "as": "default" + }, + "use_selection5": { + "use": "ff5e9e63-86d0-4691-ab59-d4b9d9154096", + "as": "default" + }, + "use_selection6": { + "use": "efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5", + "as": "RepoReadme" + }, + "use_selection7": { + "use": "0d08c583-04d5-454e-b756-48ca05e1651a", + "as": "ReposReadme" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Power", + "description": "Compiler Power Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/README.md b/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/README.md new file mode 100644 index 0000000..1c30da5 --- /dev/null +++ b/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/README.md @@ -0,0 +1,47 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Javascriptadminview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Javascriptadminview #Gold { + # array $scripter + # array $guiMapper + # Dispenser $dispenser + + __construct(?Dispenser $dispenser = null) + + set(object $item, string $table = 'admin_view') : void +} + +note right of Javascriptadminview::__construct + Constructor + + since: 3.2.0 +end note + +note right of Javascriptadminview::set + Set Admin View Javascript + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/code.php b/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/code.php new file mode 100644 index 0000000..f6df062 --- /dev/null +++ b/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/code.php @@ -0,0 +1,128 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model Admin View Javascript Class + * + * @since 3.2.0 + */ +class Javascriptadminview +{ + /** + * The scripter add array + * + * @var array + * @since 3.2.0 + */ + protected array $scripter = [ + 'javascript_view_file', + 'javascript_view_footer', + 'javascript_views_file', + 'javascript_views_footer' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'admin_view', + 'id' => null, + 'field' => null, + 'type' => 'js', + 'prefix' => PHP_EOL + ]; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Set Admin View Javascript + * + * @param object $item The item data + * @param object $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'admin_view') + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + foreach ($this->scripter as $scripter) + { + if (isset($item->{'add_' . $scripter}) + && $item->{'add_' . $scripter} == 1 + && StringHelper::check($item->$scripter)) + { + $scripter_target = str_replace( + 'javascript_', '', (string) $scripter + ); + + // update GUI mapper field + $this->guiMapper['field'] = $scripter; + $this->dispenser->set( + $item->{$scripter}, + $scripter_target, + $item->name_single_code, + null, + $this->guiMapper, + true, + true, + true + ); + + // check if a token must be set + if ((strpos((string) $item->$scripter, "token") !== false + || strpos( + (string) $item->$scripter, "task=ajax" + ) !== false) && !$this->dispenser->hub['token'][$item->name_single_code]) + { + $this->dispenser->hub['token'][$item->name_single_code] + = true; + } + + unset($item->{$scripter}); + } + } + } + +} + diff --git a/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/settings.json b/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/settings.json new file mode 100644 index 0000000..801da7c --- /dev/null +++ b/src/dfd3c893-0296-46eb-9ae4-a0348713cd8f/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "dfd3c893-0296-46eb-9ae4-a0348713cd8f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Javascriptadminview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Javascriptadminview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Javascriptadminview", + "description": "Model Admin View Javascript Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e0075978-315d-4807-8507-ce9c6922a885/README.md b/src/e0075978-315d-4807-8507-ce9c6922a885/README.md new file mode 100644 index 0000000..5457968 --- /dev/null +++ b/src/e0075978-315d-4807-8507-ce9c6922a885/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Siteviews (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Siteviews #Gold { + # Customview $site + # Config $config + + __construct(?Customview $site = null, ?Config $config = null) + + set(object $item) : void +} + +note right of Siteviews::__construct + Constructor + + since: 3.2.0 +end note + +note right of Siteviews::set + Set site view data + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e0075978-315d-4807-8507-ce9c6922a885/code.php b/src/e0075978-315d-4807-8507-ce9c6922a885/code.php new file mode 100644 index 0000000..e60e763 --- /dev/null +++ b/src/e0075978-315d-4807-8507-ce9c6922a885/code.php @@ -0,0 +1,109 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customview\Data as Customview; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model Site Views Class + * + * @since 3.2.0 + */ +class Siteviews +{ + /** + * Component Site view Data + * + * @var Customview + * @since 3.2.0 + **/ + protected Customview $site; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor + * + * @param Customview|null $site The site view data object. + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Customview $site = null, ?Config $config = null) + { + $this->site = $site ?: Compiler::_('Customview.Data'); + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Set site view data + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addsite_views = (isset($item->addsite_views) + && JsonHelper::check($item->addsite_views)) + ? json_decode((string) $item->addsite_views, true) : null; + + if (ArrayHelper::check($item->addsite_views)) + { + $this->config->lang_target = 'site'; + $this->config->build_target = 'site'; + + // build the site_views settings + $item->site_views = array_map( + function ($array) { + // has become a legacy issue, can't remove this + $array['view'] = $array['siteview']; + $array['settings'] = $this->site->get( + $array['view'] + ); + + return array_map( + function ($value) { + if (!ArrayHelper::check($value) + && !ObjectHelper::check($value) + && strval($value) === strval(intval($value))) + { + return (int) $value; + } + + return $value; + }, $array + ); + }, array_values($item->addsite_views) + ); + + // unset original value + unset($item->addsite_views); + } + } + +} + diff --git a/src/e0075978-315d-4807-8507-ce9c6922a885/settings.json b/src/e0075978-315d-4807-8507-ce9c6922a885/settings.json new file mode 100644 index 0000000..563cfde --- /dev/null +++ b/src/e0075978-315d-4807-8507-ce9c6922a885/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "e0075978-315d-4807-8507-ce9c6922a885", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Siteviews", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Siteviews", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "3b6895da-d9eb-4164-90b1-4632a4cc2474", + "as": "Customview" + }, + "use_selection2": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection3": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Siteviews", + "description": "Model Site Views Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e0e24173-a808-4dd5-8e26-de971d014f86/README.md b/src/e0e24173-a808-4dd5-8e26-de971d014f86/README.md new file mode 100644 index 0000000..2fe821a --- /dev/null +++ b/src/e0e24173-a808-4dd5-8e26-de971d014f86/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customadminviews (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Customadminviews #Gold { + # Customview $customadmin + # Config $config + + __construct(?Customview $customadmin = null, ?Config $config = null) + + set(object $item) : void +} + +note right of Customadminviews::__construct + Constructor + + since: 3.2.0 +end note + +note right of Customadminviews::set + Set custom admin view data + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e0e24173-a808-4dd5-8e26-de971d014f86/code.php b/src/e0e24173-a808-4dd5-8e26-de971d014f86/code.php new file mode 100644 index 0000000..6913435 --- /dev/null +++ b/src/e0e24173-a808-4dd5-8e26-de971d014f86/code.php @@ -0,0 +1,109 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customview\Data as Customview; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model Custom Admin Views Class + * + * @since 3.2.0 + */ +class Customadminviews +{ + /** + * Component custom admin view Data + * + * @var Customview + * @since 3.2.0 + **/ + protected Customview $customadmin; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor + * + * @param Customview|null $customadmin The custom admin view data object. + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Customview $customadmin = null, ?Config $config = null) + { + $this->customadmin = $customadmin ?: Compiler::_('Customview.Data'); + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Set custom admin view data + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->addcustom_admin_views = (isset($item->addcustom_admin_views) + && JsonHelper::check($item->addcustom_admin_views)) + ? json_decode((string) $item->addcustom_admin_views, true) : null; + + if (ArrayHelper::check($item->addcustom_admin_views)) + { + $this->config->lang_target = 'admin'; + $this->config->build_target = 'custom_admin'; + + // build the site_views settings + $item->custom_admin_views = array_map( + function ($array) { + // has become a legacy issue, can't remove this + $array['view'] = $array['customadminview']; + $array['settings'] = $this->customadmin->get( + $array['view'], 'custom_admin_view' + ); + + return array_map( + function ($value) { + if (!ArrayHelper::check($value) + && !ObjectHelper::check($value) + && strval($value) === strval(intval($value))) + { + return (int) $value; + } + + return $value; + }, $array + ); + }, array_values($item->addcustom_admin_views) + ); + + // unset original value + unset($item->addcustom_admin_views); + } + } + +} + diff --git a/src/e0e24173-a808-4dd5-8e26-de971d014f86/settings.json b/src/e0e24173-a808-4dd5-8e26-de971d014f86/settings.json new file mode 100644 index 0000000..da0f23b --- /dev/null +++ b/src/e0e24173-a808-4dd5-8e26-de971d014f86/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "e0e24173-a808-4dd5-8e26-de971d014f86", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Customadminviews", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Customadminviews", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "3b6895da-d9eb-4164-90b1-4632a4cc2474", + "as": "Customview" + }, + "use_selection2": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection3": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection4": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection5": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Customadminviews", + "description": "Model Custom Admin Views Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/README.md b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/README.md new file mode 100644 index 0000000..ec68a23 --- /dev/null +++ b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/README.md @@ -0,0 +1,43 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Component (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Component #Gold { + + __construct(?Data $component = null) + + __get(string $path) +} + +note right of Component::__construct + Constructor + + since: 3.2.0 +end note + +note right of Component::__get + getting any valid value + + since: 3.2.0 +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php new file mode 100644 index 0000000..5715aae --- /dev/null +++ b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php @@ -0,0 +1,60 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Component\Data; +use VDM\Joomla\Componentbuilder\Abstraction\BaseRegistry; + + +/** + * Compiler Component + * + * @since 3.2.0 + */ +class Component extends BaseRegistry +{ + /** + * Constructor + * + * @param Data|null $component The component data class. + * + * @since 3.2.0 + */ + public function __construct(?Data $component = null) + { + $component = $component ?: Compiler::_('Component.Data'); + + parent::__construct($component->get()); + } + + /** + * getting any valid value + * + * @param string $path The value's key/path name + * + * @since 3.2.0 + */ + public function __get(string $path) + { + // check if it has been set + if (($value = $this->get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') + { + return $value; + } + + return null; + } + +} + diff --git a/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json new file mode 100644 index 0000000..edb970d --- /dev/null +++ b/src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "b84e947d-2a13-44f7-ac0f-3902ae55ae0c", + "extends_custom": "", + "guid": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Component", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "ef9578e5-4c9d-46bf-866f-3a94bdc7b753", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component", + "description": "Compiler Component\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/README.md b/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/README.md new file mode 100644 index 0000000..86dab16 --- /dev/null +++ b/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Sqltweaking (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Sqltweaking #Gold { + # Registry $registry + + __construct(?Registry $registry = null) + + set(object $item) : void + # tweak(array $settings) : void +} + +note right of Sqltweaking::__construct + Constructor + + since: 3.2.0 +end note + +note right of Sqltweaking::set + Set sql tweaking if needed + + since: 3.2.0 + return: void +end note + +note right of Sqltweaking::tweak + To limit the SQL Demo data build in the views + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/code.php b/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/code.php new file mode 100644 index 0000000..960f607 --- /dev/null +++ b/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/code.php @@ -0,0 +1,180 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model Sql Tweaking Class + * + * @since 3.2.0 + */ +class Sqltweaking +{ + /** + * Compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Set sql tweaking if needed + * + * @param object $item The extension data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + // set the sql_tweak data + $item->sql_tweak = (isset($item->sql_tweak) + && JsonHelper::check($item->sql_tweak)) + ? json_decode((string) $item->sql_tweak, true) : null; + + if (ArrayHelper::check($item->sql_tweak)) + { + // build the tweak settings + $this->tweak( + array_map( + fn($array) => array_map( + function ($value) { + if (!ArrayHelper::check($value) + && !ObjectHelper::check( + $value + ) + && strval($value) === strval( + intval($value) + )) + { + return (int) $value; + } + + return $value; + }, $array + ), array_values($item->sql_tweak) + ) + ); + } + + unset($item->sql_tweak); + } + + /** + * To limit the SQL Demo data build in the views + * + * @param array $settings Tweaking array. + * + * @return void + * @since 3.2.0 + */ + protected function tweak($settings) + { + if (ArrayHelper::check($settings)) + { + foreach ($settings as $setting) + { + // should sql dump be added + if (1 == $setting['add_sql']) + { + // add sql (by option) + if (2 == $setting['add_sql_options']) + { + // rest always + $id_array = []; + + // by id (first remove backups) + $ids = $setting['ids']; + + // now get the ids + if (strpos((string) $ids, ',') !== false) + { + $id_array = (array) array_map( + 'trim', explode(',', (string) $ids) + ); + } + else + { + $id_array[] = trim((string) $ids); + } + $id_array_new = []; + + // check for ranges + foreach ($id_array as $key => $id) + { + if (strpos($id, '=>') !== false) + { + $id_range = (array) array_map( + 'trim', explode('=>', $id) + ); + unset($id_array[$key]); + // build range + if (count((array) $id_range) == 2) + { + $range = range( + $id_range[0], $id_range[1] + ); + $id_array_new = [...$id_array_new, ...$range]; + } + } + } + + if (ArrayHelper::check($id_array_new)) + { + $id_array = [...$id_array_new, ...$id_array]; + } + + // final fixing to array + if (ArrayHelper::check($id_array)) + { + // unique + $id_array = array_unique($id_array, SORT_NUMERIC); + // sort + sort($id_array, SORT_NUMERIC); + // now set it to global + $this->registry-> + set('builder.sql_tweak.' . (int) $setting['adminview'] . '.where', implode(',', $id_array)); + } + } + } + else + { + // do not add sql dump options + $this->registry-> + set('builder.sql_tweak.' . (int) $setting['adminview'] . '.add', false); + } + } + } + } + +} + diff --git a/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/settings.json b/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/settings.json new file mode 100644 index 0000000..e5486e3 --- /dev/null +++ b/src/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Sqltweaking", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Sqltweaking", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection3": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection4": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Sqltweaking", + "description": "Model Sql Tweaking Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/README.md b/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/README.md new file mode 100644 index 0000000..9fbe8f7 --- /dev/null +++ b/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Registry (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Registry #Gold { + # $indent + + varExport(string $path, int $default = 2) : ?string + # convertIndent(array $matches) : string +} + +note right of Registry::varExport + Method to export a set of values to a PHP array + + since: 3.4.0 + return: ?string +end note + +note right of Registry::convertIndent + Method to convert found of grouped spaces to system indentation + + since: 3.4.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/code.php b/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/code.php new file mode 100644 index 0000000..925727b --- /dev/null +++ b/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/code.php @@ -0,0 +1,101 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Abstraction\BaseRegistry; + + +/** + * Compiler Registry + * + * @since 3.2.0 + */ +class Registry extends BaseRegistry +{ + /** + * Default indentation value + * + * @var int + * @since 1.0 + */ + protected $indent = 2; + + /** + * Method to export a set of values to a PHP array + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param int $default The default indentation + * + * @return ?string The var set being exported as a PHP array + * + * @since 3.4.0 + */ + public function varExport(string $path, int $default = 2): ?string + { + // check if we have data + if (($data = $this->extract($path)) !== null) + { + // set the default indentation value + $this->indent = $default; + + // convert to array + $data = $data->toArray(); + + // convert to string + $data = var_export($data, true); + + // replace all space with system indentation + $data = preg_replace_callback("/^(\s{2})(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(.*)/m", [$this, 'convertIndent'], $data); + + // convert all array to [] + $array = preg_split("/\r\n|\n|\r/", $data); + $array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [NULL, ']$1', ' => ['], $array); + $data = implode(PHP_EOL, array_filter(["["] + $array)); + + // add needed indentation to the last ] + $data = preg_replace("/^(\])/m", Indent::_($default) . '$1', $data); + + return $data; + } + return null; + } + + /** + * Method to convert found of grouped spaces to system indentation + * + * @param array $matches The regex array of matching values + * + * @return string The resulting string. + * + * @since 3.4.0 + */ + protected function convertIndent(array $matches): string + { + // set number to indent by default + $indent = Indent::_($this->indent); + + // update each found space (group) with one indentation + foreach (range(1, 11) as $space) + { + if (strlen((string) $matches[$space]) > 0) + { + $indent .= Indent::_(1); + } + } + + return $indent . $matches[12]; + } + +} + diff --git a/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/settings.json b/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/settings.json new file mode 100644 index 0000000..1b9db68 --- /dev/null +++ b/src/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6/settings.json @@ -0,0 +1,21 @@ +{ + "add_head": "0", + "extends": "b84e947d-2a13-44f7-ac0f-3902ae55ae0c", + "extends_custom": "", + "guid": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Registry", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Registry", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Registry", + "description": "Compiler Registry\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e6a64c41-405e-4bbc-9722-27402c22bbea/README.md b/src/e6a64c41-405e-4bbc-9722-27402c22bbea/README.md new file mode 100644 index 0000000..01483f0 --- /dev/null +++ b/src/e6a64c41-405e-4bbc-9722-27402c22bbea/README.md @@ -0,0 +1,62 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Fields (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Fields #Gold { + # Config $config + # Registry $registry + # HistoryInterface $history + # Customcode $customcode + # Field $field + # FieldName $fieldName + # UpdateSql $updateSql + # CMSApplication $app + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(object $item) : void +} + +note right of Fields::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?HistoryInterface $history = null + ?Customcode $customcode = null + ?Field $field = null + ?FieldName $fieldName = null + ?UpdateSql $updateSql = null + ?CMSApplication $app = null +end note + +note right of Fields::set + Set fields + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e6a64c41-405e-4bbc-9722-27402c22bbea/code.php b/src/e6a64c41-405e-4bbc-9722-27402c22bbea/code.php new file mode 100644 index 0000000..d7fe61d --- /dev/null +++ b/src/e6a64c41-405e-4bbc-9722-27402c22bbea/code.php @@ -0,0 +1,342 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Application\CMSApplication; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Field; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model Fields Class + * + * @since 3.2.0 + */ +class Fields +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler History + * + * @var HistoryInterface + * @since 3.2.0 + */ + protected HistoryInterface $history; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Field + * + * @var Field + * @since 3.2.0 + */ + protected Field $field; + + /** + * Compiler Field Name + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldName; + + /** + * Compiler Update Sql + * + * @var UpdateSql + * @since 3.2.0 + */ + protected UpdateSql $updateSql; + + /** + * Application object. + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param HistoryInterface|null $history The compiler history object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Field|null $field The compiler field object. + * @param FieldName|null $fieldName The compiler field name object. + * @param UpdateSql|null $updateSql The compiler field name object. + * @param CMSApplication|null $app The app object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?HistoryInterface $history = null, ?Customcode $customcode = null, + ?Field $field = null, ?FieldName $fieldName = null, + ?UpdateSql $updateSql = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->history = $history ?: Compiler::_('History'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->field = $field ?: Compiler::_('Field'); + $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); + $this->updateSql = $updateSql ?: Compiler::_('Model.Updatesql'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set fields + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->fields = []; + + $item->addfields = (isset($item->addfields) + && JsonHelper::check($item->addfields)) + ? json_decode((string) $item->addfields, true) : null; + + if (ArrayHelper::check($item->addfields)) + { + $ignore_fields = []; + $default_fields = $this->config->default_fields; + + // load the field data + $item->fields = array_map( + function ($field) use ( + &$item, &$ignore_fields, &$default_fields + ) { + // set the field details + $this->field->set( + $field, $item->name_single_code, + $item->name_list_code + ); + + // check if this field is a default field OR + // check if this is none database related field + if (in_array($field['base_name'], $default_fields) + || FieldHelper::check($field['type_name'], 'spacer') + || (isset($field['list']) && $field['list'] == 2)) // 2 = none database + { + $ignore_fields[$field['field']] = $field['field']; + } + + // return field + return $field; + + }, array_values($item->addfields) + ); + + // build update SQL + if ($old_view = $this->history->get( + 'admin_fields', $item->addfields_id + )) + { + // add new fields were added + if (isset($old_view->addfields) + && JsonHelper::check( + $old_view->addfields + )) + { + $this->updateSql->set( + json_decode((string) $old_view->addfields, true), + $item->addfields, 'field', $item->name_single_code, + $ignore_fields + ); + } + // clear this data + unset($old_view); + } + + // sort the fields according to order + usort( + $item->fields, function ($a, $b) { + if (isset($a['order_list']) && isset($b['order_list'])) + { + if ($a['order_list'] != 0 && $b['order_list'] != 0) + { + return $a['order_list'] - $b['order_list']; + } + elseif ($b['order_list'] != 0 && $a['order_list'] == 0) + { + return 1; + } + elseif ($a['order_list'] != 0 && $b['order_list'] == 0) + { + return 0; + } + + return 1; + } + + return 0; + } + ); + + // do some house cleaning (for fields) + foreach ($item->fields as $field) + { + // so first we lock the field name in + $field_name = $this->fieldName->get( + $field, $item->name_list_code + ); + + // check if the field changed since the last compilation + // (default fields never change and are always added) + if (!isset($ignore_fields[$field['field']]) + && ObjectHelper::check( + $field['settings']->history + )) + { + // check if the datatype changed + if (isset($field['settings']->history->datatype)) + { + $this->updateSql->set( + $field['settings']->history->datatype, + $field['settings']->datatype, 'field.datatype', + $item->name_single_code . '.' . $field_name + ); + } + + // check if the datatype lenght changed + if (isset($field['settings']->history->datalenght) + && isset($field['settings']->history->datalenght_other)) + { + $this->updateSql->set( + $field['settings']->history->datalenght + . $field['settings']->history->datalenght_other, + $field['settings']->datalenght + . $field['settings']->datalenght_other, + 'field.lenght', + $item->name_single_code . '.' . $field_name + ); + } + + // check if the name changed + if (isset($field['settings']->history->xml) + && JsonHelper::check( + $field['settings']->history->xml + )) + { + // only run if this is not an alias or a tag + if ((!isset($field['alias']) || !$field['alias']) + && 'tag' !== $field['settings']->type_name) + { + // build temp field bucket + $tmpfield = []; + $tmpfield['settings'] = new \stdClass(); + + // convert the xml json string to normal string + $tmpfield['settings']->xml + = $this->customcode->update( + json_decode( + (string) $field['settings']->history->xml + ) + ); + + // add properties from current field as it is generic + $tmpfield['settings']->properties + = $field['settings']->properties; + // add the old name + $tmpfield['settings']->name + = $field['settings']->history->name; + // add the field type from current field since it is generic + $tmpfield['settings']->type_name + = $field['settings']->type_name; + // get the old name + $old_field_name = $this->fieldName->get( + $tmpfield + ); + + // only run this if not a multi field + if ($this->registry->get('unique.names.' . $item->name_list_code . '.names.' . $field_name) === null) + { + // this only works when the field is + // not multiple of the same field + $this->updateSql->set( + $old_field_name, $field_name, + 'field.name', + $item->name_single_code . '.' + . $field_name + ); + } + elseif ($old_field_name !== $field_name) + { + // give a notice atleast that the multi fields + // could have changed and no DB update was done + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEFIELD_NOTICEHTHREE'), + 'Notice' + ); + $this->app->enqueueMessage( + Text::sprintf( + 'You have a field called %s that has been added multiple times to the %s view, the name of that field has changed to %s. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!', + $field_name, + $item->name_single_code, + $old_field_name + ), 'Notice' + ); + } + + // remove tmp + unset($tmpfield); + } + } + } + } + } + + unset($item->addfields); + } + +} + diff --git a/src/e6a64c41-405e-4bbc-9722-27402c22bbea/settings.json b/src/e6a64c41-405e-4bbc-9722-27402c22bbea/settings.json new file mode 100644 index 0000000..f7fd981 --- /dev/null +++ b/src/e6a64c41-405e-4bbc-9722-27402c22bbea/settings.json @@ -0,0 +1,66 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "e6a64c41-405e-4bbc-9722-27402c22bbea", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Fields", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Fields", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "4325745f-da1f-4d4d-a591-3189fe8c06e5", + "as": "default" + }, + "use_selection4": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection5": { + "use": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "as": "default" + }, + "use_selection6": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection7": { + "use": "b80296eb-4718-4ed3-894d-69f3ac293733", + "as": "default" + }, + "use_selection8": { + "use": "7a5fd3f3-199e-43ba-a8e8-f473d6c030ec", + "as": "default" + }, + "use_selection9": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection10": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection11": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Fields", + "description": "Model Fields Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Language\\Text;\r\nuse Joomla\\CMS\\Application\\CMSApplication;" +} \ No newline at end of file diff --git a/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/README.md b/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/README.md new file mode 100644 index 0000000..ccb2e4d --- /dev/null +++ b/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/README.md @@ -0,0 +1,98 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Counter (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +class Counter #Gold { + + int $folder + + int $file + + int $page + + int $line + + int $field + # int $seconds + # float $actualSeconds + # int $folderSeconds + # int $fileSeconds + # int $lineSeconds + # float $secondsDebugging + # float $secondsPlanning + # float $secondsMapping + # float $secondsOffice + # int $totalHours + # int $debuggingHours + # int $planningHours + # int $mappingHours + # int $officeHours + # int $actualTotalHours + # int $actualHoursSpent + # int $actualDaysSpent + # int $totalDays + # int $actualTotalDays + # float $projectWeekTime + # float $projectMonthTime + # float $start + # float $end + # float $timer + # Content $content + + __construct(?Content $content = null) + + start() : void + + end() : void + + set() : void + # calculate() : void +} + +note right of Counter::__construct + Constructor + + since: 3.2.0 +end note + +note right of Counter::start + Start the timer + + since: 3.2.0 + return: void +end note + +note right of Counter::end + End the timer + + since: 3.2.0 + return: void +end note + +note right of Counter::set + Set all the time values + + since: 3.2.0 + return: void +end note + +note right of Counter::calculate + Calculate all the time values + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/code.php b/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/code.php new file mode 100644 index 0000000..37e878b --- /dev/null +++ b/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/code.php @@ -0,0 +1,403 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Content; + + +/** + * Compiler Utilities Counter + * + * @since 3.2.0 + */ +class Counter +{ + /** + * The folder counter + * + * @var int + * @since 3.2.0 + */ + public int $folder = 0; + + /** + * The file counter + * + * @var int + * @since 3.2.0 + */ + public int $file = 0; + + /** + * The page counter + * + * @var int + * @since 3.2.0 + */ + public int $page = 0; + + /** + * The line counter + * + * @var int + * @since 3.2.0 + */ + public int $line = 0; + + /** + * The field counter + * + * @var int + * @since 3.2.0 + */ + public int $field = 0; + + /** + * The seconds counter + * + * @var int + * @since 3.2.0 + */ + protected int $seconds = 0; + + /** + * The actual seconds counter + * + * @var float + * @since 3.2.0 + */ + protected float $actualSeconds = 0; + + /** + * The folder seconds counter + * + * @var int + * @since 3.2.0 + */ + protected int $folderSeconds = 0; + + /** + * The file seconds counter + * + * @var int + * @since 3.2.0 + */ + protected int $fileSeconds = 0; + + /** + * The line seconds counter + * + * @var int + * @since 3.2.0 + */ + protected int $lineSeconds = 0; + + /** + * The seconds debugging counter + * + * @var float + * @since 3.2.0 + */ + protected float $secondsDebugging = 0; + + /** + * The seconds planning counter + * + * @var float + * @since 3.2.0 + */ + protected float $secondsPlanning = 0; + + /** + * The seconds mapping counter + * + * @var float + * @since 3.2.0 + */ + protected float $secondsMapping = 0; + + /** + * The seconds office counter + * + * @var float + * @since 3.2.0 + */ + protected float $secondsOffice = 0; + + /** + * The total hours counter + * + * @var int + * @since 3.2.0 + */ + protected int $totalHours = 0; + + /** + * The debugging hours counter + * + * @var int + * @since 3.2.0 + */ + protected int $debuggingHours = 0; + + /** + * The planning hours counter + * + * @var int + * @since 3.2.0 + */ + protected int $planningHours = 0; + + /** + * The mapping hours counter + * + * @var int + * @since 3.2.0 + */ + protected int $mappingHours = 0; + + /** + * The office hours counter + * + * @var int + * @since 3.2.0 + */ + protected int $officeHours = 0; + + /** + * The actual Total Hours counter + * + * @var int + * @since 3.2.0 + */ + protected int $actualTotalHours = 0; + + /** + * The actual hours spent counter + * + * @var int + * @since 3.2.0 + */ + protected int $actualHoursSpent = 0; + + /** + * The actual days spent counter + * + * @var int + * @since 3.2.0 + */ + protected int $actualDaysSpent = 0; + + /** + * The total days counter + * + * @var int + * @since 3.2.0 + */ + protected int $totalDays = 0; + + /** + * The actual Total Days counter + * + * @var int + * @since 3.2.0 + */ + protected int $actualTotalDays = 0; + + /** + * The project week time counter + * + * @var float + * @since 3.2.0 + */ + protected float $projectWeekTime = 0; + + /** + * The project month time counter + * + * @var float + * @since 3.2.0 + */ + protected float $projectMonthTime = 0; + + /** + * The compiler start timer + * + * @var float + * @since 3.2.0 + */ + protected float $start = 0; + + /** + * The compiler end timer + * + * @var float + * @since 3.2.0 + */ + protected float $end = 0; + + /** + * The compiler timer + * + * @var float + * @since 3.2.0 + */ + protected float $timer = 0; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Constructor + * + * @param Content|null $content The compiler content object. + * + * @since 3.2.0 + */ + public function __construct(?Content $content = null) + { + $this->content = $content ?: Compiler::_('Content'); + } + + /** + * Start the timer + * + * @return void + * @since 3.2.0 + */ + public function start() + { + $this->start = microtime(true); + } + + /** + * End the timer + * + * @return void + * @since 3.2.0 + */ + public function end() + { + $this->end = microtime(true); + + // calculate the lenght + $this->timer = $this->end - $this->start; + + // compiler time + $this->content->set('COMPILER_TIMER_END', $this->end); + $this->content->set('COMPILER_TIMER', $this->timer); + } + + /** + * Set all the time values + * + * @return void + * @since 3.2.0 + */ + public function set() + { + // calculate all the values + $this->calculate(); + + // set some defaults + $this->content->set('LINE_COUNT', $this->line); + $this->content->set('FIELD_COUNT', $this->field); + $this->content->set('FILE_COUNT', $this->file); + $this->content->set('FOLDER_COUNT', $this->folder); + $this->content->set('PAGE_COUNT', $this->page); + $this->content->set('folders', $this->folderSeconds); + $this->content->set('foldersSeconds', $this->folderSeconds); + $this->content->set('files', $this->fileSeconds); + $this->content->set('filesSeconds', $this->fileSeconds); + $this->content->set('lines', $this->lineSeconds); + $this->content->set('linesSeconds', $this->lineSeconds); + $this->content->set('seconds', $this->actualSeconds); + $this->content->set('actualSeconds', $this->actualSeconds); + $this->content->set('totalHours', $this->totalHours); + $this->content->set('totalDays', $this->totalDays); + $this->content->set('debugging', $this->secondsDebugging); + $this->content->set('secondsDebugging', $this->secondsDebugging); + $this->content->set('planning', $this->secondsPlanning); + $this->content->set('secondsPlanning', $this->secondsPlanning); + $this->content->set('mapping', $this->secondsMapping); + $this->content->set('secondsMapping', $this->secondsMapping); + $this->content->set('office', $this->secondsOffice); + $this->content->set('secondsOffice', $this->secondsOffice); + $this->content->set('actualTotalHours', $this->actualTotalHours); + $this->content->set('actualTotalDays', $this->actualTotalDays); + $this->content->set('debuggingHours', $this->debuggingHours); + $this->content->set('planningHours', $this->planningHours); + $this->content->set('mappingHours', $this->mappingHours); + $this->content->set('officeHours', $this->officeHours); + $this->content->set('actualHoursSpent', $this->actualHoursSpent); + $this->content->set('actualDaysSpent', $this->actualDaysSpent); + $this->content->set('projectWeekTime', $this->projectWeekTime); + $this->content->set('projectMonthTime', $this->projectMonthTime); + + // compiler time + $this->content->set('COMPILER_TIMER_START', $this->start); + } + + /** + * Calculate all the time values + * + * @return void + * @since 3.2.0 + */ + protected function calculate() + { + // what is the size in terms of an A4 book + $this->page = round($this->line / 56); + + // setup the unrealistic numbers + $this->folderSeconds = $this->folder * 5; + $this->fileSeconds = $this->file * 5; + $this->lineSeconds = $this->line * 10; + $this->seconds = $this->folderSeconds + $this->fileSeconds + + $this->lineSeconds; + $this->totalHours = round($this->seconds / 3600); + $this->totalDays = round($this->totalHours / 8); + + // setup the more realistic numbers + $this->secondsDebugging = $this->seconds / 4; + $this->secondsPlanning = $this->seconds / 7; + $this->secondsMapping = $this->seconds / 10; + $this->secondsOffice = $this->seconds / 6; + $this->actualSeconds = $this->folderSeconds + $this->fileSeconds + + $this->lineSeconds + $this->secondsDebugging + + $this->secondsPlanning + $this->secondsMapping + + $this->secondsOffice; + $this->actualTotalHours = round($this->actualSeconds / 3600); + $this->actualTotalDays = round($this->actualTotalHours / 8); + $this->debuggingHours = round($this->secondsDebugging / 3600); + $this->planningHours = round($this->secondsPlanning / 3600); + $this->mappingHours = round($this->secondsMapping / 3600); + $this->officeHours = round($this->secondsOffice / 3600); + + // the actual time spent + $this->actualHoursSpent = $this->actualTotalHours - $this->totalHours; + $this->actualDaysSpent = $this->actualTotalDays - $this->totalDays; + + // calculate the projects actual time frame of completion + $this->projectWeekTime = round($this->actualTotalDays / 5, 1); + $this->projectMonthTime = round($this->actualTotalDays / 24, 1); + } + +} + diff --git a/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/settings.json b/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/settings.json new file mode 100644 index 0000000..0da060a --- /dev/null +++ b/src/e6d871a6-bbe7-497d-af01-68f6bb9a87f4/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "JoomlaRegistry", + "guid": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Counter", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Counter", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Counter", + "description": "Compiler Utilities Counter\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/README.md b/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/README.md new file mode 100644 index 0000000..4095898 --- /dev/null +++ b/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Cssadminview (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Cssadminview #Gold { + # array $areas + # Dispenser $dispenser + + __construct(?Dispenser $dispenser = null) + + set(object $item) : void +} + +note right of Cssadminview::__construct + Constructor + + since: 3.2.0 +end note + +note right of Cssadminview::set + Set Admin View Css + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/code.php b/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/code.php new file mode 100644 index 0000000..e9855a1 --- /dev/null +++ b/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/code.php @@ -0,0 +1,90 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model CSS Admin View Class + * + * @since 3.2.0 + */ +class Cssadminview +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = [ + 'css_view', 'css_views' + ]; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Set Admin View Css + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + foreach ($this->areas as $area) + { + if (isset($item->{'add_' . $area}) + && $item->{'add_' . $area} == 1 + && StringHelper::check($item->{$area})) + { + $this->dispenser->set( + $item->{$area}, + $area, + $item->name_single_code, + null, + ['prefix' => PHP_EOL], + true, + true, + true + ); + + unset($item->{$area}); + } + } + } + +} + diff --git a/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/settings.json b/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/settings.json new file mode 100644 index 0000000..0466f8a --- /dev/null +++ b/src/e79842d3-51b7-4282-93c7-3487cd8b61ab/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "e79842d3-51b7-4282-93c7-3487cd8b61ab", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Cssadminview", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Cssadminview", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection2": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Cssadminview", + "description": "Model CSS Admin View Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/README.md b/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/README.md new file mode 100644 index 0000000..8e20973 --- /dev/null +++ b/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/README.md @@ -0,0 +1,61 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Compiler (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Compiler #Gold { + + register(Container $container) : void + + getConfig(Container $container) : Config + + getRegistry(Container $container) : Registry + + getTable(Container $container) : Table +} + +note right of Compiler::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Compiler::getConfig + Get the Compiler Configurations + + since: 3.2.0 + return: Config +end note + +note right of Compiler::getRegistry + Get the Compiler Registry + + since: 3.2.0 + return: Registry +end note + +note right of Compiler::getTable + Get the Table + + since: 3.2.0 + return: Table +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/code.php b/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/code.php new file mode 100644 index 0000000..479a2cc --- /dev/null +++ b/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/code.php @@ -0,0 +1,90 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Table; + + +/** + * Compiler Service Provider + * + * @since 3.2.0 + */ +class Compiler implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Config::class, 'Config') + ->share('Config', [$this, 'getConfig'], true); + + $container->alias(Registry::class, 'Registry') + ->share('Registry', [$this, 'getRegistry'], true); + + $container->alias(Table::class, 'Table') + ->share('Table', [$this, 'getTable'], true); + } + + /** + * Get the Compiler Configurations + * + * @param Container $container The DI container. + * + * @return Config + * @since 3.2.0 + */ + public function getConfig(Container $container): Config + { + return new Config(); + } + + /** + * Get the Compiler Registry + * + * @param Container $container The DI container. + * + * @return Registry + * @since 3.2.0 + */ + public function getRegistry(Container $container): Registry + { + return new Registry(); + } + + /** + * Get the Table + * + * @param Container $container The DI container. + * + * @return Table + * @since 3.2.0 + */ + public function getTable(Container $container): Table + { + return new Table(); + } + + +} + diff --git a/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/settings.json b/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/settings.json new file mode 100644 index 0000000..4e8cd83 --- /dev/null +++ b/src/ea5ed06e-72ae-4906-9167-1cc0fa32fe69/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "ea5ed06e-72ae-4906-9167-1cc0fa32fe69", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Compiler", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Compiler", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection1": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection2": { + "use": "bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Compiler", + "description": "Compiler Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/eb33420d-359d-44a5-852e-613aef1feaae/README.md b/src/eb33420d-359d-44a5-852e-613aef1feaae/README.md new file mode 100644 index 0000000..d6e2387 --- /dev/null +++ b/src/eb33420d-359d-44a5-852e-613aef1feaae/README.md @@ -0,0 +1,37 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class TypeName (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Field** +```uml +@startuml +class TypeName #Gold { + + get(object $field) : string +} + +note right of TypeName::get + Get the field's actual type + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/eb33420d-359d-44a5-852e-613aef1feaae/code.php b/src/eb33420d-359d-44a5-852e-613aef1feaae/code.php new file mode 100644 index 0000000..2397481 --- /dev/null +++ b/src/eb33420d-359d-44a5-852e-613aef1feaae/code.php @@ -0,0 +1,127 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\String\TypeHelper; + + +/** + * Compiler Field Type Name + * + * @since 3.2.0 + */ +class TypeName +{ + /** + * Get the field's actual type + * + * @param object $field The field object + * + * @return string Success returns field type + * @since 3.2.0 + */ + public function get(&$field) + { + // check if we have done this already + if (isset($field['type_name'])) + { + return $field['type_name']; + } + + // check that we have the properties + if (isset($field['settings']) + && ObjectHelper::check( + $field['settings'] + ) + && isset($field['settings']->properties) + && ArrayHelper::check( + $field['settings']->properties + )) + { + // search for own custom fields + if (strpos((string) $field['settings']->type_name, '@') !== false) + { + // set own custom field + $field['settings']->own_custom = $field['settings']->type_name; + $field['settings']->type_name = 'Custom'; + } + + // set the type name + $type_name = TypeHelper::safe( + $field['settings']->type_name + ); + + // if custom (we must use the xml value) + if (strtolower((string) $type_name) === 'custom' + || strtolower((string) $type_name) === 'customuser') + { + $type = TypeHelper::safe( + GetHelper::between( + $field['settings']->xml, 'type="', '"' + ) + ); + } + else + { + // loop over properties looking for the type value + foreach ($field['settings']->properties as $property) + { + if ($property['name'] + === 'type') // type field is never adjustable (unless custom) + { + // force the default value + if (isset($property['example']) + && StringHelper::check( + $property['example'] + )) + { + $type = TypeHelper::safe( + $property['example'] + ); + } + // fall back on the xml settings (not ideal) + else + { + $type = TypeHelper::safe( + GetHelper::between( + $field['settings']->xml, 'type="', '"' + ) + ); + } + // exit foreach loop + break; + } + } + } + // check if the value is set + if (isset($type) && StringHelper::check($type)) + { + return $type; + } + // fallback on type name set in name field (not ideal) + else + { + return $type_name; + } + } + + // fall back to text + return 'text'; + } + +} + diff --git a/src/eb33420d-359d-44a5-852e-613aef1feaae/settings.json b/src/eb33420d-359d-44a5-852e-613aef1feaae/settings.json new file mode 100644 index 0000000..0d95447 --- /dev/null +++ b/src/eb33420d-359d-44a5-852e-613aef1feaae/settings.json @@ -0,0 +1,37 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "eb33420d-359d-44a5-852e-613aef1feaae", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "TypeName", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Field.TypeName", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + }, + "use_selection3": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection4": { + "use": "a8935cbe-7701-40dc-bfd5-675f2d600954", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Field.TypeName", + "description": "Compiler Field Type Name\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ebe3287d-bfa0-4519-b663-f442f4dea432/README.md b/src/ebe3287d-bfa0-4519-b663-f442f4dea432/README.md new file mode 100644 index 0000000..ed43aa4 --- /dev/null +++ b/src/ebe3287d-bfa0-4519-b663-f442f4dea432/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Custombuttons (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Custombuttons #Gold { + # array $areas + # array $guiMapper + # Customcode $customcode + # Gui $gui + # Templatelayout $templateLayout + + __construct(?Customcode $customcode = null, ?Gui $gui = null, ...) + + set(object $item, string $table = 'admin_view') : void +} + +note right of Custombuttons::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Customcode $customcode = null + ?Gui $gui = null + ?Templatelayout $templateLayout = null +end note + +note right of Custombuttons::set + Set Custom Buttons and Model/Controllers + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ebe3287d-bfa0-4519-b663-f442f4dea432/code.php b/src/ebe3287d-bfa0-4519-b663-f442f4dea432/code.php new file mode 100644 index 0000000..48bd939 --- /dev/null +++ b/src/ebe3287d-bfa0-4519-b663-f442f4dea432/code.php @@ -0,0 +1,158 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as Templatelayout; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Custom Buttons Class + * + * @since 3.2.0 + */ +class Custombuttons +{ + /** + * The areas add array + * + * @var array + * @since 3.2.0 + */ + protected array $areas = [ + 'php_model', + 'php_controller', + 'php_model_list', + 'php_controller_list' + ]; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'admin_view', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Template Layout + * + * @var Templatelayout + * @since 3.2.0 + */ + protected Templatelayout $templateLayout; + + /** + * Constructor + * + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Templatelayout|null $templateLayout The compiler template layout object. + * + * @since 3.2.0 + */ + public function __construct(?Customcode $customcode = null, ?Gui $gui = null, + ?Templatelayout $templateLayout = null) + { + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->templateLayout = $templateLayout ?: Compiler::_('Templatelayout.Data'); + } + + /** + * Set Custom Buttons and Model/Controllers + * + * @param object $item The item data + * @param object $table The table + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item, string $table = 'admin_view') + { + if (isset($item->add_custom_button) + && $item->add_custom_button == 1) + { + // set some gui mapper values + $this->guiMapper['table'] = $table; + $this->guiMapper['id'] = (int) $item->id; + + // get the code + $code = $item->name_single_code ?? $item->code ?? 'error'; + + // set for the code + foreach ($this->areas as $area) + { + if (isset($item->{$area}) + && StringHelper::check( + $item->{$area} + )) + { + // set field + $this->guiMapper['field'] = $area; + $item->{$area} = $this->gui->set( + $this->customcode->update( + base64_decode((string) $item->{$area}) + ), + $this->guiMapper + ); + + // check if we have template or layouts to load + $this->templateLayout->set( + $item->{$area}, $code + ); + } + } + + // set the button array + $item->custom_button = (isset($item->custom_button) + && JsonHelper::check($item->custom_button)) + ? json_decode((string) $item->custom_button, true) : null; + + if (ArrayHelper::check($item->custom_button)) + { + $item->custom_buttons = array_values($item->custom_button); + } + + unset($item->custom_button); + } + } + +} + diff --git a/src/ebe3287d-bfa0-4519-b663-f442f4dea432/settings.json b/src/ebe3287d-bfa0-4519-b663-f442f4dea432/settings.json new file mode 100644 index 0000000..43bfee2 --- /dev/null +++ b/src/ebe3287d-bfa0-4519-b663-f442f4dea432/settings.json @@ -0,0 +1,45 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ebe3287d-bfa0-4519-b663-f442f4dea432", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Custombuttons", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Custombuttons", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection2": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection3": { + "use": "39ea8150-f124-4e47-909d-641bf1c96d5e", + "as": "Templatelayout" + }, + "use_selection4": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection5": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection6": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Custombuttons", + "description": "Model Custom Buttons Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md new file mode 100644 index 0000000..fdd497e --- /dev/null +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Extension (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Extension #Gold { + # $targetVersion + + register(Container $container) : void + + getJ3ExtensionInstallScript(Container $container) : J3InstallScript + + getExtensionInstallScript(Container $container) : GetScriptInterface +} + +note right of Extension::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Extension::getJ3ExtensionInstallScript + Get the Joomla 3 Extension Install Script + + since: 3.2.0 + return: J3InstallScript +end note + +note right of Extension::getExtensionInstallScript + Get the Joomla Extension Install Script + + since: 3.2.0 + return: GetScriptInterface +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php new file mode 100644 index 0000000..50d751b --- /dev/null +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/code.php @@ -0,0 +1,85 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript; + + +/** + * Extension Script Service Provider + * + * @since 3.2.0 + */ +class Extension implements ServiceProviderInterface +{ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(GetScriptInterface::class, 'Extension.InstallScript') + ->share('Extension.InstallScript', [$this, 'getExtensionInstallScript'], true); + + $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') + ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); + } + + /** + * Get the Joomla 3 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J3InstallScript + * @since 3.2.0 + */ + public function getJ3ExtensionInstallScript(Container $container): J3InstallScript + { + return new J3InstallScript(); + } + + /** + * Get the Joomla Extension Install Script + * + * @param Container $container The DI container. + * + * @return GetScriptInterface + * @since 3.2.0 + */ + public function getExtensionInstallScript(Container $container): GetScriptInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Extension.InstallScript'); + } + +} + diff --git a/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json new file mode 100644 index 0000000..8d9d912 --- /dev/null +++ b/src/ed9591cb-0a03-400a-bf47-eaf78ab19b9d/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "Registry", + "guid": "ed9591cb-0a03-400a-bf47-eaf78ab19b9d", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Extension", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Extension", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "2e6731ba-3a03-4836-b2c2-4e50e38cb890", + "as": "default" + }, + "use_selection1": { + "use": "1d929017-a5de-4e0f-9b5a-838934857e26", + "as": "J3InstallScript" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Extension", + "description": "Extension Script Service Provider\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/README.md b/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/README.md new file mode 100644 index 0000000..12a60fe --- /dev/null +++ b/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/README.md @@ -0,0 +1,67 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface DispenserInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode** +```uml +@startuml +interface DispenserInterface #Lavender { + + set(string $script, string $first, ...) : bool + + get(string $first, string $second, ...) : mixed +} + +note right of DispenserInterface::set + Set the script for the customcode dispenser +default: true +default: true +default: false + + since: 3.2.0 + return: bool + + arguments: + string $script + string $first + ?string $second = null + ?string $third = null + array $config = [] + bool $base64 = true + bool $dynamic = true + bool $add = false +end note + +note right of DispenserInterface::get + Get the script from the customcode dispenser + + since: 3.2.0 + return: mixed + + arguments: + string $first + string $second + string $prefix = '' + ?string $note = null + bool $unset = false + mixed|null $default = null + string $suffix = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/code.php b/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/code.php new file mode 100644 index 0000000..5336dda --- /dev/null +++ b/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/code.php @@ -0,0 +1,62 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; + + +/** + * Customcode Dispenser Interface + * + * @since 3.2.0 + */ +interface DispenserInterface +{ + /** + * Set the script for the customcode dispenser + * + * @param string $script The script + * @param string $first The first key + * @param string|null $second The second key (if not set we use only first key) + * @param string|null $third The third key (if not set we use only first and second key) + * @param array $config The config options + * @param bool $base64 The switch to decode base64 the script + * default: true + * @param bool $dynamic The switch to dynamic update the script + * default: true + * @param bool $add The switch to add to exiting instead of replace + * default: false + * + * @return bool true on success + * @since 3.2.0 + */ + public function set(&$script, string $first, ?string $second = null, ?string $third = null, + array $config = [], bool $base64 = true, bool $dynamic = true, bool $add = false): bool; + + /** + * Get the script from the customcode dispenser + * + * @param string $first The first key + * @param string $second The second key + * @param string $prefix The prefix to add in front of the script if found + * @param string|null $note The switch/note to add to the script + * @param bool $unset The switch to unset the value if found + * @param mixed|null $default The switch/string to use as default return if script not found + * @param string $suffix The suffix to add after the script if found + * + * @return mixed The string/script if found or the default value if not found + * + * @since 3.2.0 + */ + public function get(string $first, string $second, string $prefix = '', ?string $note = null, + bool $unset = false, $default = null, string $suffix = ''); + +} + diff --git a/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/settings.json b/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/settings.json new file mode 100644 index 0000000..2c7b80f --- /dev/null +++ b/src/ef687e42-dc25-4423-9dd4-ec6e9743cfb0/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ef687e42-dc25-4423-9dd4-ec6e9743cfb0", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "DispenserInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Customcode.DispenserInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Customcode.DispenserInterface", + "description": "Customcode Dispenser Interface\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md new file mode 100644 index 0000000..c404491 --- /dev/null +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/README.md @@ -0,0 +1,88 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Component** +```uml +@startuml +class Data #Gold { + # Config $config + # EventInterface $event + # Placeholder $placeholder + # ComponentPlaceholder $componentPlaceholder + # Dispenser $dispenser + # Customcode $customcode + # Gui $gui + # Field $field + # FieldName $fieldName + # UniqueName $uniqueName + # Filesfolders $filesFolders + # Historycomponent $history + # Whmcs $whmcs + # Sqltweaking $sqltweaking + # Adminviews $adminviews + # Siteviews $siteviews + # Customadminviews $customadminviews + # Updateserver $updateserver + # Joomlamodules $modules + # Joomlaplugins $plugins + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?EventInterface $event = null, ...) + + get() : ?object +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?EventInterface $event = null + ?Placeholder $placeholder = null + ?ComponentPlaceholder $componentPlaceholder = null + ?Dispenser $dispenser = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Field $field = null + ?FieldName $fieldName = null + ?UniqueName $uniqueName = null + ?Filesfolders $filesFolders = null + ?Historycomponent $history = null + ?Whmcs $whmcs = null + ?Sqltweaking $sqltweaking = null + ?Adminviews $adminviews = null + ?Siteviews $siteviews = null + ?Customadminviews $customadminviews = null + ?Updateserver $updateserver = null + ?Joomlamodules $modules = null + ?Joomlaplugins $plugins = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + get current component data + + since: 3.2.0 + return: ?object +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php new file mode 100644 index 0000000..e9aad59 --- /dev/null +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/code.php @@ -0,0 +1,877 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as ComponentPlaceholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Field as Field; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; +use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; +use VDM\Joomla\Componentbuilder\Compiler\Model\Historycomponent; +use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs; +use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking; +use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Siteviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Customadminviews; +use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; +use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlamodules; +use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlaplugins; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; + + +/** + * Compiler Component Data + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component Placeholder + * + * @var ComponentPlaceholder + * @since 3.2.0 + **/ + protected ComponentPlaceholder $componentPlaceholder; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Field + * + * @var Field + * @since 3.2.0 + */ + protected Field $field; + + /** + * Compiler field name + * + * @var FieldName + * @since 3.2.0 + */ + protected FieldName $fieldName; + + /** + * Compiler Field Unique Name + * + * @var UniqueName + * @since 3.2.0 + **/ + protected UniqueName $uniqueName; + + /** + * Compiler Files Folders + * + * @var Filesfolders + * @since 3.2.0 + */ + protected Filesfolders $filesFolders; + + /** + * The modelling component history + * + * @var Historycomponent + * @since 3.2.0 + */ + protected Historycomponent $history; + + /** + * The modelling whmcs + * + * @var Whmcs + * @since 3.2.0 + */ + protected Whmcs $whmcs; + + /** + * The modelling Sql Tweaking + * + * @var Sqltweaking + * @since 3.2.0 + */ + protected Sqltweaking $sqltweaking; + + /** + * The modelling Admin Views + * + * @var Adminviews + * @since 3.2.0 + */ + protected Adminviews $adminviews; + + /** + * The modelling Site Views + * + * @var Siteviews + * @since 3.2.0 + */ + protected Siteviews $siteviews; + + /** + * The modelling Custom Admin Views + * + * @var Customadminviews + * @since 3.2.0 + */ + protected Customadminviews $customadminviews; + + /** + * The modelling Update Server + * + * @var Updateserver + * @since 3.2.0 + */ + protected Updateserver $updateserver; + + /** + * The modelling Joomla Modules + * + * @var Joomlamodules + * @since 3.2.0 + */ + protected Joomlamodules $modules; + + /** + * The modelling Joomla Plugins + * + * @var Joomlaplugins + * @since 3.2.0 + */ + protected Joomlaplugins $plugins; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param ComponentPlaceholder|null $componentPlaceholder The compiler component placeholder object. + * @param Dispenser|null $dispenser The compiler customcode dispenser object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Field|null $field The compiler field object. + * @param FieldName|null $fieldName The compiler field name object. + * @param UniqueName|null $uniqueName The compiler field unique name object. + * @param Filesfolders|null $filesFolders The compiler files folders object. + * @param Historycomponent|null $history The modelling component history object. + * @param Whmcs|null $whmcs The modelling whmcs object. + * @param Sqltweaking|null $sqltweaking The modelling sql tweaking object. + * @param Adminviews|null $adminviews The modelling adminviews object. + * @param Siteviews|null $siteviews The modelling siteviews object. + * @param Customadminviews|null $customadminviews The modelling customadminviews object. + * @param Updateserver|null $updateserver The modelling update server object. + * @param Joomlamodules|null $modules The modelling modules object. + * @param Joomlaplugins|null $plugins The modelling plugins object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?EventInterface $event = null, + ?Placeholder $placeholder = null, ?ComponentPlaceholder $componentPlaceholder = null, + ?Dispenser $dispenser = null, ?Customcode $customcode = null, ?Gui $gui = null, + ?Field $field = null, ?FieldName $fieldName = null, ?UniqueName $uniqueName = null, + ?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null, + ?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null, + ?Customadminviews $customadminviews = null, ?Updateserver $updateserver = null, + ?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->componentPlaceholder = $componentPlaceholder ?: Compiler::_('Component.Placeholder'); + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->field = $field ?: Compiler::_('Field'); + $this->fieldName = $fieldName ?: Compiler::_('Field.Name'); + $this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name'); + $this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders'); + $this->history = $history ?: Compiler::_('Model.Historycomponent'); + $this->whmcs = $whmcs ?: Compiler::_('Model.Whmcs'); + $this->sqltweaking = $sqltweaking ?: Compiler::_('Model.Sqltweaking'); + $this->adminviews = $adminviews ?: Compiler::_('Model.Adminviews'); + $this->siteviews = $siteviews ?: Compiler::_('Model.Siteviews'); + $this->customadminviews = $customadminviews ?: Compiler::_('Model.Customadminviews'); + $this->updateserver = $updateserver ?: Compiler::_('Model.Updateserver'); + $this->modules = $modules ?: Compiler::_('Model.Joomlamodules'); + $this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * get current component data + * + * @return object|null The component data + * @since 3.2.0 + */ + public function get(): ?object + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // selection + $selection = array( + 'b.addadmin_views' => 'addadmin_views', + 'b.id' => 'addadmin_views_id', + 'h.addconfig' => 'addconfig', + 'd.addcustom_admin_views' => 'addcustom_admin_views', + 'g.addcustommenus' => 'addcustommenus', + 'j.addfiles' => 'addfiles', + 'j.addfolders' => 'addfolders', + 'j.addfilesfullpath' => 'addfilesfullpath', + 'j.addfoldersfullpath' => 'addfoldersfullpath', + 'c.addsite_views' => 'addsite_views', + 'l.addjoomla_plugins' => 'addjoomla_plugins', + 'k.addjoomla_modules' => 'addjoomla_modules', + 'i.dashboard_tab' => 'dashboard_tab', + 'i.php_dashboard_methods' => 'php_dashboard_methods', + 'i.params' => 'dashboard_params', + 'i.id' => 'component_dashboard_id', + 'f.sql_tweak' => 'sql_tweak', + 'e.version_update' => 'version_update', + 'e.id' => 'version_update_id' + ); + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array_keys($selection), array_values($selection) + ) + ); + + // from this table + $query->from('#__componentbuilder_joomla_component AS a'); + + // jointer-map + $joiners = array( + 'b' => 'component_admin_views', + 'c' => 'component_site_views', + 'd' => 'component_custom_admin_views', + 'e' => 'component_updates', + 'f' => 'component_mysql_tweaks', + 'g' => 'component_custom_admin_menus', + 'h' => 'component_config', + 'i' => 'component_dashboard', + 'j' => 'component_files_folders', + 'l' => 'component_plugins', + 'k' => 'component_modules' + ); + + // load the joins + foreach ($joiners as $as => $join) + { + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_' . $join, $as) + . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName($as . '.joomla_component') . ')' + ); + } + $query->where( + $this->db->quoteName('a.id') . ' = ' . (int) $this->config->component_id + ); + + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + $component_id = $this->config->component_id; + + // Trigger Event: jcb_ce_onBeforeQueryComponentData + $this->event->trigger( + 'jcb_ce_onBeforeQueryComponentData', + array(&$component_context, &$component_id, &$query, + &$this->db) + ); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + + // Load the results as a list of stdClass objects + $component = $this->db->loadObject(); + + // make sure we got a component loaded + if (!is_object($component) || !isset($component->system_name)) + { + return null; + } + + // Trigger Event: jcb_ce_onBeforeModelComponentData + $this->event->trigger( + 'jcb_ce_onBeforeModelComponentData', + array(&$component_context, &$component) + ); + + // load the global placeholders + $this->placeholder->active = $this->componentPlaceholder->get(); + + // set component sales name + $component->sales_name = StringHelper::safe( + $component->system_name + ); + + // set the component name_code + $component->name_code = StringHelper::safe( + $component->name_code + ); + + // ensure version naming is correct + $this->config->set('component_version', preg_replace( + '/[^0-9.]+/', '', (string) $component->component_version + ) + ); + + // set the website and autor for global use (default to VDM if not found) + $this->config->set('project_website', $component->website ?? 'https://dev.vdm.io'); + $this->config->set('project_author', $component->author ?? 'VDM'); + + // set the files and folders + $this->filesFolders->set($component); + + // set the uikit switch + $this->config->set('uikit', $component->adduikit); + + // set whmcs links if needed + $this->whmcs->set($component); + + // set the footable switch + if ($component->addfootable > 0) + { + // force add footable + $this->config->set('footable', true); + // add the version + $this->config->set('footable_version', (3 == $component->addfootable) ? 3 : 2); + } + + // set the addcustommenus data + $component->addcustommenus = (isset($component->addcustommenus) + && JsonHelper::check($component->addcustommenus)) + ? json_decode((string) $component->addcustommenus, true) : null; + if (ArrayHelper::check($component->addcustommenus)) + { + $component->custommenus = array_values($component->addcustommenus); + } + unset($component->addcustommenus); + + // set the sql tweak data + $this->sqltweaking->set($component); + + // set the admin view data + $this->adminviews->set($component); + + // set the site view data + $this->siteviews->set($component); + + // set the custom_admin_views data + $this->customadminviews->set($component); + + // set the config data + $component->addconfig = (isset($component->addconfig) + && JsonHelper::check($component->addconfig)) + ? json_decode((string) $component->addconfig, true) : null; + if (ArrayHelper::check($component->addconfig)) + { + $component->config = array_map( + function ($field) { + // make sure the alias and title is 0 + $field['alias'] = 0; + $field['title'] = 0; + // set the field details + $this->field->set($field); + // set unique name counter + $this->uniqueName->set($field['base_name'], 'configs'); + + // return field + return $field; + }, array_values($component->addconfig) + ); + + // do some house cleaning (for fields) + foreach ($component->config as $field) + { + // so first we lock the field name in + $this->fieldName->get($field, 'configs'); + } + // unset original value + unset($component->addconfig); + } + + // set the add contributors + $component->addcontributors = (isset($component->addcontributors) + && JsonHelper::check($component->addcontributors)) + ? json_decode((string) $component->addcontributors, true) : null; + if (ArrayHelper::check($component->addcontributors)) + { + $this->config->set('add_contributors', true); + $component->contributors = array_values( + $component->addcontributors + ); + } + unset($component->addcontributors); + + // set the version updates + $this->updateserver->set($component); + + // build the build date + if ($this->config->get('add_build_date', 1) == 3) + { + if (empty($this->component->modified) || + $this->component->modified == '0000-00-00' || + $this->component->modified == '0000-00-00 00:00:00') + { + $this->config->set('build_date', $this->component->created); + } + else + { + $this->config->set('build_date', $this->component->modified); + } + } + + // build update SQL + $this->history->set($component); + + // set GUI mapper + $guiMapper = [ + 'table' => 'joomla_component', + 'id' => (int) $this->config->component_id, + 'field' => 'javascript', + 'type' => 'js' + ]; + + // add_javascript + if ($component->add_javascript == 1) + { + $this->dispenser->set( + $component->javascript, + 'component_js', + null, + null, + $guiMapper + ); + } + else + { + $this->dispenser->hub['component_js'] = ''; + } + unset($component->javascript); + + // add global CSS + $addGlobalCss = ['admin', 'site']; + foreach ($addGlobalCss as $area) + { + // add_css if found + if (isset($component->{'add_css_' . $area}) + && $component->{'add_css_' . $area} == 1 + && isset($component->{'css_' . $area}) + && StringHelper::check( + $component->{'css_' . $area} + )) + { + $this->dispenser->set( + $component->{'css_' . $area}, + 'component_css_' . $area + ); + } + else + { + $this->dispenser->hub['component_css_' . $area] = ''; + } + unset($component->{'css_' . $area}); + } + + // set the lang target + $this->config->lang_target = 'admin'; + + // add PHP in ADMIN + $addScriptMethods = [ + 'php_preflight', + 'php_postflight', + 'php_method' + ]; + $addScriptTypes = [ + 'install', + 'update', + 'uninstall' + ]; + // update GUI mapper + $guiMapper['type'] = 'php'; + foreach ($addScriptMethods as $scriptMethod) + { + foreach ($addScriptTypes as $scriptType) + { + if (isset($component->{'add_' . $scriptMethod . '_' . $scriptType}) + && $component->{'add_' . $scriptMethod . '_' . $scriptType} == 1 + && StringHelper::check( + $component->{$scriptMethod . '_' . $scriptType} + )) + { + // set GUI mapper field + $guiMapper['field'] = $scriptMethod . '_' . $scriptType; + $this->dispenser->set( + $component->{$scriptMethod . '_' . $scriptType}, + $scriptMethod, + $scriptType, + null, + $guiMapper + ); + } + else + { + $this->dispenser->hub[$scriptMethod][$scriptType] = ''; + } + unset($component->{$scriptMethod . '_' . $scriptType}); + } + } + + // add_php_helper + if ($component->add_php_helper_admin == 1 + && StringHelper::check( + $component->php_helper_admin + )) + { + $this->config->lang_target = 'admin'; + // update GUI mapper + $guiMapper['field'] = 'php_helper_admin'; + $guiMapper['prefix'] = PHP_EOL . PHP_EOL; + $this->dispenser->set( + $component->php_helper_admin, + 'component_php_helper_admin', + null, + null, + $guiMapper + ); + unset($guiMapper['prefix']); + } + else + { + $this->dispenser->hub['component_php_helper_admin'] = ''; + } + unset($component->php_helper); + + // add_admin_event + if ($component->add_admin_event == 1 + && StringHelper::check($component->php_admin_event)) + { + $this->config->lang_target = 'admin'; + // update GUI mapper field + $guiMapper['field'] = 'php_admin_event'; + $this->dispenser->set( + $component->php_admin_event, + 'component_php_admin_event', + null, + null, + $guiMapper + ); + } + else + { + $this->dispenser->hub['component_php_admin_event'] = ''; + } + unset($component->php_admin_event); + + // add_php_helper_both + if ($component->add_php_helper_both == 1 + && StringHelper::check($component->php_helper_both)) + { + $this->config->lang_target = 'both'; + // update GUI mapper field + $guiMapper['field'] = 'php_helper_both'; + $guiMapper['prefix'] = PHP_EOL . PHP_EOL; + $this->dispenser->set( + $component->php_helper_both, + 'component_php_helper_both', + null, + null, + $guiMapper + ); + unset($guiMapper['prefix']); + } + else + { + $this->dispenser->hub['component_php_helper_both'] = ''; + } + + // add_php_helper_site + if ($component->add_php_helper_site == 1 + && StringHelper::check($component->php_helper_site)) + { + $this->config->lang_target = 'site'; + // update GUI mapper field + $guiMapper['field'] = 'php_helper_site'; + $guiMapper['prefix'] = PHP_EOL . PHP_EOL; + $this->dispenser->set( + $component->php_helper_site, + 'component_php_helper_site', + null, + null, + $guiMapper + ); + unset($guiMapper['prefix']); + } + else + { + $this->dispenser->hub['component_php_helper_site'] = ''; + } + unset($component->php_helper); + + // add_site_event + if ($component->add_site_event == 1 + && StringHelper::check($component->php_site_event)) + { + $this->config->lang_target = 'site'; + // update GUI mapper field + $guiMapper['field'] = 'php_site_event'; + $this->dispenser->set( + $component->php_site_event, + 'component_php_site_event', + null, + null, + $guiMapper + ); + } + else + { + $this->dispenser->hub['component_php_site_event'] = ''; + } + unset($component->php_site_event); + + // add_sql + if ($component->add_sql == 1) + { + $this->dispenser->set( + $component->sql, + 'sql', + 'component_sql' + ); + } + unset($component->sql); + + // add_sql_uninstall + if ($component->add_sql_uninstall == 1) + { + $this->dispenser->set( + $component->sql_uninstall, + 'sql_uninstall' + ); + } + unset($component->sql_uninstall); + + // bom + if (StringHelper::check($component->bom)) + { + $this->config->set('bom_path', + $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom + ); + } + unset($component->bom); + + // README + $component->readme = + $component->addreadme ? + $this->customcode->update( + base64_decode((string) $component->readme) + ) : ''; + + // set lang now + $nowLang = $this->config->lang_target; + $this->config->lang_target = 'admin'; + + // dashboard methods + $component->dashboard_tab = (isset($component->dashboard_tab) + && JsonHelper::check($component->dashboard_tab)) + ? json_decode((string) $component->dashboard_tab, true) : null; + if (ArrayHelper::check($component->dashboard_tab)) + { + $component->dashboard_tab = array_map( + function ($array) { + $array['html'] = $this->customcode->update($array['html']); + + return $array; + }, array_values($component->dashboard_tab) + ); + } + else + { + $component->dashboard_tab = ''; + } + + // add the php of the dashboard if set + if (isset($component->php_dashboard_methods) + && StringHelper::check( + $component->php_dashboard_methods + )) + { + // load the php for the dashboard model + $component->php_dashboard_methods = $this->gui->set( + $this->customcode->update( + base64_decode((string) $component->php_dashboard_methods) + ), + [ + 'table' => 'component_dashboard', + 'field' => 'php_dashboard_methods', + 'id' => (int) $component->component_dashboard_id, + 'type' => 'php' + ] + ); + } + else + { + $component->php_dashboard_methods = ''; + } + + // reset back to now lang + $this->config->lang_target = $nowLang; + + // catch empty URL to update server TODO: we need to fix this in better way later + if (empty($component->add_update_server) || ($component->add_update_server == 1 && $component->update_server_target != 3 + && ( + !StringHelper::check($component->update_server_url) + || strpos($component->update_server_url, 'http') === false + ))) + { + // we fall back to other, since we can't work with an empty update server URL + $component->add_update_server = 0; + $component->update_server_target = 3; + $component->update_server_url = ''; + } + + // add the update/sales server FTP details if that is the expected protocol + $serverArray = array('update_server', 'sales_server'); + foreach ($serverArray as $server) + { + if ($component->{'add_' . $server} == 1 + && is_numeric($component->{$server}) + && $component->{$server} > 0) + { + // get the server protocol + $component->{$server . '_protocol'} + = GetHelper::var( + 'server', (int) $component->{$server}, 'id', 'protocol' + ); + } + else + { + $component->{$server} = 0; + // only change this for sales server (update server can be added loacaly to the zip file) + if ('sales_server' === $server) + { + $component->{'add_' . $server} = 0; + } + $component->{$server . '_protocol'} = 0; + } + } + + // set the ignore folders for repo if found + if (isset($component->toignore) + && StringHelper::check( + $component->toignore + )) + { + if (strpos((string) $component->toignore, ',') !== false) + { + $component->toignore = array_map( + 'trim', (array) explode(',', (string) $component->toignore) + ); + } + else + { + $component->toignore = array(trim((string) $component->toignore)); + } + } + else + { + // the default is to ignore the repo folder + $component->toignore = array('.git'); + } + + // set all modules + $this->modules->set($component); + + // set all plugins + $this->plugins->set($component); + + // Trigger Event: jcb_ce_onAfterModelComponentData + $this->event->trigger( + 'jcb_ce_onAfterModelComponentData', + array(&$component_context, &$component) + ); + + // return found component data + return $component; + } + +} + diff --git a/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json new file mode 100644 index 0000000..ef4a664 --- /dev/null +++ b/src/ef9578e5-4c9d-46bf-866f-3a94bdc7b753/settings.json @@ -0,0 +1,118 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "ef9578e5-4c9d-46bf-866f-3a94bdc7b753", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Component.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "as": "default" + }, + "use_selection3": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection4": { + "use": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", + "as": "ComponentPlaceholder" + }, + "use_selection5": { + "use": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "as": "default" + }, + "use_selection6": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection7": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection8": { + "use": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "as": "Field" + }, + "use_selection9": { + "use": "9387215f-a965-4421-acf3-5e8f9d11382f", + "as": "FieldName" + }, + "use_selection10": { + "use": "8c018533-e967-4bf2-9bd9-9e92966fcb5e", + "as": "default" + }, + "use_selection11": { + "use": "f4578c04-a81e-4218-b80d-b0612196eaf0", + "as": "default" + }, + "use_selection12": { + "use": "17a728e9-d6cf-4060-9efb-241b0ff2f981", + "as": "default" + }, + "use_selection13": { + "use": "af5beb21-214a-44f6-9090-7ea24c22e649", + "as": "default" + }, + "use_selection14": { + "use": "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26", + "as": "default" + }, + "use_selection15": { + "use": "cebdcccb-24c5-46db-92de-63453852dcb8", + "as": "default" + }, + "use_selection16": { + "use": "e0075978-315d-4807-8507-ce9c6922a885", + "as": "default" + }, + "use_selection17": { + "use": "e0e24173-a808-4dd5-8e26-de971d014f86", + "as": "default" + }, + "use_selection18": { + "use": "1d0fd857-12ec-4f47-ab1c-124d85748e24", + "as": "default" + }, + "use_selection19": { + "use": "bfdc4ce5-cb12-4fc6-9023-51cede25edd0", + "as": "default" + }, + "use_selection20": { + "use": "ef97b03e-1018-447a-8d7e-30401b0257bb", + "as": "default" + }, + "use_selection21": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection22": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection23": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection24": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Component.Data", + "description": "Compiler Component Data\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/ef97b03e-1018-447a-8d7e-30401b0257bb/README.md b/src/ef97b03e-1018-447a-8d7e-30401b0257bb/README.md new file mode 100644 index 0000000..230ab6e --- /dev/null +++ b/src/ef97b03e-1018-447a-8d7e-30401b0257bb/README.md @@ -0,0 +1,45 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Joomlaplugins (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Joomlaplugins #Gold { + # Plugin $plugin + + __construct(?Plugin $plugin = null) + + set(object $item) : void +} + +note right of Joomlaplugins::__construct + Constructor + + since: 3.2.0 +end note + +note right of Joomlaplugins::set + Set Joomla Plugins + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ef97b03e-1018-447a-8d7e-30401b0257bb/code.php b/src/ef97b03e-1018-447a-8d7e-30401b0257bb/code.php new file mode 100644 index 0000000..5362e49 --- /dev/null +++ b/src/ef97b03e-1018-447a-8d7e-30401b0257bb/code.php @@ -0,0 +1,84 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Data as Plugin; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\JsonHelper; + + +/** + * Model Joomla Plugins Class + * + * @since 3.2.0 + */ +class Joomlaplugins +{ + /** + * Compiler Joomla Plugin Data Class + * + * @var Plugin + * @since 3.2.0 + */ + protected Plugin $plugin; + + /** + * Constructor + * + * @param Plugin|null $plugin The compiler Joomla plugin data object. + * + * @since 3.2.0 + */ + public function __construct(?Plugin $plugin = null) + { + $this->plugin = $plugin ?: Compiler::_('Joomlaplugin.Data'); + } + + /** + * Set Joomla Plugins + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + // get all plugins + $item->addjoomla_plugins = (isset($item->addjoomla_plugins) + && JsonHelper::check($item->addjoomla_plugins)) + ? json_decode((string) $item->addjoomla_plugins, true) : null; + + if (ArrayHelper::check($item->addjoomla_plugins)) + { + $joomla_plugins = array_map( + function ($array) use (&$item) { + // only load the plugins whose target association calls for it + if (!isset($array['target']) || $array['target'] != 2) + { + return $this->plugin->set( + $array['plugin'], $item + ); + } + + return null; + }, array_values($item->addjoomla_plugins) + ); + } + + unset($item->addjoomla_plugins); + } + +} + diff --git a/src/ef97b03e-1018-447a-8d7e-30401b0257bb/settings.json b/src/ef97b03e-1018-447a-8d7e-30401b0257bb/settings.json new file mode 100644 index 0000000..bc2b2b3 --- /dev/null +++ b/src/ef97b03e-1018-447a-8d7e-30401b0257bb/settings.json @@ -0,0 +1,33 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ef97b03e-1018-447a-8d7e-30401b0257bb", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Joomlaplugins", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Joomlaplugins", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "766a9524-37df-4604-91a7-b98a6150ee26", + "as": "Plugin" + }, + "use_selection2": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection3": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Joomlaplugins", + "description": "Model Joomla Plugins Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/README.md b/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/README.md new file mode 100644 index 0000000..a61f66f --- /dev/null +++ b/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/README.md @@ -0,0 +1,46 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Readme (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power\Repo** +```uml +@startuml +class Readme #Gold { + # Power $power + # Plantuml $plantuml + + __construct(?Power $power = null, ?Plantuml $plantuml = null) + + get(object $power) : string +} + +note right of Readme::__construct + Constructor. + + since: 3.2.0 +end note + +note right of Readme::get + Get a Power Readme + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/code.php b/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/code.php new file mode 100644 index 0000000..c3eb0e1 --- /dev/null +++ b/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/code.php @@ -0,0 +1,104 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power\Repo; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Power; +use VDM\Joomla\Componentbuilder\Compiler\Power\Plantuml; + + +/** + * Compiler Power Repo Readme + * @since 3.2.0 + */ +class Readme +{ + /** + * Power Objects + * + * @var Power + * @since 3.2.0 + **/ + protected Power $power; + + /** + * Compiler Powers Plantuml Builder + * + * @var Plantuml + * @since 3.2.0 + **/ + protected Plantuml $plantuml; + + /** + * Constructor. + * + * @param Power|null $power The power object. + * @param Plantuml|null $plantuml The powers plantuml builder object. + * + * @since 3.2.0 + */ + public function __construct(?Power $power = null, ?Plantuml $plantuml = null) + { + $this->power = $power ?: Compiler::_('Power'); + $this->plantuml = $plantuml ?: Compiler::_('Power.Plantuml'); + } + + /** + * Get a Power Readme + * + * @param object $power A power details. + * + * @return string + * @since 3.2.0 + */ + public function get(object $power): string + { + // build readme + $readme = ["``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +```"]; + // add the class diagram + if (isset($power->parsed_class_code) && is_array($power->parsed_class_code)) + { + $readme[] = "# " . $power->type . " " . $power->code_name . " (Details)"; + $readme[] = "> namespace: **" . $power->_namespace . "**"; + $readme[] = "```uml\n@startuml" . $this->plantuml->classDetailedDiagram( + ['name' => $power->code_name, 'type' => $power->type], + $power->parsed_class_code + ) . " \n@enduml\n```"; + } + else + { + $readme[] = "> Error adding class diagram"; + } + + // yes you can remove this, but why? + $readme[] = "\n---\n``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +```\n> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)\n\n"; + + return implode("\n", $readme); + } + +} + diff --git a/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/settings.json b/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/settings.json new file mode 100644 index 0000000..3b63ee0 --- /dev/null +++ b/src/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Readme", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Repo.Readme", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "as": "default" + }, + "use_selection2": { + "use": "ff5e9e63-86d0-4691-ab59-d4b9d9154096", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Repo.Readme", + "description": "Compiler Power Repo Readme\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/README.md b/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/README.md new file mode 100644 index 0000000..ae40282 --- /dev/null +++ b/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/README.md @@ -0,0 +1,44 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Unique (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Utilities** +```uml +@startuml +abstract Unique #Orange { + + {static} get(int $size) : string + + {static} code(string $code, string $target = 'both') : string +} + +note right of Unique::get + Creating an unique local key + + return: string +end note + +note right of Unique::code + Creating an Unique Code + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/code.php b/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/code.php new file mode 100644 index 0000000..b92611a --- /dev/null +++ b/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/code.php @@ -0,0 +1,93 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +/** + * Compiler Creating an Unique Code/String + * + * @since 3.2.0 + */ +abstract class Unique +{ + /** + * Unique Code/Strings + * + * @var array + * @since 3.2.0 + */ + protected static array $unique = []; + + /** + * Unique Areas Code/Strings + * + * @var array + * @since 3.2.0 + */ + protected static array $areas = []; + + /** + * Creating an unique local key + * + * @param int $size The key size + * + * @return string The unique local key + * + */ + public static function get($size): string + { + $unique = (isset(self::$unique[$size])) ? end(self::$unique[$size]) : null; + + if(!$unique) + { + $unique = substr("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv", 0, $size); + + self::$unique[$size] = []; + } + + while(in_array($unique, self::$unique[$size])) + { + $unique++; + } + + self::$unique[$size][] = $unique; + + return $unique; + } + + /** + * Creating an Unique Code + * + * @param string $code + * @param string $target + * + * @return string + * @since 3.2.0 + */ + public static function code(string $code, string $target = 'both'): string + { + if (!isset(self::$areas[$target]) + || !in_array( + $code, self::$areas[$target] + )) + { + self::$areas[$target][] = $code; + + return $code; + } + + // make sure it is unique + return self::code($code . self::get(1)); + } + +} + diff --git a/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/settings.json b/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/settings.json new file mode 100644 index 0000000..24628a6 --- /dev/null +++ b/src/f02fb1df-f4b6-4be1-9595-2e72084a5e6e/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "f02fb1df-f4b6-4be1-9595-2e72084a5e6e", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Unique", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Utilities.Unique", + "type": "abstract class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Utilities.Unique", + "description": "Compiler Creating an Unique Code\/String\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md new file mode 100644 index 0000000..9dc1ac6 --- /dev/null +++ b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/README.md @@ -0,0 +1,73 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Data (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Alias** +```uml +@startuml +class Data #Gold { + # Config $config + # Registry $registry + # Customcode $customcode + # Gui $gui + # Loader $loader + # Libraries $libraries + # \JDatabaseDriver $db + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + get(string $alias, string $table, ...) : ?array + # set(string $table) : void +} + +note right of Data::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Loader $loader = null + ?Libraries $libraries = null + ?\JDatabaseDriver $db = null +end note + +note right of Data::get + Get Data by Alias + + since: 3.2.0 + return: ?array + + arguments: + string $alias + string $table + string $view +end note + +note right of Data::set + Load all alias and ID's of a table + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php new file mode 100644 index 0000000..42bf0d3 --- /dev/null +++ b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/code.php @@ -0,0 +1,265 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Alias; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Model\Loader; +use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Alias Data Class + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Auto Loader + * + * @var Loader + * @since 3.2.0 + */ + protected Loader $loader; + + /** + * Compiler Libraries Model + * + * @var Libraries + * @since 3.2.0 + */ + protected Libraries $libraries; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui. + * @param Loader|null $load The compiler loader object. + * @param Libraries|null $libraries The compiler libraries model object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Customcode $customcode = null, ?Gui $gui = null, + ?Loader $loader = null, ?Libraries $libraries = null, + ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->loader = $loader ?: Compiler::_('Model.Loader'); + $this->libraries = $libraries ?: Compiler::_('Model.Libraries'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get Data by Alias + * + * @param string $alias The alias name + * @param string $table The table where to find the alias + * @param string $view The view code name + * + * @return array|null The data found with the alias + * @since 3.2.0 + */ + public function get(string $alias, string $table, string $view): ?array + { + // if not set, get all keys in table and set by ID + $this->set($table); + + // now check if key is found + $name = preg_replace("/[^A-Za-z]/", '', $alias); + + if (($id = $this->registry->get('builder.data_with_alias_keys.' . $table . '.' . $name, null)) === null && + ($id = $this->registry->get('builder.data_with_alias_keys.' . $table . '.' . $alias, null)) === null) + { + return null; + } + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->select('a.*'); + $query->from('#__componentbuilder_' . $table . ' AS a'); + $query->where( + $this->db->quoteName('a.id') . ' = ' . (int) $id + ); + + // get the row + $this->db->setQuery($query); + $item = $this->db->loadObject(); + + // get the other target if both + $targets = [$this->config->build_target]; + + if ($this->config->lang_target === 'both') + { + $targets = ['site', 'admin']; + } + + // we load this layout + $php_view = ''; + if ($item->add_php_view == 1 + && StringHelper::check($item->php_view)) + { + $php_view = $this->gui->set( + $this->customcode->update(base64_decode((string) $item->php_view)), + array( + 'table' => $table, + 'field' => 'php_view', + 'id' => (int) $item->id, + 'type' => 'php') + ); + } + + $content = $this->gui->set( + $this->customcode->update(base64_decode((string) $item->{$table})), + array( + 'table' => $table, + 'field' => $table, + 'id' => (int) $item->id, + 'type' => 'html') + ); + + // load all targets + foreach ($targets as $target) + { + // set libraries + $this->libraries->set($view, $item, $target); + + // auto loaders + $this->loader->set($view, $content, $target); + $this->loader->set($view, $php_view, $target); + } + + // load uikit version 2 if required + $this->loader->uikit($view, $content); + $this->loader->uikit($view, $php_view); + + return [ + 'id' => $item->id, + 'html' => $this->gui->set( + $content, + [ + 'table' => $table, + 'field' => $table, + 'id' => $item->id, + 'type' => 'html' + ] + ), + 'php_view' => $this->gui->set( + $php_view, + [ + 'table' => $table, + 'field' => 'php_view', + 'id' => $item->id, + 'type' => 'php' + ] + ) + ]; + } + + /** + * Load all alias and ID's of a table + * + * @param string $table The table where to find the alias + * + * @return void + * @since 3.2.0 + */ + protected function set(string $table) + { + // now check if key is found + if (!$this->registry->get('builder.data_with_alias_keys.' . $table, null)) + { + // Create a new query object. + $query = $this->db->getQuery(true); + $query->select(array('a.id', 'a.alias')); + $query->from('#__componentbuilder_' . $table . ' AS a'); + $this->db->setQuery($query); + $items = $this->db->loadObjectList(); + + // check if we have an array + if (ArrayHelper::check($items)) + { + foreach ($items as $item) + { + // build the key + $k_ey = StringHelper::safe($item->alias); + $key = preg_replace("/[^A-Za-z]/", '', (string) $k_ey); + + // set the keys + $this->registry-> + set('builder.data_with_alias_keys.' . $table . '.' . $item->alias, $item->id); + $this->registry-> + set('builder.data_with_alias_keys.' . $table . '.' . $k_ey, $item->id); + $this->registry-> + set('builder.data_with_alias_keys.' . $table . '.' . $key, $item->id); + } + } + } + } + +} + diff --git a/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/settings.json b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/settings.json new file mode 100644 index 0000000..5f1aa7c --- /dev/null +++ b/src/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c/settings.json @@ -0,0 +1,54 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Data", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Alias.Data", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection4": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection5": { + "use": "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7", + "as": "default" + }, + "use_selection6": { + "use": "59895f37-50c8-4af3-9dad-230e18841953", + "as": "default" + }, + "use_selection7": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection8": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Alias.Data", + "description": "Alias Data Class\r\n\r\n@since 3.2.0", + "head": "use Joomla\\CMS\\Factory;" +} \ No newline at end of file diff --git a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/README.md b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/README.md new file mode 100644 index 0000000..7c247b7 --- /dev/null +++ b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/README.md @@ -0,0 +1,87 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Dispenser (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Customcode** +```uml +@startuml +class Dispenser #Gold { + + array $hub + # Placeholder $placeholder + # Customcode $customcode + # Gui $gui + # Hash $hash + # LockBase $base64 + + __construct(?Placeholder $placeholder = null, ?Customcode $customcode = null, ...) + + set(string $script, string $first, ...) : bool + + get(string $first, string $second, ...) : mixed +} + +note right of Dispenser::__construct + Constructor. + + since: 3.2.0 + + arguments: + ?Placeholder $placeholder = null + ?Customcode $customcode = null + ?Gui $gui = null + ?Hash $hash = null + ?LockBase $base64 = null +end note + +note right of Dispenser::set + Set the script for the customcode dispenser +default: true +default: true +default: false + + since: 3.2.0 + return: bool + + arguments: + string $script + string $first + ?string $second = null + ?string $third = null + array $config = [] + bool $base64 = true + bool $dynamic = true + bool $add = false +end note + +note right of Dispenser::get + Get the script from the customcode dispenser + + since: 3.2.0 + return: mixed + + arguments: + string $first + string $second + string $prefix = '' + ?string $note = null + bool $unset = false + mixed|null $default = null + string $suffix = '' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php new file mode 100644 index 0000000..26c4176 --- /dev/null +++ b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/code.php @@ -0,0 +1,284 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\LockBase; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\DispenserInterface; + + +/** + * Compiler Custom Code Dispenser + * + * @since 3.2.0 + */ +class Dispenser implements DispenserInterface +{ + /** + * Customcode Dispenser Hub + * + * @var array + * @since 3.2.0 + **/ + public array $hub; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Customcode to Hash + * + * @var Hash + * @since 3.2.0 + **/ + protected Hash $hash; + + /** + * Compiler Customcode to LockBase + * + * @var LockBase + * @since 3.2.0 + **/ + protected LockBase $base64; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui object. + * @param Hash|null $hash The compiler customcode hash object. + * @param LockBase|null $base64 The compiler customcode lock base64 object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, ?Customcode $customcode = null, + ?Gui $gui = null, ?Hash $hash = null, ?LockBase $base64 = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->hash = $hash ?: Compiler::_('Customcode.Hash'); + $this->base64 = $base64 ?: Compiler::_('Customcode.LockBase'); + } + + /** + * Set the script for the customcode dispenser + * + * @param string $script The script + * @param string $first The first key + * @param string|null $second The second key (if not set we use only first key) + * @param string|null $third The third key (if not set we use only first and second key) + * @param array $config The config options + * @param bool $base64 The switch to decode base64 the script + * default: true + * @param bool $dynamic The switch to dynamic update the script + * default: true + * @param bool $add The switch to add to exiting instead of replace + * default: false + * + * @return bool true on success + * @since 3.2.0 + */ + public function set(&$script, string $first, ?string $second = null, ?string $third = null, + array $config = [], bool $base64 = true, bool $dynamic = true, bool $add = false): bool + { + // only load if we have a string + if (!StringHelper::check($script)) + { + return false; + } + // this needs refactoring (TODO) + if (!isset($this->hub[$first]) + || ($second + && !isset($this->hub[$first][$second]))) + { + // check if the script first key is set + if ($second && !isset($this->hub[$first])) + { + $this->hub[$first] = []; + } + elseif ($add && !$second + && !isset($this->hub[$first])) + { + $this->hub[$first] = ''; + } + // check if the script second key is set + if ($second && $third + && !isset($this->hub[$first][$second])) + { + $this->hub[$first][$second] = []; + } + elseif ($add && $second && !$third + && !isset($this->hub[$first][$second])) + { + $this->hub[$first][$second] = ''; + } + // check if the script third key is set + if ($add && $second && $third + && !isset($this->hub[$first][$second][$third])) + { + $this->hub[$first][$second][$third] = ''; + } + } + // prep the script string + if ($base64 && $dynamic) + { + $script = $this->customcode->update(base64_decode($script)); + } + elseif ($base64) + { + $script = base64_decode($script); + } + elseif ($dynamic) // this does not happen (just incase) + { + $script = $this->customcode->update($script); + } + // check if we still have a string + if (StringHelper::check($script)) + { + // now load the placeholder snippet if needed + if ($base64 || $dynamic) + { + $script = $this->gui->set($script, $config); + } + // add Dynamic HASHING option of a file/string + $script = $this->hash->set($script); + // add base64 locking option of a string + $script = $this->base64->set($script); + // load the script + if ($first && $second && $third) + { + // now act on loading option + if ($add) + { + $this->hub[$first][$second][$third] + .= $script; + } + else + { + $this->hub[$first][$second][$third] + = $script; + } + } + elseif ($first && $second) + { + // now act on loading option + if ($add) + { + $this->hub[$first][$second] .= $script; + } + else + { + $this->hub[$first][$second] = $script; + } + } + else + { + // now act on loading option + if ($add) + { + $this->hub[$first] .= $script; + } + else + { + $this->hub[$first] = $script; + } + } + + return true; + } + + return false; + } + + /** + * Get the script from the customcode dispenser + * + * @param string $first The first key + * @param string $second The second key + * @param string $prefix The prefix to add in front of the script if found + * @param string|null $note The switch/note to add to the script + * @param bool $unset The switch to unset the value if found + * @param mixed|null $default The switch/string to use as default return if script not found + * @param string $suffix The suffix to add after the script if found + * + * @return mixed The string/script if found or the default value if not found + * + * @since 3.2.0 + */ + public function get(string $first, string $second, string $prefix = '', ?string $note = null, + bool $unset = false, $default = null, string $suffix = '') + { + // default is to return an empty string + $script = ''; + // check if there is any custom script + if (isset($this->hub[$first][$second]) + && StringHelper::check( + $this->hub[$first][$second] + )) + { + // add not if set + if ($note) + { + $script .= $note; + } + // load the actual script + $script .= $prefix . str_replace( + array_keys($this->placeholder->active), + array_values($this->placeholder->active), + (string) $this->hub[$first][$second] + ) . $suffix; + // clear some memory + if ($unset) + { + unset($this->hub[$first][$second]); + } + } + // if not found return default + if (!StringHelper::check($script) && $default) + { + return $default; + } + + return $script; + } + +} + diff --git a/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/settings.json b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/settings.json new file mode 100644 index 0000000..28d83eb --- /dev/null +++ b/src/f1dc6430-fb54-452e-aa53-ce32ae93db88/settings.json @@ -0,0 +1,47 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "f1dc6430-fb54-452e-aa53-ce32ae93db88", + "implements": [ + "ef687e42-dc25-4423-9dd4-ec6e9743cfb0" + ], + "implements_custom": "", + "load_selection": null, + "name": "Dispenser", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Customcode.Dispenser", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection1": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection2": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection3": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection4": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection5": { + "use": "797579e8-b272-41ed-91de-428cb0b3e089", + "as": "default" + }, + "use_selection6": { + "use": "7c07c9d6-34cd-4491-934a-ef0a83f414c0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Customcode.Dispenser", + "description": "Compiler Custom Code Dispenser\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/f4578c04-a81e-4218-b80d-b0612196eaf0/README.md b/src/f4578c04-a81e-4218-b80d-b0612196eaf0/README.md new file mode 100644 index 0000000..20d7d2b --- /dev/null +++ b/src/f4578c04-a81e-4218-b80d-b0612196eaf0/README.md @@ -0,0 +1,38 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Filesfolders (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Filesfolders #Gold { + # array $keys + + set(object $item) : void +} + +note right of Filesfolders::set + Set the file and folder data + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f4578c04-a81e-4218-b80d-b0612196eaf0/code.php b/src/f4578c04-a81e-4218-b80d-b0612196eaf0/code.php new file mode 100644 index 0000000..f3b30e2 --- /dev/null +++ b/src/f4578c04-a81e-4218-b80d-b0612196eaf0/code.php @@ -0,0 +1,81 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Model Files & Folders Class + * + * @since 3.2.0 + */ +class Filesfolders +{ + /** + * Compiler Files Folders + * + * @var array + * @since 3.2.0 + */ + protected array $keys = [ + 'files' => 'files', + 'folders' => 'folders', + 'urls' => 'urls', + 'filesfullpath' => 'files', + 'foldersfullpath' => 'folders' + ]; + + /** + * Set the file and folder data + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + foreach ($this->keys as $target => $value) + { + // set the add target data + $item->{'add' . $target} = (isset($item->{'add' . $target}) && + JsonHelper::check($item->{'add' . $target})) ? + json_decode((string) $item->{'add' . $target}, true) : null; + + // only continue if there are values + if (ArrayHelper::check($item->{'add' . $target})) + { + if (isset($item->{$value}) + && ArrayHelper::check($item->{$value})) + { + foreach ($item->{'add' . $target} as $taget) + { + $item->{$value}[] = $taget; + } + } + else + { + $item->{$value} = array_values( + $item->{'add' . $target} + ); + } + } + + unset($item->{'add' . $target}); + } + } + +} + diff --git a/src/f4578c04-a81e-4218-b80d-b0612196eaf0/settings.json b/src/f4578c04-a81e-4218-b80d-b0612196eaf0/settings.json new file mode 100644 index 0000000..bc69680 --- /dev/null +++ b/src/f4578c04-a81e-4218-b80d-b0612196eaf0/settings.json @@ -0,0 +1,25 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "f4578c04-a81e-4218-b80d-b0612196eaf0", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Filesfolders", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Filesfolders", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Filesfolders", + "description": "Model Files & Folders Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md new file mode 100644 index 0000000..49622c5 --- /dev/null +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/README.md @@ -0,0 +1,498 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Config (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class Config #Gold { + # JoomlaRegistry $config + + __construct(?Input $input = null, ?JoomlaRegistry $params = null, ...) + # getAddcontributors() : bool + # getAddajax() : bool + # getAddsiteajax() : bool + # getAddeximport() : bool + # getAddcheckin() : bool + # getComponentid() : int + # getComponentversion() : string + # getComponentcodename() : string + # getComponentcontext() : string + # getComponentcodenamelength() : int + # getJoomlaversion() : int + # getJoomlaversions() : array + # getJoomlaversionname() : string + # getSetjoomlafields() : bool + # getShowadvancedoptions() : bool + # getIndentationvalue() : string + # getAddbuilddate() : int + # getBuilddate() : string + # getBackup() : int + # getRepository() : int + # getDebuglinenr() : int + # getMinify() : int + # getRemovelinebreaks() : bool + # getTidy() : bool + # getSettidywarning() : bool + # getSettaghistory() : bool + # getLangtag() : string + # getLangprefix() : string + # getLangtarget() : string + # getLangstringtargets() : array + # getLangstringkeytargets() : array + # getFieldbuildertype() : int + # getDefaultfields() : array + # getTmppath() : string + # getCompilerpath() : string + # getJcbpowerspath() : string + # getLocalpowersrepositorypath() : string + # getBompath() : string + # getCustomfolderpath() : string + # getAddassetstablefix() : int + # getAddassetstablenamefix() : bool + # getAccessworsecase() : int + # getMysqltablekeys() : array + # getAddplaceholders() : bool + # getAddpower() : bool + # getAddsuperpowers() : bool + # getBuildtarget() : string + # getCryptiontypes() : array + # getBasicencryption() : bool + # getMediumencryption() : bool + # getWhmcsencryption() : bool + # getRemovesitefolder() : bool + # getRemovesiteeditfolder() : bool + # getUikit() : int + # getGooglechart() : bool + # getFootable() : bool + # getFootableversion() : int +} + +note right of Config::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Input $input = null + ?JoomlaRegistry $params = null + ?JoomlaRegistry $config = null +end note + +note left of Config::getAddcontributors + get add contributors switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getAddajax + get Add Ajax Switch + + since: 3.2.0 + return: bool +end note + +note left of Config::getAddsiteajax + get Add Site Ajax Switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getAddeximport + get add eximport + + since: 3.2.0 + return: bool +end note + +note left of Config::getAddcheckin + get add checkin + + since: 3.2.0 + return: bool +end note + +note right of Config::getComponentid + get posted component id + + since: 3.2.0 + return: int +end note + +note left of Config::getComponentversion + get component version + + since: 3.2.0 + return: string +end note + +note right of Config::getComponentcodename + get components code name + + since: 3.2.0 + return: string +end note + +note left of Config::getComponentcontext + get component context + + since: 3.2.0 + return: string +end note + +note right of Config::getComponentcodenamelength + get component code name length + + since: 3.2.0 + return: int +end note + +note left of Config::getJoomlaversion + get posted Joomla version + + since: 3.2.0 + return: int +end note + +note right of Config::getJoomlaversions + get Joomla versions + + since: 3.2.0 + return: array +end note + +note left of Config::getJoomlaversionname + get posted Joomla version name + + since: 3.2.0 + return: string +end note + +note right of Config::getSetjoomlafields + set joomla fields + + since: 3.2.0 + return: bool +end note + +note left of Config::getShowadvancedoptions + get show advanced options switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getIndentationvalue + get indentation value + + since: 3.2.0 + return: string +end note + +note left of Config::getAddbuilddate + get add build date switch + + since: 3.2.0 + return: int +end note + +note right of Config::getBuilddate + get build date + + since: 3.2.0 + return: string +end note + +note left of Config::getBackup + get posted backup switch + + since: 3.2.0 + return: int +end note + +note right of Config::getRepository + get posted repository switch + + since: 3.2.0 + return: int +end note + +note left of Config::getDebuglinenr + get posted debuglinenr switch + + since: 3.2.0 + return: int +end note + +note right of Config::getMinify + get posted minify switch + + since: 3.2.0 + return: int +end note + +note left of Config::getRemovelinebreaks + get posted remove line breaks switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getTidy + get system tidy state + + since: 3.2.0 + return: bool +end note + +note left of Config::getSettidywarning + add tidy warning + + since: 3.2.0 + return: bool +end note + +note right of Config::getSettaghistory + get history tag switch + + since: 3.2.0 + return: bool +end note + +note left of Config::getLangtag + get language tag + + since: 3.2.0 + return: string +end note + +note right of Config::getLangprefix + get language prefix + + since: 3.2.0 + return: string +end note + +note left of Config::getLangtarget + get language target + + since: 3.2.0 + return: string +end note + +note right of Config::getLangstringtargets + get language string targets + + since: 3.2.0 + return: array +end note + +note left of Config::getLangstringkeytargets + get language string targets (by key name) + + since: 3.2.0 + return: array +end note + +note right of Config::getFieldbuildertype + get field builder type + + since: 3.2.0 + return: int +end note + +note left of Config::getDefaultfields + get default fields + + since: 3.2.0 + return: array +end note + +note right of Config::getTmppath + get temporary path + + since: 3.2.0 + return: string +end note + +note left of Config::getCompilerpath + get compiler path + + since: 3.2.0 + return: string +end note + +note right of Config::getJcbpowerspath + get jcb powers path + + since: 3.2.0 + return: string +end note + +note left of Config::getLocalpowersrepositorypath + Get local super powers repository path + + since: 3.2.0 + return: string +end note + +note right of Config::getBompath + get bom path + + since: 3.2.0 + return: string +end note + +note left of Config::getCustomfolderpath + get custom folder path + + since: 3.2.0 + return: string +end note + +note right of Config::getAddassetstablefix + get switch to add assets table fix + + since: 3.2.0 + return: int +end note + +note left of Config::getAddassetstablenamefix + get switch to add assets table name fix + + since: 3.2.0 + return: bool +end note + +note right of Config::getAccessworsecase + get access worse case size + + since: 3.2.0 + return: int +end note + +note left of Config::getMysqltablekeys + get mysql table keys + + since: 3.2.0 + return: array +end note + +note right of Config::getAddplaceholders + get switch add placeholders + + since: 3.2.0 + return: bool +end note + +note left of Config::getAddpower + get switch add power + + since: 3.2.0 + return: bool +end note + +note right of Config::getAddsuperpowers + Get switch to add super powers + + since: 3.2.0 + return: bool +end note + +note left of Config::getBuildtarget + get switch build target switch + + since: 3.2.0 + return: string +end note + +note right of Config::getCryptiontypes + get encryption types + + since: 3.2.0 + return: array +end note + +note left of Config::getBasicencryption + get basic encryption switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getMediumencryption + get medium encryption switch + + since: 3.2.0 + return: bool +end note + +note left of Config::getWhmcsencryption + get whmcs encryption switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getRemovesitefolder + Should we remove the site folder + + since: 3.2.0 + return: bool +end note + +note left of Config::getRemovesiteeditfolder + Should we remove the site edit folder + + since: 3.2.0 + return: bool +end note + +note right of Config::getUikit + The Uikit switch + + since: 3.2.0 + return: int +end note + +note left of Config::getGooglechart + The google chart switch + + since: 3.2.0 + return: bool +end note + +note right of Config::getFootable + The footable switch + + since: 3.2.0 + return: bool +end note + +note left of Config::getFootableversion + The footable version + + since: 3.2.0 + return: int +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php new file mode 100644 index 0000000..ec15d72 --- /dev/null +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php @@ -0,0 +1,837 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\Registry\Registry as JoomlaRegistry; +use Joomla\CMS\Factory as JoomlaFactory; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig; + + +/** + * Compiler Configurations + * + * All these functions are accessed via the direct name without the get: + * example: $this->component_code_name calls: $this->getComponentcodename() + * + * All values once called are cached, yet can be updated directly: + * example: $this->component_code_name = 'new_code_name'; // be warned! + * + * @since 3.2.0 + */ +class Config extends BaseConfig +{ + /** + * The Global Joomla Configuration + * + * @var JoomlaRegistry + * @since 3.2.0 + */ + protected JoomlaRegistry $config; + + /** + * Constructor + * + * @param Input|null $input Input + * @param Registry|null $params The component parameters + * @param Registry|null $config The Joomla configuration + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Input $input = null, ?JoomlaRegistry $params = null, ?JoomlaRegistry $config = null) + { + parent::__construct($input, $params); + + $this->config = $config ?: JoomlaFactory::getConfig(); + } + + /** + * get add contributors switch + * + * @return bool Add contributors switch + * @since 3.2.0 + */ + protected function getAddcontributors(): bool + { + return false; // default is false + } + + /** + * get Add Ajax Switch + * + * @return bool Add Ajax Switch + * @since 3.2.0 + */ + protected function getAddajax(): bool + { + return false; // default is false + } + + /** + * get Add Site Ajax Switch + * + * @return bool Add Site Ajax Switch + * @since 3.2.0 + */ + protected function getAddsiteajax(): bool + { + return false; // default is false + } + + /** + * get add eximport + * + * @return bool add eximport switch + * @since 3.2.0 + */ + protected function getAddeximport(): bool + { + return false; // default is false + } + + /** + * get add checkin + * + * @return bool add checkin switch + * @since 3.2.0 + */ + protected function getAddcheckin(): bool + { + return false; // default is false + } + + /** + * get posted component id + * + * @return int Component id + * @since 3.2.0 + */ + protected function getComponentid(): int + { + return $this->input->post->get('component_id', 0, 'INT'); + } + + /** + * get component version + * + * @return string Component version + * @since 3.2.0 + */ + protected function getComponentversion(): string + { + return '1.0.0'; + } + + /** + * get components code name + * + * @return string The components code name + * @since 3.2.0 + */ + protected function getComponentcodename(): string + { + // get components code name + return StringHelper::safe(GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'name_code' + )); + } + + /** + * get component context + * + * @return string The component context + * @since 3.2.0 + */ + protected function getComponentcontext(): string + { + // get component context + return $this->component_code_name . '.' . $this->component_id; + } + + /** + * get component code name length + * + * @return int The component code name length + * @since 3.2.0 + */ + protected function getComponentcodenamelength(): int + { + // get component name length + return strlen((string) $this->component_code_name); + } + + /** + * get posted Joomla version + * + * @return int Joomla version code + * @since 3.2.0 + */ + protected function getJoomlaversion(): int + { + return 3; // $this->input->post->get('joomla_version', 3, 'INT'); + } + + /** + * get Joomla versions + * + * @return array Joomla versions + * @since 3.2.0 + */ + protected function getJoomlaversions(): array + { + return [ + 3 => ['folder_key' => 3, 'xml_version' => 3.9], // only joomla 3 + 3.10 => ['folder_key' => 3, 'xml_version' => 4.0] // legacy joomla 4 + ]; + } + + /** + * get posted Joomla version name + * + * @return string Joomla version code name + * @since 3.2.0 + */ + protected function getJoomlaversionname(): string + { + return StringHelper::safe($this->joomla_version); + } + + /** + * set joomla fields + * + * @return bool set joomla fields + * @since 3.2.0 + */ + protected function getSetjoomlafields(): bool + { + return false; + } + + /** + * get show advanced options switch + * + * @return bool show advanced options + * @since 3.2.0 + */ + protected function getShowadvancedoptions(): bool + { + return (bool) $this->input->post->get('show_advanced_options', 0, 'INT'); + } + + /** + * get indentation value + * + * @return string Indentation value + * @since 3.2.0 + */ + protected function getIndentationvalue(): string + { + // if advanced options is active + if ($this->show_advanced_options) + { + $indentation_value = $this->input->post->get('indentation_value', 1, 'INT'); + + switch($indentation_value) + { + case 2: + // two spaces + return " "; + break; + case 4: + // four spaces + return " "; + break; + } + } + + return "\t"; + } + + /** + * get add build date switch + * + * @return int add build date options + * @since 3.2.0 + */ + protected function getAddbuilddate(): int + { + // if advanced options is active + if ($this->show_advanced_options) + { + // 1=default 2=manual 3=component + return $this->input->post->get('add_build_date', 1, 'INT'); + } + + return 1; + } + + /** + * get build date + * + * @return string build date + * @since 3.2.0 + */ + protected function getBuilddate(): string + { + // if advanced options is active and manual date selected + if ($this->show_advanced_options && $this->add_build_date == 2) + { + return $this->input->post->get('build_date', 'now', 'STRING'); + } + + return "now"; + } + + /** + * get posted backup switch + * + * @return int Backup switch number + * @since 3.2.0 + */ + protected function getBackup(): int + { + return $this->input->post->get('backup', 0, 'INT'); + } + + /** + * get posted repository switch + * + * @return int Repository switch number + * @since 3.2.0 + */ + protected function getRepository(): int + { + return $this->input->post->get('repository', 0, 'INT'); + } + + /** + * get posted debuglinenr switch + * + * @return int Debuglinenr switch number + * @since 3.2.0 + */ + protected function getDebuglinenr(): int + { + // get posted value + $value = $this->input->post->get('debug_line_nr', 2, 'INT'); + // get global value + if ($value > 1) + { + return (int) GetHelper::var('joomla_component', $this->component_id, 'id', 'debug_linenr'); + } + return $value; + } + + /** + * get posted minify switch + * + * @return int Minify switch number + * @since 3.2.0 + */ + protected function getMinify(): int + { + // get posted value + $minify = $this->input->post->get('minify', 2, 'INT'); + + // if value is 2 use global value + return ($minify != 2) ? $minify : $this->params->get('minify', 0); + } + + /** + * get posted remove line breaks switch + * + * @return bool Remove line breaks switch number + * @since 3.2.0 + */ + protected function getRemovelinebreaks(): bool + { + // get posted value + $value = $this->input->post->get('remove_line_breaks', 2, 'INT'); + // get global + if ($value > 1) + { + return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'remove_line_breaks'); + } + return (bool) $value; + } + + /** + * get system tidy state + * + * @return bool Tidy is active + * @since 3.2.0 + */ + protected function getTidy(): bool + { + // check if we have Tidy enabled + return \extension_loaded('Tidy'); + } + + /** + * add tidy warning + * + * @return bool Set tidy warning + * @since 3.2.0 + */ + protected function getSettidywarning(): bool + { + // add warning once + return true; + } + + /** + * get history tag switch + * + * @return bool get history tag switch + * @since 3.2.0 + */ + protected function getSettaghistory(): bool + { + // add warning once + return true; + } + + /** + * get language tag + * + * @return string The active language tag + * @since 3.2.0 + */ + protected function getLangtag(): string + { + // get the global language + return $this->params->get('language', 'en-GB'); + } + + /** + * get language prefix + * + * @return string The language prefix + * @since 3.2.0 + */ + protected function getLangprefix(): string + { + // get components code name + return 'COM_' . StringHelper::safe(GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'name_code' + ), 'U'); + } + + /** + * get language target + * + * @return string The language active target + * @since 3.2.0 + */ + protected function getLangtarget(): string + { + // we start with admin + // but this is a switch value and is changed many times + return 'admin'; + } + + /** + * get language string targets + * + * @return array The language prefix + * @since 3.2.0 + */ + protected function getLangstringtargets(): array + { + // these strings are used to search for language strings in all content + return array_values($this->lang_string_key_targets); + } + + /** + * get language string targets (by key name) + * + * @return array The language prefix + * @since 3.2.0 + */ + protected function getLangstringkeytargets(): array + { + // these strings are used to search for language strings in all content + return [ + 'jjt' => 'Joomla' . '.JText._(', + 'js' => 'JText:' . ':script(', + 't' => 'Text:' . ':_(', // namespace and J version will be found + 'ts' => 'Text:' . ':sprintf(', // namespace and J version will be found + 'jt' => 'JustTEXT:' . ':_(' + ]; + } + + /** + * get field builder type + * + * @return int The field builder type + * @since 3.2.0 + */ + protected function getFieldbuildertype(): int + { + // get the field type builder + return $this->params->get( + 'compiler_field_builder_type', 2 + ); + } + + /** + * get default fields + * + * @return array The default fields + * @since 3.2.0 + */ + protected function getDefaultfields(): array + { + // get the field type builder + return ['created', 'created_by', 'modified', 'modified_by', 'published', + 'ordering', 'access', 'version', 'hits', 'id']; + } + + /** + * get temporary path + * + * @return string The temporary path + * @since 3.2.0 + */ + protected function getTmppath(): string + { + // get the temporary path + return $this->config->get('tmp_path'); + } + + /** + * get compiler path + * + * @return string The compiler path + * @since 3.2.0 + */ + protected function getCompilerpath(): string + { + // get the compiler path + return $this->params->get( + 'compiler_folder_path', + JPATH_COMPONENT_ADMINISTRATOR . '/compiler' + ); + } + + /** + * get jcb powers path + * + * @return string The jcb powers path + * @since 3.2.0 + */ + protected function getJcbpowerspath(): string + { + // get jcb powers path + return $this->params->get('jcb_powers_path', 'libraries/jcb_powers'); + } + + /** + * Get local super powers repository path + * + * @return string The path to the local repository + * @since 3.2.0 + */ + protected function getLocalpowersrepositorypath(): string + { + $default = $this->tmp_path . '/super_powers'; + + if (!$this->add_super_powers) + { + return $default; + } + + $global = $this->params->get('local_powers_repository_path', $default); + + if (!$this->show_advanced_options) + { + return $global; + } + + $value = $this->input->post->get('powers_repository', 2, 'INT'); + + return $value == 1 + ? $this->input->post->get('local_powers_repository_path', $global, 'PATH') + : $global; + } + + /** + * get bom path + * + * @return string The bom path + * @since 3.2.0 + */ + protected function getBompath(): string + { + // get default bom path + return $this->compiler_path . '/default.txt'; + } + + /** + * get custom folder path + * + * @return string The custom folder path + * @since 3.2.0 + */ + protected function getCustomfolderpath(): string + { + // get the custom folder path + return $this->params->get( + 'custom_folder_path', + JPATH_COMPONENT_ADMINISTRATOR . '/custom' + ); + } + + /** + * get switch to add assets table fix + * + * @return int Switch number to add assets table fix + * @since 3.2.0 + */ + protected function getAddassetstablefix(): int + { + // get global add assets table fix + $global = $this->params->get( + 'assets_table_fix', 1 + ); + + // get component value + return (($add_assets_table_fix = (int) GetHelper::var( + 'joomla_component', $this->component_id, 'id', + 'assets_table_fix' + )) == 3) ? $global : $add_assets_table_fix; + } + + /** + * get switch to add assets table name fix + * + * @return bool Switch number to add assets table name fix + * @since 3.2.0 + */ + protected function getAddassetstablenamefix(): bool + { + // get global is false + return false; + } + + /** + * get access worse case size + * + * @return int access worse case size + * @since 3.2.0 + */ + protected function getAccessworsecase(): int + { + // we start at zero + return 0; + } + + /** + * get mysql table keys + * + * @return array + * @since 3.2.0 + */ + protected function getMysqltablekeys(): array + { + return [ + 'engine' => ['default' => 'MyISAM'], + 'charset' => ['default' => 'utf8'], + 'collate' => ['default' => 'utf8_general_ci'], + 'row_format' => ['default' => ''] + ]; + } + + /** + * get switch add placeholders + * + * @return bool Switch to add placeholders + * @since 3.2.0 + */ + protected function getAddplaceholders(): bool + { + // get posted value + $value = $this->input->post->get('add_placeholders', 2, 'INT'); + // get global value + if ($value > 1) + { + return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_placeholders'); + } + return (bool) $value; + } + + /** + * get switch add power + * + * @return bool Switch to add power + * @since 3.2.0 + */ + protected function getAddpower(): bool + { + // get posted value + $value = $this->input->post->get('powers', 2, 'INT'); + // get global value + if ($value > 1) + { + return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_powers'); + } + return (bool) $value; + } + + /** + * Get switch to add super powers + * + * @return bool Switch to add super powers + * @since 3.2.0 + */ + protected function getAddsuperpowers(): bool + { + $default = (bool) $this->params->get('powers_repository', 0); + + if (!$this->show_advanced_options) + { + return $default; + } + + $value = $this->input->post->get('powers_repository', 2, 'INT'); + + return $value == 2 ? $default : (bool) $value; + } + + /** + * get switch build target switch + * + * @return string Switch to control the build flow + * @since 3.2.0 + */ + protected function getBuildtarget(): string + { + // we start with admin + // but this is a switch value and is changed many times + return 'admin'; + } + + /** + * get encryption types + * + * @return array encryption types + * @since 3.2.0 + */ + protected function getCryptiontypes(): array + { + return ['basic', 'medium', 'whmcs', 'expert']; + } + + /** + * get basic encryption switch + * + * @return bool Switch to control the encryption + * @since 3.2.0 + */ + protected function getBasicencryption(): bool + { + return false; + } + + /** + * get medium encryption switch + * + * @return bool Switch to control the encryption + * @since 3.2.0 + */ + protected function getMediumencryption(): bool + { + return false; + } + + /** + * get whmcs encryption switch + * + * @return bool Switch to control the encryption + * @since 3.2.0 + */ + protected function getWhmcsencryption(): bool + { + return false; + } + + /** + * Should we remove the site folder + * + * @return bool Switch to control the removal + * @since 3.2.0 + */ + protected function getRemovesitefolder(): bool + { + return false; + } + + /** + * Should we remove the site edit folder + * + * @return bool Switch to control the removal + * @since 3.2.0 + */ + protected function getRemovesiteeditfolder(): bool + { + return true; + } + + /** + * The Uikit switch + * + * @return int Switch to control the adding uikit + * @since 3.2.0 + */ + protected function getUikit(): int + { + return 0; // default its not added + } + + /** + * The google chart switch + * + * @return bool Switch to control the adding googlechart + * @since 3.2.0 + */ + protected function getGooglechart(): bool + { + return false; // default its not added + } + + /** + * The footable switch + * + * @return bool Switch to control the adding footable + * @since 3.2.0 + */ + protected function getFootable(): bool + { + return false; // default its not added + } + + /** + * The footable version + * + * @return int Switch to control the adding footable + * @since 3.2.0 + */ + protected function getFootableversion(): int + { + return 2; // default is version 2 + } + +} + diff --git a/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json new file mode 100644 index 0000000..3fcb974 --- /dev/null +++ b/src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json @@ -0,0 +1,30 @@ +{ + "add_head": "1", + "extends": "9769f3b2-17bf-4f20-b54b-3a4ebe572b36", + "extends_custom": "", + "guid": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "implements": null, + "implements_custom": "", + "load_selection": { + "load_selection0": { + "load": "b591855d-d106-4fe5-90ad-8e706f6267cf" + } + }, + "name": "Config", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Config", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "db87c339-5bb6-4291-a7ef-2c48ea1b06bc", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Config", + "description": "Compiler Configurations\r\n\r\n\tAll these functions are accessed via the direct name without the get:\r\n\texample: $this->component_code_name calls: $this->getComponentcodename()\r\n\r\n\tAll values once called are cached, yet can be updated directly:\r\n\texample: $this->component_code_name = 'new_code_name'; \/\/ be warned!\r\n\r\n@since 3.2.0", + "head": "use Joomla\\Registry\\Registry as JoomlaRegistry;\r\nuse Joomla\\CMS\\Factory as JoomlaFactory;" +} \ No newline at end of file diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md new file mode 100644 index 0000000..13f957d --- /dev/null +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/README.md @@ -0,0 +1,56 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Customtabs (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Model** +```uml +@startuml +class Customtabs #Gold { + # Config $config + # Registry $registry + # Language $language + # Placeholder $placeholder + # Customcode $customcode + + __construct(?Config $config = null, ?Registry $registry = null, ...) + + set(object $item) : void +} + +note right of Customtabs::__construct + Constructor + + since: 3.2.0 + + arguments: + ?Config $config = null + ?Registry $registry = null + ?Language $language = null + ?Placeholder $placeholder = null + ?Customcode $customcode = null +end note + +note right of Customtabs::set + Set custom tabs + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php new file mode 100644 index 0000000..9b7ec15 --- /dev/null +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/code.php @@ -0,0 +1,242 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Model Custom Tabs Class + * + * @since 3.2.0 + */ +class Customtabs +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Language|null $language The compiler Language object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Language $language = null, ?Placeholder $placeholder = null, ?Customcode $customcode = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->language = $language ?: Compiler::_('Language'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + } + + /** + * Set custom tabs + * + * @param object $item The view data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $item->customtabs = (isset($item->customtabs) + && JsonHelper::check($item->customtabs)) + ? json_decode((string) $item->customtabs, true) : null; + + if (ArrayHelper::check($item->customtabs)) + { + // get the name + $name = $item->name_single_code; + + // setup custom tabs to global data sets + $this->registry->set('builder.custom_tabs.' . $name, + array_map( + function ($tab) use (&$name) { + + // set the view name + $tab['view'] = $name; + + // load the dynamic data + $tab['html'] = $this->placeholder->update_( + $this->customcode->update($tab['html']) + ); + + // set the tab name + $tab['name'] = (isset($tab['name']) + && StringHelper::check( + $tab['name'] + )) ? $tab['name'] : 'Tab'; + + // set lang + $tab['lang'] = $this->config->lang_prefix . '_' + . StringHelper::safe( + $tab['view'], 'U' + ) . '_' . StringHelper::safe( + $tab['name'], 'U' + ); + $this->language->set( + 'both', $tab['lang'], $tab['name'] + ); + + // set code name + $tab['code'] = StringHelper::safe( + $tab['name'] + ); + + // check if the permissions for the tab should be added + $_tab = ''; + if (isset($tab['permission']) + && $tab['permission'] == 1) + { + $_tab = Indent::_(1); + } + + // check if the php of the tab is set, if not load it now + if (strpos((string) $tab['html'], 'bootstrap.addTab') === false + && strpos((string) $tab['html'], 'bootstrap.endTab') + === false) + { + // add the tab + $tmp = PHP_EOL . $_tab . Indent::_(1) + . ""; + $tmp .= PHP_EOL . $_tab . Indent::_(2) + . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(3) + . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(4) . implode( + PHP_EOL . $_tab . Indent::_(4), + (array) explode(PHP_EOL, trim((string) $tab['html'])) + ); + $tmp .= PHP_EOL . $_tab . Indent::_(3) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; + $tmp .= PHP_EOL . $_tab . Indent::_(1) + . ""; + + // update html + $tab['html'] = $tmp; + } + else + { + $tab['html'] = PHP_EOL . $_tab . Indent::_(1) + . implode( + PHP_EOL . $_tab . Indent::_(1), + (array) explode(PHP_EOL, trim((string) $tab['html'])) + ); + } + + // add the permissions if needed + if (isset($tab['permission']) + && $tab['permission'] == 1) + { + $tmp = PHP_EOL . Indent::_(1) + . "canDo->get('" + . $tab['view'] . "." . $tab['code'] + . ".viewtab')) : ?>"; + $tmp .= $tab['html']; + $tmp .= PHP_EOL . Indent::_(1) . ""; + // update html + $tab['html'] = $tmp; + // set lang for permissions + $tab['lang_permission'] = $tab['lang'] + . '_TAB_PERMISSION'; + $tab['lang_permission_desc'] = $tab['lang'] + . '_TAB_PERMISSION_DESC'; + $tab['lang_permission_title'] + = $this->placeholder->get('Views') . ' View ' + . $tab['name'] . ' Tab'; + $this->language->set( + 'both', $tab['lang_permission'], + $tab['lang_permission_title'] + ); + $this->language->set( + 'both', $tab['lang_permission_desc'], + 'Allow the users in this group to view ' + . $tab['name'] . ' Tab of ' + . $this->placeholder->get('views') + ); + // set the sort key + $tab['sortKey'] + = StringHelper::safe( + $tab['lang_permission_title'] + ); + } + + // return tab + return $tab; + + }, array_values($item->customtabs) + ) + ); + } + + unset($item->customtabs); + } + +} + diff --git a/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json new file mode 100644 index 0000000..f03122d --- /dev/null +++ b/src/fa8c1125-d370-4cb6-a7ff-eb32193c198c/settings.json @@ -0,0 +1,57 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "fa8c1125-d370-4cb6-a7ff-eb32193c198c", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Customtabs", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Model.Customtabs", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection1": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection2": { + "use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "as": "default" + }, + "use_selection3": { + "use": "8eee7df5-2775-41a9-9372-c46c5939a252", + "as": "default" + }, + "use_selection4": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection5": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection6": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection7": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection8": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection9": { + "use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Model.Customtabs", + "description": "Model Custom Tabs Class\r\n\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/README.md b/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/README.md new file mode 100644 index 0000000..e921860 --- /dev/null +++ b/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/README.md @@ -0,0 +1,87 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface Mapperdoubleinterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface Mapperdoubleinterface #Lavender { + + isActive_(string $firstKey = null) : bool + + set_(string $firstKey, string $secondKey, ...) : void + + get_(string $firstKey, ?string $secondKey = null) : mixed + + exist_(string $firstKey, ?string $secondKey = null) : bool + + add_(string $firstKey, string $secondKey, ...) : void + + remove_(string $firstKey, ?string $secondKey = null) : void +} + +note right of Mapperdoubleinterface::isActive_ + Check if any values are set in the active array. + + since: 3.2.0 + return: bool +end note + +note right of Mapperdoubleinterface::set_ + Set dynamic content + + since: 3.2.0 + return: void + + arguments: + string $firstKey + string $secondKey + mixed $value +end note + +note right of Mapperdoubleinterface::get_ + Get dynamic content + + since: 3.2.0 + return: mixed +end note + +note right of Mapperdoubleinterface::exist_ + Does keys exist + + since: 3.2.0 + return: bool +end note + +note right of Mapperdoubleinterface::add_ + Add dynamic content + + since: 3.2.0 + return: void + + arguments: + string $firstKey + string $secondKey + mixed $value +end note + +note right of Mapperdoubleinterface::remove_ + Remove dynamic content + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/code.php b/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/code.php new file mode 100644 index 0000000..1975ac8 --- /dev/null +++ b/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/code.php @@ -0,0 +1,88 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Interfaces; + + +/** + * The Double Mapper Interface + */ +interface Mapperdoubleinterface +{ + /** + * Check if any values are set in the active array. + * + * @param string|null $firstKey Optional. The first key to check for values. + * + * @return bool True if the active array or the specified subarray is not empty, false otherwise. + * @since 3.2.0 + */ + public function isActive_(string $firstKey = null): bool; + + /** + * Set dynamic content + * + * @param string $firstKey The first key + * @param string $secondKey The second key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_(string $firstKey, string $secondKey, $value); + + /** + * Get dynamic content + * + * @param string $firstKey The first key + * @param string $secondKey The second key + * + * @return mixed + * @since 3.2.0 + */ + public function get_(string $firstKey, ?string $secondKey = null); + + /** + * Does keys exist + * + * @param string $firstKey The first key + * @param string|null $secondKey The second key + * + * @return bool + * @since 3.2.0 + */ + public function exist_(string $firstKey, ?string $secondKey = null): bool; + + /** + * Add dynamic content + * + * @param string $firstKey The first key + * @param string $secondKey The second key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_(string $firstKey, string $secondKey, $value); + + /** + * Remove dynamic content + * + * @param string $firstKey The first key + * @param string|null $secondKey The second key + * + * @return void + * @since 3.2.0 + */ + public function remove_(string $firstKey, ?string $secondKey = null); + +} + diff --git a/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/settings.json b/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/settings.json new file mode 100644 index 0000000..e0f2754 --- /dev/null +++ b/src/fbc58009-fa16-4d49-a0dd-419c3b62d42f/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "fbc58009-fa16-4d49-a0dd-419c3b62d42f", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Mapperdoubleinterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Mapperdoubleinterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Mapperdoubleinterface", + "description": "The Double Mapper Interface" +} \ No newline at end of file diff --git a/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/README.md b/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/README.md new file mode 100644 index 0000000..44cb86d --- /dev/null +++ b/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/README.md @@ -0,0 +1,151 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Plantuml (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Power** +```uml +@startuml +class Plantuml #Gold { + + namespaceDiagram(string $namespace, string $classes) : string + + classBasicDiagram(array $power, array $code) : string + + classDetailedDiagram(array $power, array $code) : string + - generatePropertiesPlantUML(array $properties, string $space) : string + - generateDetailedMethodsPlantUML(array $methods, string $class_name) : array + - generateBasicMethodsPlantUML(array $methods) : string + - generateMethodArgumentsAndNotes(array $arguments, string $class_name, ...) : array + - generateMethodNotes(array $method, string $class_name, ...) : array + - generateNotesPlantUML(array $notes) : string + - getAccessSign(string $access) : string + - getClassTypeLable(string $type) : string + - getClassTypeTag(string $type) : string + - getClassColor(string $classType) : string + - getNamespaceColor(int $namespaceDepth) : string +} + +note right of Plantuml::namespaceDiagram + Get a namespace diagram of a group of class + + since: 3.2.0 + return: string +end note + +note left of Plantuml::classBasicDiagram + Get a class basic diagram of a class + + since: 3.2.0 + return: string +end note + +note right of Plantuml::classDetailedDiagram + Get a class detailed diagram of a class + + since: 3.2.0 + return: string +end note + +note left of Plantuml::generatePropertiesPlantUML + Generate properties PlantUML + + since: 3.2.0 + return: string +end note + +note right of Plantuml::generateDetailedMethodsPlantUML + Generate detailed methods PlantUML + + since: 3.2.0 + return: array +end note + +note left of Plantuml::generateBasicMethodsPlantUML + Generate basic methods PlantUML + + since: 3.2.0 + return: string +end note + +note right of Plantuml::generateMethodArgumentsAndNotes + Generate method arguments and notes + + since: 3.2.0 + return: array + + arguments: + array $arguments + string $class_name + string $method_name + array $notes +end note + +note left of Plantuml::generateMethodNotes + Generate method notes + + return: array + + arguments: + array $method + string $class_name + array $notes +end note + +note right of Plantuml::generateNotesPlantUML + Generate notes PlantUML + + since: 3.2.0 + return: string +end note + +note left of Plantuml::getAccessSign + Get the access sign based on the access level. + + since: 3.2.0 + return: string +end note + +note right of Plantuml::getClassTypeLable + Get the correct class type. + + since: 3.2.0 + return: string +end note + +note left of Plantuml::getClassTypeTag + Get the extra class type tag. + + since: 3.2.0 + return: string +end note + +note right of Plantuml::getClassColor + Get class color based on class type. + + since: 3.2.0 + return: string +end note + +note left of Plantuml::getNamespaceColor + Get namespace color based on namespace depth. + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php b/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php new file mode 100644 index 0000000..3b7e7c4 --- /dev/null +++ b/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php @@ -0,0 +1,462 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Power; + + +/** + * Compiler Power Plantuml Builder + * @since 3.2.0 + */ +class Plantuml +{ + /** + * Get a namespace diagram of a group of class + * + * @param string $namespace the namespace name + * @param string $classes the ready build class uml + * + * @return string + * @since 3.2.0 + */ + public function namespaceDiagram(string $namespace, string $classes): string + { + $namespace_depth = substr_count($namespace, '\\'); + $namespace_color = $this->getNamespaceColor($namespace_depth); + + // Set the scale of the diagram + // $plant_uml = "scale 0.8\n\n"; + + // Add namespace + $plant_uml = "namespace $namespace #$namespace_color {\n\n"; + + // Add class + $plant_uml .= $classes; + + $plant_uml .= "}\n"; + + return $plant_uml; + } + + /** + * Get a class basic diagram of a class + * + * @param array $power the class being built + * @param array $code the class code being built + * + * @return string + * @since 3.2.0 + */ + public function classBasicDiagram(array $power, array $code): string + { + // Set some global values + $class_name = $power['name']; + $class_type = $power['type']; + + // set the class color + $class_color = $this->getClassColor($class_type); + + // set the class type label + $type_label = $this->getClassTypeLable($class_type); + + // set the class type tag + $type_tag = $this->getClassTypeTag($class_type); + + // Add class + $plant_uml = "\n $type_label $class_name $type_tag #$class_color {\n"; + + // Add properties + if ($code['properties']) + { + $plant_uml .= $this->generatePropertiesPlantUML($code['properties'], ' '); + } + + // Add methods + if ($code['methods']) + { + $plant_uml .= $this->generateBasicMethodsPlantUML($code['methods']); + } + + $plant_uml .= " }\n"; + + return $plant_uml; + } + + /** + * Get a class detailed diagram of a class + * + * @param array $power the class being built + * @param array $code the class code being built + * + * @return string + * @since 3.2.0 + */ + public function classDetailedDiagram(array $power, array $code): string + { + // Set some global values + $class_name = $power['name']; + $class_type = $power['type']; + + // set the class color + $class_color = $this->getClassColor($class_type); + + // set the class type label + $type_label = $this->getClassTypeLable($class_type); + + // set the class type tag + $type_tag = $this->getClassTypeTag($class_type); + + // Add class + $plant_uml = "\n$type_label $class_name $type_tag #$class_color {\n"; + + // Add properties + if ($code['properties']) + { + $plant_uml .= $this->generatePropertiesPlantUML($code['properties'], ' '); + } + + // Add methods + if ($code['methods']) + { + list($methods_plant_uml, $notes) = $this->generateDetailedMethodsPlantUML($code['methods'], $class_name); + $plant_uml .= $methods_plant_uml; + } + + $plant_uml .= "}\n"; + + if (!empty($notes)) + { + $plant_uml .= $this->generateNotesPlantUML($notes); + } + + return $plant_uml; + } + + /** + * Generate properties PlantUML + * + * @param array $properties + * @param string $space + * + * @return string + * @since 3.2.0 + */ + private function generatePropertiesPlantUML(array $properties, string $space): string + { + $plant_uml = ""; + + foreach ($properties as $property) + { + $access_sign = $this->getAccessSign($property['access']); + $static = $property['static'] ? '{static} ' : ''; + $type = $property['type'] ? $property['type'] . ' ' : ''; + $plant_uml .= "{$space}$access_sign $static{$type}{$property['name']}\n"; + } + + return $plant_uml; + } + + /** + * Generate detailed methods PlantUML + * + * @param array $methods + * @param string $class_name + * + * @return array + * @since 3.2.0 + */ + private function generateDetailedMethodsPlantUML(array $methods, string $class_name): array + { + $plant_uml = ""; + $notes = []; + + foreach ($methods as $method) + { + $notes = $this->generateMethodNotes($method, $class_name, $notes); + + $access_sign = $this->getAccessSign($method['access']); + + $arguments = ''; + if ($method['arguments']) + { + $arguments = $this->generateMethodArgumentsAndNotes( + $method['arguments'], $class_name, $method['name'], $notes); + + $arguments = implode(', ', $arguments); + } + + $static = $method['static'] ? '{static} ' : ''; + $abstract = $method['abstract'] ? '{abstract} ' : ''; + $return_type = $method['return_type'] ? " : {$method['return_type']}" : ''; + + $plant_uml .= " $access_sign {$abstract}$static{$method['name']}({$arguments})$return_type\n"; + } + + return [$plant_uml, $notes]; + } + + /** + * Generate basic methods PlantUML + * + * @param array $properties + * + * @return string + * @since 3.2.0 + */ + private function generateBasicMethodsPlantUML(array $methods): string + { + $plant_uml = ""; + + foreach ($methods as $method) + { + $access_sign = $this->getAccessSign($method['access']); + $static = $method['static'] ? '{static} ' : ''; + $abstract = $method['abstract'] ? '{abstract} ' : ''; + $return_type = $method['return_type'] ? " : {$method['return_type']}" : ''; + $plant_uml .= " $access_sign {$abstract}$static{$method['name']}()$return_type\n"; + } + + return $plant_uml; + } + + /** + * Generate method arguments and notes + * + * @param array $arguments + * @param string $class_name + * @param string $method_name + * @param array $notes + * + * @return array + * @since 3.2.0 + */ + private function generateMethodArgumentsAndNotes(array $arguments, string $class_name, + string $method_name, array &$notes): array + { + $formatted_arguments = []; + $notes_bucket = []; + $limit = 2; + + foreach ($arguments as $name => $arg) + { + $arg_type = $arg['type'] ? "{$arg['type']} " : ''; + $arg_default = $arg['default'] ? " = {$arg['default']}" : ''; + $arg_statment = "{$arg_type}$name{$arg_default}"; + + if ($limit == 0) + { + $formatted_arguments[] = "..."; + $limit = -1; + } + elseif ($limit > 0) + { + $formatted_arguments[] = $arg_statment; + $limit--; + } + + $notes_bucket[] = $arg_statment; + } + + if ($limit == -1) + { + $notes["{$class_name}::{$method_name}"][] = "\n arguments:\n " . implode("\n ", $notes_bucket); + } + + return $formatted_arguments; + } + + /** + * Generate method notes + * + * @param array $method + * @param string $class_name + * @param array $notes + * + * @return array + */ + private function generateMethodNotes(array $method, string $class_name, array &$notes): array + { + $notes_key = "{$class_name}::{$method['name']}"; + + if (is_string($method['comment']) && strlen($method['comment']) > 4) + { + $notes[$notes_key][] = trim(preg_replace("/^@.*[\r\n]*/m", '', $method['comment'])) . "\n"; + } + + if (is_string($method['since']) && strlen($method['since']) > 3) + { + $notes[$notes_key][] = "since: {$method['since']}"; + } + + if (is_string($method['return_type']) && strlen($method['return_type']) > 1) + { + $notes[$notes_key][] = "return: {$method['return_type']}"; + } + + if (is_string($method['deprecated']) && strlen($method['deprecated']) > 3) + { + $notes[$notes_key][] = "deprecated: {$method['deprecated']}"; + } + + return $notes; + } + + /** + * Generate notes PlantUML + * + * @param array $notes + * + * @return string + * @since 3.2.0 + */ + private function generateNotesPlantUML(array $notes): string + { + $plant_uml = ""; + $note_count = count($notes); + $note_index = 0; + + $positions = ['right', 'left']; + $position_index = 0; + + foreach ($notes as $area => $note) + { + if ($note_count <= 7) + { + $position = 'right'; + } + else + { + $position = $positions[$position_index % 2]; + $position_index++; + } + + $plant_uml .= "\nnote $position of {$area}\n"; + $plant_uml .= " " . implode("\n ", $note) . "\n"; + $plant_uml .= "end note\n"; + + $note_index++; + } + + return $plant_uml; + } + + /** + * Get the access sign based on the access level. + * + * @param string $access The access level. + * + * @return string The corresponding access sign. + * @since 3.2.0 + */ + private function getAccessSign(string $access): string + { + switch ($access) + { + case 'private': + return '-'; + case 'protected': + return '#'; + case 'public': + return '+'; + case 'var': + return '+'; + default: + return ''; + } + } + + /** + * Get the correct class type. + * + * @param string $type The class type. + * + * @return string The correct class type label. + * @since 3.2.0 + */ + private function getClassTypeLable(string $type): string + { + $class_type_updater = [ + 'final class' => 'class', + 'abstract class' => 'abstract', + 'trait' => 'class' + ]; + + return $class_type_updater[$type] ?? $type; + } + + /** + * Get the extra class type tag. + * + * @param string $type The class type. + * + * @return string The correct class type label. + * @since 3.2.0 + */ + private function getClassTypeTag(string $type): string + { + $class_type_updater = [ + 'final class' => '<< (F,LightGreen) >>', + 'trait' => '<< (T,Orange) >>' + ]; + + return $class_type_updater[$type] ?? ''; + } + + /** + * Get class color based on class type. + * + * @param string $classType The class type. + * + * @return string The corresponding color. + * @since 3.2.0 + */ + private function getClassColor(string $classType): string + { + $class_colors = [ + 'class' => 'Gold', + 'final' => 'RoyalBlue', + 'abstract class' => 'Orange', + 'interface' => 'Lavender', + 'trait' => 'Turquoise' + ]; + + return $class_colors[$classType] ?? 'Green'; + } + + /** + * Get namespace color based on namespace depth. + * + * @param int $namespaceDepth The depth of the namespace. + * + * @return string The corresponding color. + * @since 3.2.0 + */ + private function getNamespaceColor(int $namespaceDepth): string + { + $namespace_colors = [ + 'lightgrey', + 'Azure', + 'DarkCyan', + 'Olive', + 'LightGreen', + 'DeepSkyBlue', + 'Wheat', + 'Coral', + 'Beige', + 'DeepPink', + 'DeepSkyBlue' + ]; + + return $namespace_colors[$namespaceDepth % count($namespace_colors)] ?? 'lightgrey'; + } + +} + diff --git a/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json b/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json new file mode 100644 index 0000000..3e8cd0c --- /dev/null +++ b/src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json @@ -0,0 +1,16 @@ +{ + "add_head": "0", + "extends": "0", + "extends_custom": "", + "guid": "ff5e9e63-86d0-4691-ab59-d4b9d9154096", + "implements": null, + "implements_custom": "", + "load_selection": null, + "name": "Plantuml", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Power.Plantuml", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Power.Plantuml", + "description": "Compiler Power Plantuml Builder\r\n@since 3.2.0" +} \ No newline at end of file diff --git a/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/README.md b/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/README.md new file mode 100644 index 0000000..d929dfb --- /dev/null +++ b/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Templatelayout (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class Templatelayout #Gold { + + register(Container $container) : void + + getTemplatelayoutData(Container $container) : TemplatelayoutData + + getAliasData(Container $container) : AliasData +} + +note right of Templatelayout::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note right of Templatelayout::getTemplatelayoutData + Get the Compiler Templatelayout Data + + since: 3.2.0 + return: TemplatelayoutData +end note + +note right of Templatelayout::getAliasData + Get the Compiler Alias Data + + since: 3.2.0 + return: AliasData +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/code.php b/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/code.php new file mode 100644 index 0000000..16cb913 --- /dev/null +++ b/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/code.php @@ -0,0 +1,83 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as TemplatelayoutData ; +use VDM\Joomla\Componentbuilder\Compiler\Alias\Data as AliasData; + + +/** + * Compiler Templatelayout + * + * @since 3.2.0 + */ +class Templatelayout implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(TemplatelayoutData::class, 'Templatelayout.Data') + ->share('Templatelayout.Data', [$this, 'getTemplatelayoutData'], true); + + $container->alias(AliasData::class, 'Alias.Data') + ->share('Alias.Data', [$this, 'getAliasData'], true); + } + + /** + * Get the Compiler Templatelayout Data + * + * @param Container $container The DI container. + * + * @return TemplatelayoutData + * @since 3.2.0 + */ + public function getTemplatelayoutData(Container $container): TemplatelayoutData + { + return new TemplatelayoutData( + $container->get('Config'), + $container->get('Registry'), + $container->get('Alias.Data') + ); + } + + /** + * Get the Compiler Alias Data + * + * @param Container $container The DI container. + * + * @return AliasData + * @since 3.2.0 + */ + public function getAliasData(Container $container): AliasData + { + return new AliasData( + $container->get('Config'), + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Model.Loader'), + $container->get('Model.Libraries') + ); + } + +} + diff --git a/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/settings.json b/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/settings.json new file mode 100644 index 0000000..672f6a0 --- /dev/null +++ b/src/fff3255d-c493-4c21-a48f-73b3ebf8ba05/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "1", + "extends": "0", + "extends_custom": "", + "guid": "fff3255d-c493-4c21-a48f-73b3ebf8ba05", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Templatelayout", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.Templatelayout", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "39ea8150-f124-4e47-909d-641bf1c96d5e", + "as": "TemplatelayoutData " + }, + "use_selection1": { + "use": "f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c", + "as": "AliasData" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.Templatelayout", + "description": "Compiler Templatelayout\r\n\r\n@since 3.2.0", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json new file mode 100644 index 0000000..ef925da --- /dev/null +++ b/super-powers.json @@ -0,0 +1,1388 @@ +{ + "caf33c5d-858c-4f9a-894f-ab302ec5445a": { + "name": "FactoryInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/caf33c5d-858c-4f9a-894f-ab302ec5445a\/code.php", + "settings": "src\/caf33c5d-858c-4f9a-894f-ab302ec5445a\/settings.json", + "path": "src\/caf33c5d-858c-4f9a-894f-ab302ec5445a", + "guid": "caf33c5d-858c-4f9a-894f-ab302ec5445a" + }, + "81de8f57-dd9c-4a17-964f-848cd4a0743b": { + "name": "Cryptinterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/81de8f57-dd9c-4a17-964f-848cd4a0743b\/code.php", + "settings": "src\/81de8f57-dd9c-4a17-964f-848cd4a0743b\/settings.json", + "path": "src\/81de8f57-dd9c-4a17-964f-848cd4a0743b", + "guid": "81de8f57-dd9c-4a17-964f-848cd4a0743b" + }, + "2ad31f74-f579-499d-b98b-c4f54fd615dd": { + "name": "LoadInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/2ad31f74-f579-499d-b98b-c4f54fd615dd\/code.php", + "settings": "src\/2ad31f74-f579-499d-b98b-c4f54fd615dd\/settings.json", + "path": "src\/2ad31f74-f579-499d-b98b-c4f54fd615dd", + "guid": "2ad31f74-f579-499d-b98b-c4f54fd615dd" + }, + "ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48": { + "name": "InsertInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48\/code.php", + "settings": "src\/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48\/settings.json", + "path": "src\/ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48", + "guid": "ad12ca1c-d3ce-4e7f-88c5-c6c92bdedc48" + }, + "2da6d6c4-eb29-4d69-8bc2-36d96e916adf": { + "name": "Tableinterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/2da6d6c4-eb29-4d69-8bc2-36d96e916adf\/code.php", + "settings": "src\/2da6d6c4-eb29-4d69-8bc2-36d96e916adf\/settings.json", + "path": "src\/2da6d6c4-eb29-4d69-8bc2-36d96e916adf", + "guid": "2da6d6c4-eb29-4d69-8bc2-36d96e916adf" + }, + "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff": { + "name": "ModelInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff\/code.php", + "settings": "src\/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff\/settings.json", + "path": "src\/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff", + "guid": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff" + }, + "4815e1c7-a433-443d-a112-d1e03d7df84b": { + "name": "Database", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/4815e1c7-a433-443d-a112-d1e03d7df84b\/code.php", + "settings": "src\/4815e1c7-a433-443d-a112-d1e03d7df84b\/settings.json", + "path": "src\/4815e1c7-a433-443d-a112-d1e03d7df84b", + "guid": "4815e1c7-a433-443d-a112-d1e03d7df84b" + }, + "b591855d-d106-4fe5-90ad-8e706f6267cf": { + "name": "Minify", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/b591855d-d106-4fe5-90ad-8e706f6267cf\/code.php", + "settings": "src\/b591855d-d106-4fe5-90ad-8e706f6267cf\/settings.json", + "path": "src\/b591855d-d106-4fe5-90ad-8e706f6267cf", + "guid": "b591855d-d106-4fe5-90ad-8e706f6267cf" + }, + "fa4bf18e-301e-42e3-91fb-6e0096c07adc": { + "name": "Config", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/fa4bf18e-301e-42e3-91fb-6e0096c07adc\/code.php", + "settings": "src\/fa4bf18e-301e-42e3-91fb-6e0096c07adc\/settings.json", + "path": "src\/fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "guid": "fa4bf18e-301e-42e3-91fb-6e0096c07adc" + }, + "33bdc535-0ff1-40c8-bb22-b5d44f1731c4": { + "name": "CustomcodeInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/33bdc535-0ff1-40c8-bb22-b5d44f1731c4\/code.php", + "settings": "src\/33bdc535-0ff1-40c8-bb22-b5d44f1731c4\/settings.json", + "path": "src\/33bdc535-0ff1-40c8-bb22-b5d44f1731c4", + "guid": "33bdc535-0ff1-40c8-bb22-b5d44f1731c4" + }, + "a6cdd935-c038-4a54-8446-54bed87f003c": { + "name": "PlaceholderInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/a6cdd935-c038-4a54-8446-54bed87f003c\/code.php", + "settings": "src\/a6cdd935-c038-4a54-8446-54bed87f003c\/settings.json", + "path": "src\/a6cdd935-c038-4a54-8446-54bed87f003c", + "guid": "a6cdd935-c038-4a54-8446-54bed87f003c" + }, + "500f3a7f-c16d-4dd4-81b2-2df6776b5388": { + "name": "Placefix", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/500f3a7f-c16d-4dd4-81b2-2df6776b5388\/code.php", + "settings": "src\/500f3a7f-c16d-4dd4-81b2-2df6776b5388\/settings.json", + "path": "src\/500f3a7f-c16d-4dd4-81b2-2df6776b5388", + "guid": "500f3a7f-c16d-4dd4-81b2-2df6776b5388" + }, + "06453ada-e370-49f0-b262-e3f5a8ed0c2c": { + "name": "Placeholder", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/06453ada-e370-49f0-b262-e3f5a8ed0c2c\/code.php", + "settings": "src\/06453ada-e370-49f0-b262-e3f5a8ed0c2c\/settings.json", + "path": "src\/06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "guid": "06453ada-e370-49f0-b262-e3f5a8ed0c2c" + }, + "d6592c9b-93a6-41b3-83c7-c43a0a80cb83": { + "name": "LanguageInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/d6592c9b-93a6-41b3-83c7-c43a0a80cb83\/code.php", + "settings": "src\/d6592c9b-93a6-41b3-83c7-c43a0a80cb83\/settings.json", + "path": "src\/d6592c9b-93a6-41b3-83c7-c43a0a80cb83", + "guid": "d6592c9b-93a6-41b3-83c7-c43a0a80cb83" + }, + "8eee7df5-2775-41a9-9372-c46c5939a252": { + "name": "Language", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/8eee7df5-2775-41a9-9372-c46c5939a252\/code.php", + "settings": "src\/8eee7df5-2775-41a9-9372-c46c5939a252\/settings.json", + "path": "src\/8eee7df5-2775-41a9-9372-c46c5939a252", + "guid": "8eee7df5-2775-41a9-9372-c46c5939a252" + }, + "d33b9278-c409-4aec-a047-b72f56712391": { + "name": "Extractor", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Language", + "code": "src\/d33b9278-c409-4aec-a047-b72f56712391\/code.php", + "settings": "src\/d33b9278-c409-4aec-a047-b72f56712391\/settings.json", + "path": "src\/d33b9278-c409-4aec-a047-b72f56712391", + "guid": "d33b9278-c409-4aec-a047-b72f56712391" + }, + "1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a": { + "name": "ExternalInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Customcode", + "code": "src\/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a\/code.php", + "settings": "src\/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a\/settings.json", + "path": "src\/1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a", + "guid": "1fcb13a2-f3f0-4fa8-b8c6-ff9dc546777a" + }, + "1cef0266-99e2-40d8-919f-c2ce32226b0a": { + "name": "External", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode", + "code": "src\/1cef0266-99e2-40d8-919f-c2ce32226b0a\/code.php", + "settings": "src\/1cef0266-99e2-40d8-919f-c2ce32226b0a\/settings.json", + "path": "src\/1cef0266-99e2-40d8-919f-c2ce32226b0a", + "guid": "1cef0266-99e2-40d8-919f-c2ce32226b0a" + }, + "313b43c4-98c3-4f62-9177-2d73ec8eba31": { + "name": "Customcode", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/313b43c4-98c3-4f62-9177-2d73ec8eba31\/code.php", + "settings": "src\/313b43c4-98c3-4f62-9177-2d73ec8eba31\/settings.json", + "path": "src\/313b43c4-98c3-4f62-9177-2d73ec8eba31", + "guid": "313b43c4-98c3-4f62-9177-2d73ec8eba31" + }, + "2cc8517d-1105-4697-9743-048b4b7c089c": { + "name": "GuiInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Customcode", + "code": "src\/2cc8517d-1105-4697-9743-048b4b7c089c\/code.php", + "settings": "src\/2cc8517d-1105-4697-9743-048b4b7c089c\/settings.json", + "path": "src\/2cc8517d-1105-4697-9743-048b4b7c089c", + "guid": "2cc8517d-1105-4697-9743-048b4b7c089c" + }, + "ca111518-e47c-4049-b1b2-cb010f23866f": { + "name": "Reverse", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Placeholder", + "code": "src\/ca111518-e47c-4049-b1b2-cb010f23866f\/code.php", + "settings": "src\/ca111518-e47c-4049-b1b2-cb010f23866f\/settings.json", + "path": "src\/ca111518-e47c-4049-b1b2-cb010f23866f", + "guid": "ca111518-e47c-4049-b1b2-cb010f23866f" + }, + "1bd48df2-4f7e-4581-9fe9-4b54e59105e3": { + "name": "Gui", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode", + "code": "src\/1bd48df2-4f7e-4581-9fe9-4b54e59105e3\/code.php", + "settings": "src\/1bd48df2-4f7e-4581-9fe9-4b54e59105e3\/settings.json", + "path": "src\/1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "guid": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3" + }, + "20ed72b0-fcac-4344-aee1-8a65e3bf221d": { + "name": "EventInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/20ed72b0-fcac-4344-aee1-8a65e3bf221d\/code.php", + "settings": "src\/20ed72b0-fcac-4344-aee1-8a65e3bf221d\/settings.json", + "path": "src\/20ed72b0-fcac-4344-aee1-8a65e3bf221d", + "guid": "20ed72b0-fcac-4344-aee1-8a65e3bf221d" + }, + "4325745f-da1f-4d4d-a591-3189fe8c06e5": { + "name": "HistoryInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/4325745f-da1f-4d4d-a591-3189fe8c06e5\/code.php", + "settings": "src\/4325745f-da1f-4d4d-a591-3189fe8c06e5\/settings.json", + "path": "src\/4325745f-da1f-4d4d-a591-3189fe8c06e5", + "guid": "4325745f-da1f-4d4d-a591-3189fe8c06e5" + }, + "ef687e42-dc25-4423-9dd4-ec6e9743cfb0": { + "name": "DispenserInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Customcode", + "code": "src\/ef687e42-dc25-4423-9dd4-ec6e9743cfb0\/code.php", + "settings": "src\/ef687e42-dc25-4423-9dd4-ec6e9743cfb0\/settings.json", + "path": "src\/ef687e42-dc25-4423-9dd4-ec6e9743cfb0", + "guid": "ef687e42-dc25-4423-9dd4-ec6e9743cfb0" + }, + "797579e8-b272-41ed-91de-428cb0b3e089": { + "name": "Hash", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode", + "code": "src\/797579e8-b272-41ed-91de-428cb0b3e089\/code.php", + "settings": "src\/797579e8-b272-41ed-91de-428cb0b3e089\/settings.json", + "path": "src\/797579e8-b272-41ed-91de-428cb0b3e089", + "guid": "797579e8-b272-41ed-91de-428cb0b3e089" + }, + "a3c515f5-4adf-4eb3-b637-0a1add550da6": { + "name": "LockBaseInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Customcode", + "code": "src\/a3c515f5-4adf-4eb3-b637-0a1add550da6\/code.php", + "settings": "src\/a3c515f5-4adf-4eb3-b637-0a1add550da6\/settings.json", + "path": "src\/a3c515f5-4adf-4eb3-b637-0a1add550da6", + "guid": "a3c515f5-4adf-4eb3-b637-0a1add550da6" + }, + "a68c010b-e92e-47d5-8a44-d23cfddeb6c6": { + "name": "Indent", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/a68c010b-e92e-47d5-8a44-d23cfddeb6c6\/code.php", + "settings": "src\/a68c010b-e92e-47d5-8a44-d23cfddeb6c6\/settings.json", + "path": "src\/a68c010b-e92e-47d5-8a44-d23cfddeb6c6", + "guid": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6" + }, + "7c07c9d6-34cd-4491-934a-ef0a83f414c0": { + "name": "LockBase", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode", + "code": "src\/7c07c9d6-34cd-4491-934a-ef0a83f414c0\/code.php", + "settings": "src\/7c07c9d6-34cd-4491-934a-ef0a83f414c0\/settings.json", + "path": "src\/7c07c9d6-34cd-4491-934a-ef0a83f414c0", + "guid": "7c07c9d6-34cd-4491-934a-ef0a83f414c0" + }, + "f1dc6430-fb54-452e-aa53-ce32ae93db88": { + "name": "Dispenser", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode", + "code": "src\/f1dc6430-fb54-452e-aa53-ce32ae93db88\/code.php", + "settings": "src\/f1dc6430-fb54-452e-aa53-ce32ae93db88\/settings.json", + "path": "src\/f1dc6430-fb54-452e-aa53-ce32ae93db88", + "guid": "f1dc6430-fb54-452e-aa53-ce32ae93db88" + }, + "a356d103-74f3-49ca-8e4f-3bd37746f089": { + "name": "Customcode", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/a356d103-74f3-49ca-8e4f-3bd37746f089\/code.php", + "settings": "src\/a356d103-74f3-49ca-8e4f-3bd37746f089\/settings.json", + "path": "src\/a356d103-74f3-49ca-8e4f-3bd37746f089", + "guid": "a356d103-74f3-49ca-8e4f-3bd37746f089" + }, + "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6": { + "name": "Registry", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6\/code.php", + "settings": "src\/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6\/settings.json", + "path": "src\/e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6", + "guid": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6" + }, + "b9f05dc4-d23a-499a-a826-9749b81818ed": { + "name": "CoreValidationInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Field", + "code": "src\/b9f05dc4-d23a-499a-a826-9749b81818ed\/code.php", + "settings": "src\/b9f05dc4-d23a-499a-a826-9749b81818ed\/settings.json", + "path": "src\/b9f05dc4-d23a-499a-a826-9749b81818ed", + "guid": "b9f05dc4-d23a-499a-a826-9749b81818ed" + }, + "c871fb4a-4c33-4302-bb79-a9cd7ef4a557": { + "name": "Validation", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/c871fb4a-4c33-4302-bb79-a9cd7ef4a557\/code.php", + "settings": "src\/c871fb4a-4c33-4302-bb79-a9cd7ef4a557\/settings.json", + "path": "src\/c871fb4a-4c33-4302-bb79-a9cd7ef4a557", + "guid": "c871fb4a-4c33-4302-bb79-a9cd7ef4a557" + }, + "ce826b66-0f2d-43da-8005-41b8e4cb21ee": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/ce826b66-0f2d-43da-8005-41b8e4cb21ee\/code.php", + "settings": "src\/ce826b66-0f2d-43da-8005-41b8e4cb21ee\/settings.json", + "path": "src\/ce826b66-0f2d-43da-8005-41b8e4cb21ee", + "guid": "ce826b66-0f2d-43da-8005-41b8e4cb21ee" + }, + "8c018533-e967-4bf2-9bd9-9e92966fcb5e": { + "name": "UniqueName", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/8c018533-e967-4bf2-9bd9-9e92966fcb5e\/code.php", + "settings": "src\/8c018533-e967-4bf2-9bd9-9e92966fcb5e\/settings.json", + "path": "src\/8c018533-e967-4bf2-9bd9-9e92966fcb5e", + "guid": "8c018533-e967-4bf2-9bd9-9e92966fcb5e" + }, + "9387215f-a965-4421-acf3-5e8f9d11382f": { + "name": "Name", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/9387215f-a965-4421-acf3-5e8f9d11382f\/code.php", + "settings": "src\/9387215f-a965-4421-acf3-5e8f9d11382f\/settings.json", + "path": "src\/9387215f-a965-4421-acf3-5e8f9d11382f", + "guid": "9387215f-a965-4421-acf3-5e8f9d11382f" + }, + "eb33420d-359d-44a5-852e-613aef1feaae": { + "name": "TypeName", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/eb33420d-359d-44a5-852e-613aef1feaae\/code.php", + "settings": "src\/eb33420d-359d-44a5-852e-613aef1feaae\/settings.json", + "path": "src\/eb33420d-359d-44a5-852e-613aef1feaae", + "guid": "eb33420d-359d-44a5-852e-613aef1feaae" + }, + "d7ba2d5d-10b6-470d-978d-9f91ea65ee75": { + "name": "Field", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/d7ba2d5d-10b6-470d-978d-9f91ea65ee75\/code.php", + "settings": "src\/d7ba2d5d-10b6-470d-978d-9f91ea65ee75\/settings.json", + "path": "src\/d7ba2d5d-10b6-470d-978d-9f91ea65ee75", + "guid": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75" + }, + "f4578c04-a81e-4218-b80d-b0612196eaf0": { + "name": "Filesfolders", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/f4578c04-a81e-4218-b80d-b0612196eaf0\/code.php", + "settings": "src\/f4578c04-a81e-4218-b80d-b0612196eaf0\/settings.json", + "path": "src\/f4578c04-a81e-4218-b80d-b0612196eaf0", + "guid": "f4578c04-a81e-4218-b80d-b0612196eaf0" + }, + "766a9524-37df-4604-91a7-b98a6150ee26": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Joomlaplugin", + "code": "src\/766a9524-37df-4604-91a7-b98a6150ee26\/code.php", + "settings": "src\/766a9524-37df-4604-91a7-b98a6150ee26\/settings.json", + "path": "src\/766a9524-37df-4604-91a7-b98a6150ee26", + "guid": "766a9524-37df-4604-91a7-b98a6150ee26" + }, + "ef97b03e-1018-447a-8d7e-30401b0257bb": { + "name": "Joomlaplugins", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/ef97b03e-1018-447a-8d7e-30401b0257bb\/code.php", + "settings": "src\/ef97b03e-1018-447a-8d7e-30401b0257bb\/settings.json", + "path": "src\/ef97b03e-1018-447a-8d7e-30401b0257bb", + "guid": "ef97b03e-1018-447a-8d7e-30401b0257bb" + }, + "7175c1cd-2071-4cd7-b499-23881e168c3f": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Library", + "code": "src\/7175c1cd-2071-4cd7-b499-23881e168c3f\/code.php", + "settings": "src\/7175c1cd-2071-4cd7-b499-23881e168c3f\/settings.json", + "path": "src\/7175c1cd-2071-4cd7-b499-23881e168c3f", + "guid": "7175c1cd-2071-4cd7-b499-23881e168c3f" + }, + "59895f37-50c8-4af3-9dad-230e18841953": { + "name": "Libraries", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/59895f37-50c8-4af3-9dad-230e18841953\/code.php", + "settings": "src\/59895f37-50c8-4af3-9dad-230e18841953\/settings.json", + "path": "src\/59895f37-50c8-4af3-9dad-230e18841953", + "guid": "59895f37-50c8-4af3-9dad-230e18841953" + }, + "5b021139-dad0-4e9b-882a-2b4d807795af": { + "name": "Selection", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Dynamicget", + "code": "src\/5b021139-dad0-4e9b-882a-2b4d807795af\/code.php", + "settings": "src\/5b021139-dad0-4e9b-882a-2b4d807795af\/settings.json", + "path": "src\/5b021139-dad0-4e9b-882a-2b4d807795af", + "guid": "5b021139-dad0-4e9b-882a-2b4d807795af" + }, + "79740ee8-4d10-4b51-9ff5-18e1386ec1c6": { + "name": "Dynamicget", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/79740ee8-4d10-4b51-9ff5-18e1386ec1c6\/code.php", + "settings": "src\/79740ee8-4d10-4b51-9ff5-18e1386ec1c6\/settings.json", + "path": "src\/79740ee8-4d10-4b51-9ff5-18e1386ec1c6", + "guid": "79740ee8-4d10-4b51-9ff5-18e1386ec1c6" + }, + "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Dynamicget", + "code": "src\/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46\/code.php", + "settings": "src\/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46\/settings.json", + "path": "src\/05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46", + "guid": "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46" + }, + "cb11e8d9-69c2-4095-831c-59908ea402e7": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Joomlamodule", + "code": "src\/cb11e8d9-69c2-4095-831c-59908ea402e7\/code.php", + "settings": "src\/cb11e8d9-69c2-4095-831c-59908ea402e7\/settings.json", + "path": "src\/cb11e8d9-69c2-4095-831c-59908ea402e7", + "guid": "cb11e8d9-69c2-4095-831c-59908ea402e7" + }, + "bfdc4ce5-cb12-4fc6-9023-51cede25edd0": { + "name": "Joomlamodules", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/bfdc4ce5-cb12-4fc6-9023-51cede25edd0\/code.php", + "settings": "src\/bfdc4ce5-cb12-4fc6-9023-51cede25edd0\/settings.json", + "path": "src\/bfdc4ce5-cb12-4fc6-9023-51cede25edd0", + "guid": "bfdc4ce5-cb12-4fc6-9023-51cede25edd0" + }, + "b80296eb-4718-4ed3-894d-69f3ac293733": { + "name": "Updatesql", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/b80296eb-4718-4ed3-894d-69f3ac293733\/code.php", + "settings": "src\/b80296eb-4718-4ed3-894d-69f3ac293733\/settings.json", + "path": "src\/b80296eb-4718-4ed3-894d-69f3ac293733", + "guid": "b80296eb-4718-4ed3-894d-69f3ac293733" + }, + "17a728e9-d6cf-4060-9efb-241b0ff2f981": { + "name": "Historycomponent", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/17a728e9-d6cf-4060-9efb-241b0ff2f981\/code.php", + "settings": "src\/17a728e9-d6cf-4060-9efb-241b0ff2f981\/settings.json", + "path": "src\/17a728e9-d6cf-4060-9efb-241b0ff2f981", + "guid": "17a728e9-d6cf-4060-9efb-241b0ff2f981" + }, + "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7": { + "name": "Loader", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7\/code.php", + "settings": "src\/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7\/settings.json", + "path": "src\/0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7", + "guid": "0d71c2d9-2fc0-4c20-82c5-43c46b0fc6f7" + }, + "f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Alias", + "code": "src\/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c\/code.php", + "settings": "src\/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c\/settings.json", + "path": "src\/f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c", + "guid": "f05ac28d-44f4-4e6d-a1be-5c8ae6baf69c" + }, + "39ea8150-f124-4e47-909d-641bf1c96d5e": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Templatelayout", + "code": "src\/39ea8150-f124-4e47-909d-641bf1c96d5e\/code.php", + "settings": "src\/39ea8150-f124-4e47-909d-641bf1c96d5e\/settings.json", + "path": "src\/39ea8150-f124-4e47-909d-641bf1c96d5e", + "guid": "39ea8150-f124-4e47-909d-641bf1c96d5e" + }, + "29455d3b-df2b-4e41-8684-1608060e37a4": { + "name": "Javascriptcustomview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/29455d3b-df2b-4e41-8684-1608060e37a4\/code.php", + "settings": "src\/29455d3b-df2b-4e41-8684-1608060e37a4\/settings.json", + "path": "src\/29455d3b-df2b-4e41-8684-1608060e37a4", + "guid": "29455d3b-df2b-4e41-8684-1608060e37a4" + }, + "3283a89c-329a-47fb-a011-0df6c31a5c73": { + "name": "Csscustomview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/3283a89c-329a-47fb-a011-0df6c31a5c73\/code.php", + "settings": "src\/3283a89c-329a-47fb-a011-0df6c31a5c73\/settings.json", + "path": "src\/3283a89c-329a-47fb-a011-0df6c31a5c73", + "guid": "3283a89c-329a-47fb-a011-0df6c31a5c73" + }, + "489da602-27c7-418c-bf59-1d45ad42bdcc": { + "name": "Phpcustomview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/489da602-27c7-418c-bf59-1d45ad42bdcc\/code.php", + "settings": "src\/489da602-27c7-418c-bf59-1d45ad42bdcc\/settings.json", + "path": "src\/489da602-27c7-418c-bf59-1d45ad42bdcc", + "guid": "489da602-27c7-418c-bf59-1d45ad42bdcc" + }, + "592aed4e-2c5f-4fc5-8f7a-409203d1af82": { + "name": "Ajaxcustomview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/592aed4e-2c5f-4fc5-8f7a-409203d1af82\/code.php", + "settings": "src\/592aed4e-2c5f-4fc5-8f7a-409203d1af82\/settings.json", + "path": "src\/592aed4e-2c5f-4fc5-8f7a-409203d1af82", + "guid": "592aed4e-2c5f-4fc5-8f7a-409203d1af82" + }, + "ebe3287d-bfa0-4519-b663-f442f4dea432": { + "name": "Custombuttons", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/ebe3287d-bfa0-4519-b663-f442f4dea432\/code.php", + "settings": "src\/ebe3287d-bfa0-4519-b663-f442f4dea432\/settings.json", + "path": "src\/ebe3287d-bfa0-4519-b663-f442f4dea432", + "guid": "ebe3287d-bfa0-4519-b663-f442f4dea432" + }, + "f02fb1df-f4b6-4be1-9595-2e72084a5e6e": { + "name": "Unique", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/f02fb1df-f4b6-4be1-9595-2e72084a5e6e\/code.php", + "settings": "src\/f02fb1df-f4b6-4be1-9595-2e72084a5e6e\/settings.json", + "path": "src\/f02fb1df-f4b6-4be1-9595-2e72084a5e6e", + "guid": "f02fb1df-f4b6-4be1-9595-2e72084a5e6e" + }, + "3b6895da-d9eb-4164-90b1-4632a4cc2474": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customview", + "code": "src\/3b6895da-d9eb-4164-90b1-4632a4cc2474\/code.php", + "settings": "src\/3b6895da-d9eb-4164-90b1-4632a4cc2474\/settings.json", + "path": "src\/3b6895da-d9eb-4164-90b1-4632a4cc2474", + "guid": "3b6895da-d9eb-4164-90b1-4632a4cc2474" + }, + "e0e24173-a808-4dd5-8e26-de971d014f86": { + "name": "Customadminviews", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/e0e24173-a808-4dd5-8e26-de971d014f86\/code.php", + "settings": "src\/e0e24173-a808-4dd5-8e26-de971d014f86\/settings.json", + "path": "src\/e0e24173-a808-4dd5-8e26-de971d014f86", + "guid": "e0e24173-a808-4dd5-8e26-de971d014f86" + }, + "e0075978-315d-4807-8507-ce9c6922a885": { + "name": "Siteviews", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/e0075978-315d-4807-8507-ce9c6922a885\/code.php", + "settings": "src\/e0075978-315d-4807-8507-ce9c6922a885\/settings.json", + "path": "src\/e0075978-315d-4807-8507-ce9c6922a885", + "guid": "e0075978-315d-4807-8507-ce9c6922a885" + }, + "0dabc67c-abec-4541-82bf-279abd3c9be1": { + "name": "Permissions", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/0dabc67c-abec-4541-82bf-279abd3c9be1\/code.php", + "settings": "src\/0dabc67c-abec-4541-82bf-279abd3c9be1\/settings.json", + "path": "src\/0dabc67c-abec-4541-82bf-279abd3c9be1", + "guid": "0dabc67c-abec-4541-82bf-279abd3c9be1" + }, + "6dfbf568-f3cd-4ea7-af04-6859447b5462": { + "name": "Historyadminview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/6dfbf568-f3cd-4ea7-af04-6859447b5462\/code.php", + "settings": "src\/6dfbf568-f3cd-4ea7-af04-6859447b5462\/settings.json", + "path": "src\/6dfbf568-f3cd-4ea7-af04-6859447b5462", + "guid": "6dfbf568-f3cd-4ea7-af04-6859447b5462" + }, + "35191b0c-f7f3-44d6-8ec1-c816b997bd4e": { + "name": "Mysqlsettings", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/35191b0c-f7f3-44d6-8ec1-c816b997bd4e\/code.php", + "settings": "src\/35191b0c-f7f3-44d6-8ec1-c816b997bd4e\/settings.json", + "path": "src\/35191b0c-f7f3-44d6-8ec1-c816b997bd4e", + "guid": "35191b0c-f7f3-44d6-8ec1-c816b997bd4e" + }, + "a6e1227c-1efe-407d-84ef-03c6989a6a88": { + "name": "Sqldump", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/a6e1227c-1efe-407d-84ef-03c6989a6a88\/code.php", + "settings": "src\/a6e1227c-1efe-407d-84ef-03c6989a6a88\/settings.json", + "path": "src\/a6e1227c-1efe-407d-84ef-03c6989a6a88", + "guid": "a6e1227c-1efe-407d-84ef-03c6989a6a88" + }, + "d4b418a7-bf9b-4768-969d-e07c36916fd2": { + "name": "Sql", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/d4b418a7-bf9b-4768-969d-e07c36916fd2\/code.php", + "settings": "src\/d4b418a7-bf9b-4768-969d-e07c36916fd2\/settings.json", + "path": "src\/d4b418a7-bf9b-4768-969d-e07c36916fd2", + "guid": "d4b418a7-bf9b-4768-969d-e07c36916fd2" + }, + "5f8e8fa6-3793-44af-882d-9cfb209434e9": { + "name": "Customalias", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/5f8e8fa6-3793-44af-882d-9cfb209434e9\/code.php", + "settings": "src\/5f8e8fa6-3793-44af-882d-9cfb209434e9\/settings.json", + "path": "src\/5f8e8fa6-3793-44af-882d-9cfb209434e9", + "guid": "5f8e8fa6-3793-44af-882d-9cfb209434e9" + }, + "4f575bd6-de97-41f8-80d6-259c8a6dd9ad": { + "name": "Ajaxadmin", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/4f575bd6-de97-41f8-80d6-259c8a6dd9ad\/code.php", + "settings": "src\/4f575bd6-de97-41f8-80d6-259c8a6dd9ad\/settings.json", + "path": "src\/4f575bd6-de97-41f8-80d6-259c8a6dd9ad", + "guid": "4f575bd6-de97-41f8-80d6-259c8a6dd9ad" + }, + "037c7274-fb16-455d-989a-bf1da022620b": { + "name": "Customimportscripts", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/037c7274-fb16-455d-989a-bf1da022620b\/code.php", + "settings": "src\/037c7274-fb16-455d-989a-bf1da022620b\/settings.json", + "path": "src\/037c7274-fb16-455d-989a-bf1da022620b", + "guid": "037c7274-fb16-455d-989a-bf1da022620b" + }, + "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe": { + "name": "Phpadminview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe\/code.php", + "settings": "src\/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe\/settings.json", + "path": "src\/c20a63e0-0eeb-4424-9d08-b1bf0f049dfe", + "guid": "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe" + }, + "e79842d3-51b7-4282-93c7-3487cd8b61ab": { + "name": "Cssadminview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/e79842d3-51b7-4282-93c7-3487cd8b61ab\/code.php", + "settings": "src\/e79842d3-51b7-4282-93c7-3487cd8b61ab\/settings.json", + "path": "src\/e79842d3-51b7-4282-93c7-3487cd8b61ab", + "guid": "e79842d3-51b7-4282-93c7-3487cd8b61ab" + }, + "dfd3c893-0296-46eb-9ae4-a0348713cd8f": { + "name": "Javascriptadminview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/dfd3c893-0296-46eb-9ae4-a0348713cd8f\/code.php", + "settings": "src\/dfd3c893-0296-46eb-9ae4-a0348713cd8f\/settings.json", + "path": "src\/dfd3c893-0296-46eb-9ae4-a0348713cd8f", + "guid": "dfd3c893-0296-46eb-9ae4-a0348713cd8f" + }, + "ae1fa148-91be-4f80-89a9-69d91ba9d575": { + "name": "Linkedviews", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/ae1fa148-91be-4f80-89a9-69d91ba9d575\/code.php", + "settings": "src\/ae1fa148-91be-4f80-89a9-69d91ba9d575\/settings.json", + "path": "src\/ae1fa148-91be-4f80-89a9-69d91ba9d575", + "guid": "ae1fa148-91be-4f80-89a9-69d91ba9d575" + }, + "a8eb2fb1-88ed-4af8-842d-898eb915b588": { + "name": "Relations", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/a8eb2fb1-88ed-4af8-842d-898eb915b588\/code.php", + "settings": "src\/a8eb2fb1-88ed-4af8-842d-898eb915b588\/settings.json", + "path": "src\/a8eb2fb1-88ed-4af8-842d-898eb915b588", + "guid": "a8eb2fb1-88ed-4af8-842d-898eb915b588" + }, + "7a5fd3f3-199e-43ba-a8e8-f473d6c030ec": { + "name": "FieldHelper", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec\/code.php", + "settings": "src\/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec\/settings.json", + "path": "src\/7a5fd3f3-199e-43ba-a8e8-f473d6c030ec", + "guid": "7a5fd3f3-199e-43ba-a8e8-f473d6c030ec" + }, + "55e61314-ba10-4e2b-92dd-b44adebabce9": { + "name": "Conditions", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/55e61314-ba10-4e2b-92dd-b44adebabce9\/code.php", + "settings": "src\/55e61314-ba10-4e2b-92dd-b44adebabce9\/settings.json", + "path": "src\/55e61314-ba10-4e2b-92dd-b44adebabce9", + "guid": "55e61314-ba10-4e2b-92dd-b44adebabce9" + }, + "e6a64c41-405e-4bbc-9722-27402c22bbea": { + "name": "Fields", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/e6a64c41-405e-4bbc-9722-27402c22bbea\/code.php", + "settings": "src\/e6a64c41-405e-4bbc-9722-27402c22bbea\/settings.json", + "path": "src\/e6a64c41-405e-4bbc-9722-27402c22bbea", + "guid": "e6a64c41-405e-4bbc-9722-27402c22bbea" + }, + "143ac6ea-b64f-4331-9a97-31e3fce2bb69": { + "name": "Tabs", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/143ac6ea-b64f-4331-9a97-31e3fce2bb69\/code.php", + "settings": "src\/143ac6ea-b64f-4331-9a97-31e3fce2bb69\/settings.json", + "path": "src\/143ac6ea-b64f-4331-9a97-31e3fce2bb69", + "guid": "143ac6ea-b64f-4331-9a97-31e3fce2bb69" + }, + "fa8c1125-d370-4cb6-a7ff-eb32193c198c": { + "name": "Customtabs", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/fa8c1125-d370-4cb6-a7ff-eb32193c198c\/code.php", + "settings": "src\/fa8c1125-d370-4cb6-a7ff-eb32193c198c\/settings.json", + "path": "src\/fa8c1125-d370-4cb6-a7ff-eb32193c198c", + "guid": "fa8c1125-d370-4cb6-a7ff-eb32193c198c" + }, + "cef2815b-f72b-402a-b769-f028f676692d": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Adminview", + "code": "src\/cef2815b-f72b-402a-b769-f028f676692d\/code.php", + "settings": "src\/cef2815b-f72b-402a-b769-f028f676692d\/settings.json", + "path": "src\/cef2815b-f72b-402a-b769-f028f676692d", + "guid": "cef2815b-f72b-402a-b769-f028f676692d" + }, + "cebdcccb-24c5-46db-92de-63453852dcb8": { + "name": "Adminviews", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/cebdcccb-24c5-46db-92de-63453852dcb8\/code.php", + "settings": "src\/cebdcccb-24c5-46db-92de-63453852dcb8\/settings.json", + "path": "src\/cebdcccb-24c5-46db-92de-63453852dcb8", + "guid": "cebdcccb-24c5-46db-92de-63453852dcb8" + }, + "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26": { + "name": "Sqltweaking", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26\/code.php", + "settings": "src\/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26\/settings.json", + "path": "src\/e50cbac5-9c9d-4fd4-aa7a-5e830719ed26", + "guid": "e50cbac5-9c9d-4fd4-aa7a-5e830719ed26" + }, + "af5beb21-214a-44f6-9090-7ea24c22e649": { + "name": "Whmcs", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/af5beb21-214a-44f6-9090-7ea24c22e649\/code.php", + "settings": "src\/af5beb21-214a-44f6-9090-7ea24c22e649\/settings.json", + "path": "src\/af5beb21-214a-44f6-9090-7ea24c22e649", + "guid": "af5beb21-214a-44f6-9090-7ea24c22e649" + }, + "9127e428-5dee-46cb-b3a9-ab5b91ea6df3": { + "name": "Modifieddate", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/9127e428-5dee-46cb-b3a9-ab5b91ea6df3\/code.php", + "settings": "src\/9127e428-5dee-46cb-b3a9-ab5b91ea6df3\/settings.json", + "path": "src\/9127e428-5dee-46cb-b3a9-ab5b91ea6df3", + "guid": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3" + }, + "53cf9828-7ad4-4856-aac1-7c4c67bd3121": { + "name": "Createdate", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/53cf9828-7ad4-4856-aac1-7c4c67bd3121\/code.php", + "settings": "src\/53cf9828-7ad4-4856-aac1-7c4c67bd3121\/settings.json", + "path": "src\/53cf9828-7ad4-4856-aac1-7c4c67bd3121", + "guid": "53cf9828-7ad4-4856-aac1-7c4c67bd3121" + }, + "1d0fd857-12ec-4f47-ab1c-124d85748e24": { + "name": "Updateserver", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Model", + "code": "src\/1d0fd857-12ec-4f47-ab1c-124d85748e24\/code.php", + "settings": "src\/1d0fd857-12ec-4f47-ab1c-124d85748e24\/settings.json", + "path": "src\/1d0fd857-12ec-4f47-ab1c-124d85748e24", + "guid": "1d0fd857-12ec-4f47-ab1c-124d85748e24" + }, + "0601fee8-d51e-4af0-9ad3-b5f8700c4a45": { + "name": "Model", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/0601fee8-d51e-4af0-9ad3-b5f8700c4a45\/code.php", + "settings": "src\/0601fee8-d51e-4af0-9ad3-b5f8700c4a45\/settings.json", + "path": "src\/0601fee8-d51e-4af0-9ad3-b5f8700c4a45", + "guid": "0601fee8-d51e-4af0-9ad3-b5f8700c4a45" + }, + "fbc58009-fa16-4d49-a0dd-419c3b62d42f": { + "name": "Mapperdoubleinterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/fbc58009-fa16-4d49-a0dd-419c3b62d42f\/code.php", + "settings": "src\/fbc58009-fa16-4d49-a0dd-419c3b62d42f\/settings.json", + "path": "src\/fbc58009-fa16-4d49-a0dd-419c3b62d42f", + "guid": "fbc58009-fa16-4d49-a0dd-419c3b62d42f" + }, + "78527c29-24ad-4735-ad4c-ec33a4952d9b": { + "name": "Mappersingleinterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/78527c29-24ad-4735-ad4c-ec33a4952d9b\/code.php", + "settings": "src\/78527c29-24ad-4735-ad4c-ec33a4952d9b\/settings.json", + "path": "src\/78527c29-24ad-4735-ad4c-ec33a4952d9b", + "guid": "78527c29-24ad-4735-ad4c-ec33a4952d9b" + }, + "adfbe68a-6d22-43e5-aee8-2787e8c47e75": { + "name": "Content", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/adfbe68a-6d22-43e5-aee8-2787e8c47e75\/code.php", + "settings": "src\/adfbe68a-6d22-43e5-aee8-2787e8c47e75\/settings.json", + "path": "src\/adfbe68a-6d22-43e5-aee8-2787e8c47e75", + "guid": "adfbe68a-6d22-43e5-aee8-2787e8c47e75" + }, + "23f2ca33-440a-4941-8e9a-4bc67522c0cb": { + "name": "Mapper", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb\/code.php", + "settings": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb\/settings.json", + "path": "src\/23f2ca33-440a-4941-8e9a-4bc67522c0cb", + "guid": "23f2ca33-440a-4941-8e9a-4bc67522c0cb" + }, + "ea5ed06e-72ae-4906-9167-1cc0fa32fe69": { + "name": "Compiler", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/ea5ed06e-72ae-4906-9167-1cc0fa32fe69\/code.php", + "settings": "src\/ea5ed06e-72ae-4906-9167-1cc0fa32fe69\/settings.json", + "path": "src\/ea5ed06e-72ae-4906-9167-1cc0fa32fe69", + "guid": "ea5ed06e-72ae-4906-9167-1cc0fa32fe69" + }, + "4b86f62e-ce41-4325-a11a-08148807d0df": { + "name": "Event", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaThree", + "code": "src\/4b86f62e-ce41-4325-a11a-08148807d0df\/code.php", + "settings": "src\/4b86f62e-ce41-4325-a11a-08148807d0df\/settings.json", + "path": "src\/4b86f62e-ce41-4325-a11a-08148807d0df", + "guid": "4b86f62e-ce41-4325-a11a-08148807d0df" + }, + "b94aaedb-6774-4739-a63f-8f87141a85db": { + "name": "Event", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/b94aaedb-6774-4739-a63f-8f87141a85db\/code.php", + "settings": "src\/b94aaedb-6774-4739-a63f-8f87141a85db\/settings.json", + "path": "src\/b94aaedb-6774-4739-a63f-8f87141a85db", + "guid": "b94aaedb-6774-4739-a63f-8f87141a85db" + }, + "87db51b9-1126-4c21-858b-53dbd3a68b61": { + "name": "History", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaThree", + "code": "src\/87db51b9-1126-4c21-858b-53dbd3a68b61\/code.php", + "settings": "src\/87db51b9-1126-4c21-858b-53dbd3a68b61\/settings.json", + "path": "src\/87db51b9-1126-4c21-858b-53dbd3a68b61", + "guid": "87db51b9-1126-4c21-858b-53dbd3a68b61" + }, + "63782f74-7b03-4745-aa40-0adf8ed4e704": { + "name": "History", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/63782f74-7b03-4745-aa40-0adf8ed4e704\/code.php", + "settings": "src\/63782f74-7b03-4745-aa40-0adf8ed4e704\/settings.json", + "path": "src\/63782f74-7b03-4745-aa40-0adf8ed4e704", + "guid": "63782f74-7b03-4745-aa40-0adf8ed4e704" + }, + "9f00e793-86f8-4ef9-b775-a3eb129f83c0": { + "name": "Language", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/9f00e793-86f8-4ef9-b775-a3eb129f83c0\/code.php", + "settings": "src\/9f00e793-86f8-4ef9-b775-a3eb129f83c0\/settings.json", + "path": "src\/9f00e793-86f8-4ef9-b775-a3eb129f83c0", + "guid": "9f00e793-86f8-4ef9-b775-a3eb129f83c0" + }, + "2f7b1998-bb93-4055-ae82-aa659ce8a37f": { + "name": "Placeholder", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/2f7b1998-bb93-4055-ae82-aa659ce8a37f\/code.php", + "settings": "src\/2f7b1998-bb93-4055-ae82-aa659ce8a37f\/settings.json", + "path": "src\/2f7b1998-bb93-4055-ae82-aa659ce8a37f", + "guid": "2f7b1998-bb93-4055-ae82-aa659ce8a37f" + }, + "6da2afa5-6087-46dd-80a0-74c6434bcb18": { + "name": "ExtractorInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Customcode", + "code": "src\/6da2afa5-6087-46dd-80a0-74c6434bcb18\/code.php", + "settings": "src\/6da2afa5-6087-46dd-80a0-74c6434bcb18\/settings.json", + "path": "src\/6da2afa5-6087-46dd-80a0-74c6434bcb18", + "guid": "6da2afa5-6087-46dd-80a0-74c6434bcb18" + }, + "97698747-c2ce-4e09-a470-acf6d8e86281": { + "name": "PlaceholderInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Component", + "code": "src\/97698747-c2ce-4e09-a470-acf6d8e86281\/code.php", + "settings": "src\/97698747-c2ce-4e09-a470-acf6d8e86281\/settings.json", + "path": "src\/97698747-c2ce-4e09-a470-acf6d8e86281", + "guid": "97698747-c2ce-4e09-a470-acf6d8e86281" + }, + "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb": { + "name": "Placeholder", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb\/code.php", + "settings": "src\/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb\/settings.json", + "path": "src\/aecc17ba-0b0f-4e5c-ae43-71be063a3dcb", + "guid": "aecc17ba-0b0f-4e5c-ae43-71be063a3dcb" + }, + "053803e6-1251-4aed-aefe-46a8e84198d2": { + "name": "Paths", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode\\Extractor", + "code": "src\/053803e6-1251-4aed-aefe-46a8e84198d2\/code.php", + "settings": "src\/053803e6-1251-4aed-aefe-46a8e84198d2\/settings.json", + "path": "src\/053803e6-1251-4aed-aefe-46a8e84198d2", + "guid": "053803e6-1251-4aed-aefe-46a8e84198d2" + }, + "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f": { + "name": "Pathfix", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f\/code.php", + "settings": "src\/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f\/settings.json", + "path": "src\/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f", + "guid": "cdc9b06d-8333-4fa7-ab4d-b810dd90f95f" + }, + "01411bb1-fdd6-4cca-84d7-1b62d93c70c1": { + "name": "Extractor", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Customcode", + "code": "src\/01411bb1-fdd6-4cca-84d7-1b62d93c70c1\/code.php", + "settings": "src\/01411bb1-fdd6-4cca-84d7-1b62d93c70c1\/settings.json", + "path": "src\/01411bb1-fdd6-4cca-84d7-1b62d93c70c1", + "guid": "01411bb1-fdd6-4cca-84d7-1b62d93c70c1" + }, + "a74ac3b7-bb79-4639-8f14-54a8021be68b": { + "name": "Customcode", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/a74ac3b7-bb79-4639-8f14-54a8021be68b\/code.php", + "settings": "src\/a74ac3b7-bb79-4639-8f14-54a8021be68b\/settings.json", + "path": "src\/a74ac3b7-bb79-4639-8f14-54a8021be68b", + "guid": "a74ac3b7-bb79-4639-8f14-54a8021be68b" + }, + "1133c2d7-ba7e-4c95-8cde-01f084d04682": { + "name": "PowerInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/1133c2d7-ba7e-4c95-8cde-01f084d04682\/code.php", + "settings": "src\/1133c2d7-ba7e-4c95-8cde-01f084d04682\/settings.json", + "path": "src\/1133c2d7-ba7e-4c95-8cde-01f084d04682", + "guid": "1133c2d7-ba7e-4c95-8cde-01f084d04682" + }, + "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1": { + "name": "Power", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1\/code.php", + "settings": "src\/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1\/settings.json", + "path": "src\/b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", + "guid": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1" + }, + "4e6ff11d-bebf-42f5-8fd7-b2f882857222": { + "name": "Line", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/4e6ff11d-bebf-42f5-8fd7-b2f882857222\/code.php", + "settings": "src\/4e6ff11d-bebf-42f5-8fd7-b2f882857222\/settings.json", + "path": "src\/4e6ff11d-bebf-42f5-8fd7-b2f882857222", + "guid": "4e6ff11d-bebf-42f5-8fd7-b2f882857222" + }, + "6e64917c-d687-4ef3-a655-811319f5a81e": { + "name": "Autoloader", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power", + "code": "src\/6e64917c-d687-4ef3-a655-811319f5a81e\/code.php", + "settings": "src\/6e64917c-d687-4ef3-a655-811319f5a81e\/settings.json", + "path": "src\/6e64917c-d687-4ef3-a655-811319f5a81e", + "guid": "6e64917c-d687-4ef3-a655-811319f5a81e" + }, + "95d0e03f-24fd-4412-bc2e-f0899fcc3205": { + "name": "Parser", + "type": "final class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power", + "code": "src\/95d0e03f-24fd-4412-bc2e-f0899fcc3205\/code.php", + "settings": "src\/95d0e03f-24fd-4412-bc2e-f0899fcc3205\/settings.json", + "path": "src\/95d0e03f-24fd-4412-bc2e-f0899fcc3205", + "guid": "95d0e03f-24fd-4412-bc2e-f0899fcc3205" + }, + "ff5e9e63-86d0-4691-ab59-d4b9d9154096": { + "name": "Plantuml", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power", + "code": "src\/ff5e9e63-86d0-4691-ab59-d4b9d9154096\/code.php", + "settings": "src\/ff5e9e63-86d0-4691-ab59-d4b9d9154096\/settings.json", + "path": "src\/ff5e9e63-86d0-4691-ab59-d4b9d9154096", + "guid": "ff5e9e63-86d0-4691-ab59-d4b9d9154096" + }, + "efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5": { + "name": "Readme", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power\\Repo", + "code": "src\/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5\/code.php", + "settings": "src\/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5\/settings.json", + "path": "src\/efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5", + "guid": "efb1d0f8-2d14-4d2c-8b5f-4fcdd9df45a5" + }, + "0d08c583-04d5-454e-b756-48ca05e1651a": { + "name": "Readme", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power\\Repos", + "code": "src\/0d08c583-04d5-454e-b756-48ca05e1651a\/code.php", + "settings": "src\/0d08c583-04d5-454e-b756-48ca05e1651a\/settings.json", + "path": "src\/0d08c583-04d5-454e-b756-48ca05e1651a", + "guid": "0d08c583-04d5-454e-b756-48ca05e1651a" + }, + "0419081e-4cb3-4c65-8c6a-ffe941fb0f1c": { + "name": "Infusion", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power", + "code": "src\/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c\/code.php", + "settings": "src\/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c\/settings.json", + "path": "src\/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c", + "guid": "0419081e-4cb3-4c65-8c6a-ffe941fb0f1c" + }, + "e6d871a6-bbe7-497d-af01-68f6bb9a87f4": { + "name": "Counter", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/e6d871a6-bbe7-497d-af01-68f6bb9a87f4\/code.php", + "settings": "src\/e6d871a6-bbe7-497d-af01-68f6bb9a87f4\/settings.json", + "path": "src\/e6d871a6-bbe7-497d-af01-68f6bb9a87f4", + "guid": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4" + }, + "ef9578e5-4c9d-46bf-866f-3a94bdc7b753": { + "name": "Data", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/ef9578e5-4c9d-46bf-866f-3a94bdc7b753\/code.php", + "settings": "src\/ef9578e5-4c9d-46bf-866f-3a94bdc7b753\/settings.json", + "path": "src\/ef9578e5-4c9d-46bf-866f-3a94bdc7b753", + "guid": "ef9578e5-4c9d-46bf-866f-3a94bdc7b753" + }, + "e2472b22-a329-44d8-b4a2-ae3ba99e17a0": { + "name": "Component", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/e2472b22-a329-44d8-b4a2-ae3ba99e17a0\/code.php", + "settings": "src\/e2472b22-a329-44d8-b4a2-ae3ba99e17a0\/settings.json", + "path": "src\/e2472b22-a329-44d8-b4a2-ae3ba99e17a0", + "guid": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0" + }, + "6f20369a-8536-4870-a1a3-cda254c939c8": { + "name": "Paths", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/6f20369a-8536-4870-a1a3-cda254c939c8\/code.php", + "settings": "src\/6f20369a-8536-4870-a1a3-cda254c939c8\/settings.json", + "path": "src\/6f20369a-8536-4870-a1a3-cda254c939c8", + "guid": "6f20369a-8536-4870-a1a3-cda254c939c8" + }, + "5c75b455-3d4c-452a-867e-e90424a64c88": { + "name": "File", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/5c75b455-3d4c-452a-867e-e90424a64c88\/code.php", + "settings": "src\/5c75b455-3d4c-452a-867e-e90424a64c88\/settings.json", + "path": "src\/5c75b455-3d4c-452a-867e-e90424a64c88", + "guid": "5c75b455-3d4c-452a-867e-e90424a64c88" + }, + "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1": { + "name": "Folder", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1\/code.php", + "settings": "src\/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1\/settings.json", + "path": "src\/6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1", + "guid": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1" + }, + "1d967151-7c20-4ca7-9400-65233cdcd4db": { + "name": "Files", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/1d967151-7c20-4ca7-9400-65233cdcd4db\/code.php", + "settings": "src\/1d967151-7c20-4ca7-9400-65233cdcd4db\/settings.json", + "path": "src\/1d967151-7c20-4ca7-9400-65233cdcd4db", + "guid": "1d967151-7c20-4ca7-9400-65233cdcd4db" + }, + "324566de-0f7d-4b6e-9caf-8424d55013ae": { + "name": "Structure", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power", + "code": "src\/324566de-0f7d-4b6e-9caf-8424d55013ae\/code.php", + "settings": "src\/324566de-0f7d-4b6e-9caf-8424d55013ae\/settings.json", + "path": "src\/324566de-0f7d-4b6e-9caf-8424d55013ae", + "guid": "324566de-0f7d-4b6e-9caf-8424d55013ae" + }, + "de01527a-6586-46ea-92e7-11ea3de1cedb": { + "name": "Power", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/de01527a-6586-46ea-92e7-11ea3de1cedb\/code.php", + "settings": "src\/de01527a-6586-46ea-92e7-11ea3de1cedb\/settings.json", + "path": "src\/de01527a-6586-46ea-92e7-11ea3de1cedb", + "guid": "de01527a-6586-46ea-92e7-11ea3de1cedb" + }, + "268b85ef-49f3-4c39-8187-bb12e38d19ee": { + "name": "Dynamicpath", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/268b85ef-49f3-4c39-8187-bb12e38d19ee\/code.php", + "settings": "src\/268b85ef-49f3-4c39-8187-bb12e38d19ee\/settings.json", + "path": "src\/268b85ef-49f3-4c39-8187-bb12e38d19ee", + "guid": "268b85ef-49f3-4c39-8187-bb12e38d19ee" + }, + "63dabe82-0f4a-4ade-9851-8518ade23de2": { + "name": "Settings", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/63dabe82-0f4a-4ade-9851-8518ade23de2\/code.php", + "settings": "src\/63dabe82-0f4a-4ade-9851-8518ade23de2\/settings.json", + "path": "src\/63dabe82-0f4a-4ade-9851-8518ade23de2", + "guid": "63dabe82-0f4a-4ade-9851-8518ade23de2" + }, + "cfe62a32-8818-4bfb-8751-2f1e109b5336": { + "name": "Dashboard", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/cfe62a32-8818-4bfb-8751-2f1e109b5336\/code.php", + "settings": "src\/cfe62a32-8818-4bfb-8751-2f1e109b5336\/settings.json", + "path": "src\/cfe62a32-8818-4bfb-8751-2f1e109b5336", + "guid": "cfe62a32-8818-4bfb-8751-2f1e109b5336" + }, + "6c89c663-78f5-4078-9fac-7047f2eaaf96": { + "name": "Structure", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/6c89c663-78f5-4078-9fac-7047f2eaaf96\/code.php", + "settings": "src\/6c89c663-78f5-4078-9fac-7047f2eaaf96\/settings.json", + "path": "src\/6c89c663-78f5-4078-9fac-7047f2eaaf96", + "guid": "6c89c663-78f5-4078-9fac-7047f2eaaf96" + }, + "673954d3-78d3-445a-b99f-4b40d617c882": { + "name": "Structuresingle", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/673954d3-78d3-445a-b99f-4b40d617c882\/code.php", + "settings": "src\/673954d3-78d3-445a-b99f-4b40d617c882\/settings.json", + "path": "src\/673954d3-78d3-445a-b99f-4b40d617c882", + "guid": "673954d3-78d3-445a-b99f-4b40d617c882" + }, + "1efdded5-d6c8-452c-8f37-0374483a7b3f": { + "name": "Structure", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Utilities", + "code": "src\/1efdded5-d6c8-452c-8f37-0374483a7b3f\/code.php", + "settings": "src\/1efdded5-d6c8-452c-8f37-0374483a7b3f\/settings.json", + "path": "src\/1efdded5-d6c8-452c-8f37-0374483a7b3f", + "guid": "1efdded5-d6c8-452c-8f37-0374483a7b3f" + }, + "b69a23db-0a62-4840-a9c5-b2d8d63ecc6c": { + "name": "Structuremultiple", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Component", + "code": "src\/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c\/code.php", + "settings": "src\/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c\/settings.json", + "path": "src\/b69a23db-0a62-4840-a9c5-b2d8d63ecc6c", + "guid": "b69a23db-0a62-4840-a9c5-b2d8d63ecc6c" + }, + "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c": { + "name": "Component", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c\/code.php", + "settings": "src\/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c\/settings.json", + "path": "src\/8a63e87b-b39b-4a15-8044-9b2a2f4fb61c", + "guid": "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c" + }, + "2dd1289a-4000-43cc-8c62-77ff32de56bf": { + "name": "Adminview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/2dd1289a-4000-43cc-8c62-77ff32de56bf\/code.php", + "settings": "src\/2dd1289a-4000-43cc-8c62-77ff32de56bf\/settings.json", + "path": "src\/2dd1289a-4000-43cc-8c62-77ff32de56bf", + "guid": "2dd1289a-4000-43cc-8c62-77ff32de56bf" + }, + "d3ce5763-4d00-4245-a175-54fc2e80e9b7": { + "name": "Structure", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Library", + "code": "src\/d3ce5763-4d00-4245-a175-54fc2e80e9b7\/code.php", + "settings": "src\/d3ce5763-4d00-4245-a175-54fc2e80e9b7\/settings.json", + "path": "src\/d3ce5763-4d00-4245-a175-54fc2e80e9b7", + "guid": "d3ce5763-4d00-4245-a175-54fc2e80e9b7" + }, + "253317c7-3c3b-48a0-aec8-8af5e7a86504": { + "name": "Library", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/253317c7-3c3b-48a0-aec8-8af5e7a86504\/code.php", + "settings": "src\/253317c7-3c3b-48a0-aec8-8af5e7a86504\/settings.json", + "path": "src\/253317c7-3c3b-48a0-aec8-8af5e7a86504", + "guid": "253317c7-3c3b-48a0-aec8-8af5e7a86504" + }, + "87faa133-4cac-4816-ae41-5c3f9a2f76aa": { + "name": "Customview", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/87faa133-4cac-4816-ae41-5c3f9a2f76aa\/code.php", + "settings": "src\/87faa133-4cac-4816-ae41-5c3f9a2f76aa\/settings.json", + "path": "src\/87faa133-4cac-4816-ae41-5c3f9a2f76aa", + "guid": "87faa133-4cac-4816-ae41-5c3f9a2f76aa" + }, + "fff3255d-c493-4c21-a48f-73b3ebf8ba05": { + "name": "Templatelayout", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/fff3255d-c493-4c21-a48f-73b3ebf8ba05\/code.php", + "settings": "src\/fff3255d-c493-4c21-a48f-73b3ebf8ba05\/settings.json", + "path": "src\/fff3255d-c493-4c21-a48f-73b3ebf8ba05", + "guid": "fff3255d-c493-4c21-a48f-73b3ebf8ba05" + }, + "2e6731ba-3a03-4836-b2c2-4e50e38cb890": { + "name": "GetScriptInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces", + "code": "src\/2e6731ba-3a03-4836-b2c2-4e50e38cb890\/code.php", + "settings": "src\/2e6731ba-3a03-4836-b2c2-4e50e38cb890\/settings.json", + "path": "src\/2e6731ba-3a03-4836-b2c2-4e50e38cb890", + "guid": "2e6731ba-3a03-4836-b2c2-4e50e38cb890" + }, + "1aefb8f5-486f-4f00-adf9-696340b3254e": { + "name": "InstallInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Extension", + "code": "src\/1aefb8f5-486f-4f00-adf9-696340b3254e\/code.php", + "settings": "src\/1aefb8f5-486f-4f00-adf9-696340b3254e\/settings.json", + "path": "src\/1aefb8f5-486f-4f00-adf9-696340b3254e", + "guid": "1aefb8f5-486f-4f00-adf9-696340b3254e" + }, + "1d929017-a5de-4e0f-9b5a-838934857e26": { + "name": "InstallScript", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Extension\\JoomlaThree", + "code": "src\/1d929017-a5de-4e0f-9b5a-838934857e26\/code.php", + "settings": "src\/1d929017-a5de-4e0f-9b5a-838934857e26\/settings.json", + "path": "src\/1d929017-a5de-4e0f-9b5a-838934857e26", + "guid": "1d929017-a5de-4e0f-9b5a-838934857e26" + }, + "ed9591cb-0a03-400a-bf47-eaf78ab19b9d": { + "name": "Extension", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/ed9591cb-0a03-400a-bf47-eaf78ab19b9d\/code.php", + "settings": "src\/ed9591cb-0a03-400a-bf47-eaf78ab19b9d\/settings.json", + "path": "src\/ed9591cb-0a03-400a-bf47-eaf78ab19b9d", + "guid": "ed9591cb-0a03-400a-bf47-eaf78ab19b9d" + }, + "99368a6f-2f64-4d4e-ad3a-544d4020ecc6": { + "name": "DatabaseName", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field", + "code": "src\/99368a6f-2f64-4d4e-ad3a-544d4020ecc6\/code.php", + "settings": "src\/99368a6f-2f64-4d4e-ad3a-544d4020ecc6\/settings.json", + "path": "src\/99368a6f-2f64-4d4e-ad3a-544d4020ecc6", + "guid": "99368a6f-2f64-4d4e-ad3a-544d4020ecc6" + }, + "24da9672-e47f-4bb1-b6c0-0ebfc17f0957": { + "name": "CoreValidation", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Field\\JoomlaThree", + "code": "src\/24da9672-e47f-4bb1-b6c0-0ebfc17f0957\/code.php", + "settings": "src\/24da9672-e47f-4bb1-b6c0-0ebfc17f0957\/settings.json", + "path": "src\/24da9672-e47f-4bb1-b6c0-0ebfc17f0957", + "guid": "24da9672-e47f-4bb1-b6c0-0ebfc17f0957" + }, + "c6c30d66-3106-44eb-9272-b2cf7ec74613": { + "name": "Field", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/c6c30d66-3106-44eb-9272-b2cf7ec74613\/code.php", + "settings": "src\/c6c30d66-3106-44eb-9272-b2cf7ec74613\/settings.json", + "path": "src\/c6c30d66-3106-44eb-9272-b2cf7ec74613", + "guid": "c6c30d66-3106-44eb-9272-b2cf7ec74613" + }, + "071c7cff-4c88-4b80-bd99-066c572dcb71": { + "name": "Structure", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Joomlamodule", + "code": "src\/071c7cff-4c88-4b80-bd99-066c572dcb71\/code.php", + "settings": "src\/071c7cff-4c88-4b80-bd99-066c572dcb71\/settings.json", + "path": "src\/071c7cff-4c88-4b80-bd99-066c572dcb71", + "guid": "071c7cff-4c88-4b80-bd99-066c572dcb71" + }, + "295186de-5954-4a65-a4c1-2f79ef305743": { + "name": "Joomlamodule", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/295186de-5954-4a65-a4c1-2f79ef305743\/code.php", + "settings": "src\/295186de-5954-4a65-a4c1-2f79ef305743\/settings.json", + "path": "src\/295186de-5954-4a65-a4c1-2f79ef305743", + "guid": "295186de-5954-4a65-a4c1-2f79ef305743" + }, + "a900b836-f2eb-4f13-8f28-b7cac839c7ff": { + "name": "Structure", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Joomlaplugin", + "code": "src\/a900b836-f2eb-4f13-8f28-b7cac839c7ff\/code.php", + "settings": "src\/a900b836-f2eb-4f13-8f28-b7cac839c7ff\/settings.json", + "path": "src\/a900b836-f2eb-4f13-8f28-b7cac839c7ff", + "guid": "a900b836-f2eb-4f13-8f28-b7cac839c7ff" + }, + "9eba241c-af90-42dd-ae05-92ff4d8391d3": { + "name": "Joomlaplugin", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/9eba241c-af90-42dd-ae05-92ff4d8391d3\/code.php", + "settings": "src\/9eba241c-af90-42dd-ae05-92ff4d8391d3\/settings.json", + "path": "src\/9eba241c-af90-42dd-ae05-92ff4d8391d3", + "guid": "9eba241c-af90-42dd-ae05-92ff4d8391d3" + }, + "516f93b8-5fff-41c6-aeaf-2d93180a12cc": { + "name": "Utilities", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/516f93b8-5fff-41c6-aeaf-2d93180a12cc\/code.php", + "settings": "src\/516f93b8-5fff-41c6-aeaf-2d93180a12cc\/settings.json", + "path": "src\/516f93b8-5fff-41c6-aeaf-2d93180a12cc", + "guid": "516f93b8-5fff-41c6-aeaf-2d93180a12cc" + }, + "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9": { + "name": "Mysql", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Builder\\Update", + "code": "src\/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9\/code.php", + "settings": "src\/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9\/settings.json", + "path": "src\/2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9", + "guid": "2b5c9989-1d4e-4f59-8b95-5cd2f72f82d9" + }, + "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7": { + "name": "Builder", + "type": "class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service", + "code": "src\/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7\/code.php", + "settings": "src\/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7\/settings.json", + "path": "src\/2c76c06e-a371-4b73-9fbe-b4d9b4df55d7", + "guid": "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7" + }, + "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac": { + "name": "Factory", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler", + "code": "src\/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac\/code.php", + "settings": "src\/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac\/settings.json", + "path": "src\/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "guid": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac" + }, + "86ac0760-26f5-4746-9c7f-ce77860f80f8": { + "name": "Serverinterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/86ac0760-26f5-4746-9c7f-ce77860f80f8\/code.php", + "settings": "src\/86ac0760-26f5-4746-9c7f-ce77860f80f8\/settings.json", + "path": "src\/86ac0760-26f5-4746-9c7f-ce77860f80f8", + "guid": "86ac0760-26f5-4746-9c7f-ce77860f80f8" + } +} \ No newline at end of file